Created
August 17, 2010 13:38
-
-
Save codereflection/529955 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BusinessCardInfoUtility | |
{ | |
public static int AddBusinessCardInfo(BusinessCardInfo bci) | |
{ | |
string sprocName = "SC_CreateBusinessCardInfoTwo"; | |
int intBusinessCardId = Convert.ToInt32(SqlHelper.ExecuteScalar(Global.ConnString, sprocName, | |
bci.CustomerId, bci.BusinessCardDesignID, bci.BCardHtmlBlock, bci.CompanyName, bci.CompanyMessage, | |
bci.FullName, bci.JobTitle, bci.AddressLine1, bci.AddressLine2, bci.State, | |
bci.AddressLine3, bci.Phone, bci.Fax, bci.PhoneTwo, bci.PhoneThree, bci.PhoneTypeOne, bci.PhoneTypeTwo, bci.PhoneTypeThree, bci.PhoneTypeFour, bci.Email, bci.Website, bci.CreatedBy, | |
bci.CreatedDate, bci.UpdatedBy, bci.UpdatedDate)); | |
return intBusinessCardId; | |
} | |
public static void UpdateBusinessCardInfo(BusinessCardInfo bci) | |
{ | |
string sprocName = "SC_UpdateBusinessCardInfoTwo"; | |
SqlHelper.ExecuteNonQuery(Global.ConnString, sprocName, | |
bci.BusinessCardId, bci.BusinessCardDesignID, bci.BCardHtmlBlock, bci.CustomerId, bci.CompanyName, bci.CompanyMessage, | |
bci.FullName, bci.JobTitle, bci.AddressLine1, bci.AddressLine2, bci.State, | |
bci.AddressLine3, bci.Phone, bci.Fax, bci.PhoneTwo, bci.PhoneThree, bci.PhoneTypeOne, bci.PhoneTypeTwo, bci.PhoneTypeThree, bci.PhoneTypeFour, bci.Email, bci.Website, bci.CreatedBy, | |
bci.CreatedDate, bci.UpdatedBy, bci.UpdatedDate); | |
} | |
public static void UpdateBusinessCardInformation(BusinessCardInfo bci, int BusinessCardId) | |
{ | |
string sprocName = "SC_UpdateBusinessCardInfoTwo"; | |
SqlHelper.ExecuteNonQuery(Global.ConnString, sprocName, | |
BusinessCardId, bci.CustomerId, bci.BusinessCardDesignID, bci.BCardHtmlBlock, bci.CompanyName, bci.CompanyMessage, | |
bci.FullName, bci.JobTitle, bci.AddressLine1, bci.AddressLine2, bci.State, | |
bci.AddressLine3, bci.Phone, bci.Fax, bci.PhoneTwo, bci.PhoneThree, bci.PhoneTypeOne, bci.PhoneTypeTwo, bci.PhoneTypeThree, bci.PhoneTypeFour, bci.Email, bci.Website, bci.CreatedBy, | |
bci.CreatedDate, bci.UpdatedBy, bci.UpdatedDate); | |
} | |
public static BusinessCardInfo GetBusinessCardInfo(int BusinessCardID) | |
{ | |
BusinessCardInfo bci = new BusinessCardInfo(); | |
string sprocName = "SC_GetBusinessCardInfotwo"; | |
SqlDataReader rd = SqlHelper.ExecuteReader(Global.ConnString, sprocName, BusinessCardID); | |
while (rd.Read()) | |
{ | |
bci.CustomerId = Convert.ToInt32(rd["CustomerId"]); | |
bci.BusinessCardDesignID = Convert.ToInt32(rd["BusinessCardDesignID"]); | |
bci.BCardHtmlBlock = Convert.ToString(rd["BCardHtmlBlock"]); | |
bci.CompanyName = rd["CompanyName"].ToString(); | |
bci.CompanyMessage = rd["CompanyMessage"].ToString(); | |
bci.FullName = rd["FullName"].ToString(); | |
bci.JobTitle = rd["JobTitle"].ToString(); | |
bci.AddressLine1 = rd["AddressLine1"].ToString(); | |
bci.AddressLine2 = rd["AddressLine2"].ToString(); | |
bci.State = rd["State"].ToString(); | |
bci.AddressLine3 = rd["AddressLine3"].ToString(); | |
bci.Phone = rd["Phone"].ToString(); | |
bci.Fax = rd["Fax"].ToString(); | |
bci.PhoneTwo = rd["PhoneTwo"].ToString(); | |
bci.PhoneThree = rd["PhoneThree"].ToString(); | |
bci.PhoneTypeOne = rd["PhoneTypeOne"].ToString(); | |
bci.PhoneTypeTwo = rd["PhoneTypeTwo"].ToString(); | |
bci.PhoneTypeThree = rd["PhoneTypeThree"].ToString(); | |
bci.PhoneTypeFour = rd["PhoneTypeFour"].ToString(); | |
bci.Email = rd["Email"].ToString(); | |
bci.Website = rd["Website"].ToString(); | |
bci.CreatedBy = rd["CreatedBy"].ToString(); | |
bci.CreatedDate = Convert.ToDateTime(rd["CreatedDate"]); | |
bci.UpdatedBy = rd["UpdatedBy"].ToString(); | |
bci.UpdatedDate = Convert.ToDateTime(rd["UpdatedDate"]); | |
} | |
return bci; | |
} | |
public BusinessCardInfoUtility() | |
{ | |
// | |
// TODO: Add constructor logic here | |
// | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment