public static int SaveCategory(int? p_ParentCategoryID, string p_Name, string p_CategoryCode, bool p_bShowOpen, string p_Picture) { StoredProcedure sp = new StoredProcedure("p_Categories_i"); sp["@ParentCategoryID"].Value = p_ParentCategoryID==null?DBNull.Value:(object) p_ParentCategoryID; sp["@Name"].Value = p_Name.Trim(); sp["@CategoryCode"].Value = p_CategoryCode.Trim(); sp["@ShowOpen"].Value = p_bShowOpen; sp["@Picture"].Value = p_Picture; return sp.ExecuteReturn(); }
public static int SaveCustomerAddress(DataBaseTransaction p_tran, int p_CustomerID, string p_Address1, string p_Address2, string p_City, string p_State, string p_ZIP, int p_Country, string p_DayPhone, string p_MobilePhone, string p_Email) { StoredProcedure sp = new StoredProcedure("p_CustomerAddresses_i", p_tran); sp["@CustomerID"].Value = p_CustomerID; sp["@Address1"].Value = p_Address1.Trim(); sp["@Address2"].Value = p_Address2 == null ? DBNull.Value : (object)p_Address2; sp["@City"].Value = p_City.Trim(); sp["@State"].Value = p_State.Trim(); sp["@ZIP"].Value = p_ZIP.Trim(); sp["@Country"].Value = p_Country; sp["@DayPhone"].Value = p_DayPhone; sp["@MobilePhone"].Value = p_MobilePhone.Trim(); sp["@Email"].Value = p_Email.Trim(); return sp.ExecuteReturn(); }