//Edit Vendor public TransactionStatus EditVendor(VendorEditBo vendoreditBo) { var transactionStatus = new TransactionStatus(); var vendor = BuiltVendorDomain1(vendoreditBo); #region using sql helper DateTime dt = new DateTime(); dt = DateTime.Now; int value = 1; string flag = "true"; string LMK = "LMK"; CemexDb con = new CemexDb(); SqlParameter[] Params = { new SqlParameter("@opReturnValue", value), //30 new SqlParameter("@Vndr_Id", vendor.Vndr_Id), //0 new SqlParameter("@Vndr_Name", vendor.Vndr_Name), //6 new SqlParameter("@Vndr_Cinno", vendor.Vndr_Cinno), //7 new SqlParameter("@Vndr_Addr1", vendor.Vndr_Addr1), //8 new SqlParameter("@Vndr_Gps_Pos", vendor.Vndr_Gps_Pos), //10 // new SqlParameter("@Vndr_Lanline_Nos", vendor.Vndr_Lanline_Nos),//11 new SqlParameter("@Vndr_Overview", vendor.Vndr_Overview), //13 new SqlParameter("@Vndr_created_on", dt), //14 new SqlParameter("@Vndr_Activated_on", dt), //15 new SqlParameter("@Vndr_Commercial_Estab_Flag", flag), //16 new SqlParameter("@Vndr_Verfied_By", LMK), //17 new SqlParameter("@Vndr_Verfied_on", dt), //18 new SqlParameter("@Vndr_Approved_By", LMK), //19 new SqlParameter("@Vndr_Approved_on", dt), //20 new SqlParameter("@Vndr_Active_Flag", flag), //21 new SqlParameter("@Vndr_Contact_person", vendor.Vndr_Contact_person), //23 new SqlParameter("@Vndr_Contact_Email", vendor.Vndr_Contact_Email), //24 new SqlParameter("@Vndr_Contact_Nos", vendor.Vndr_Contact_Nos), //25 new SqlParameter("@Vndr_Alternate_person", vendor.Vndr_Alternate_person), //26 new SqlParameter("@Vndr_Alternate_Email", vendor.Vndr_Alternate_Email), //27 new SqlParameter("@Vndr_Alternate_Nos", vendor.Vndr_Alternate_Nos), //28 new SqlParameter("@Image_dir", vendoreditBo.Image_dir), //29 new SqlParameter("@Vndr_Alternate_Mobile", vendor.Vndr_Alternate_Mobile), //30 new SqlParameter("@Vndr_Alternate_Designation", vendor.Vndr_Alternate_Designation), //31 new SqlParameter("@Vndr_Contact_Mobile", vendor.Vndr_Contact_Mobile), //33 new SqlParameter("@Vndr_Contact_Designation", vendor.Vndr_Contact_Designation), //33 new SqlParameter("@CityID", vendor.City_Id), //33 }; Params[0].Direction = ParameterDirection.Output; DataSet ds = SqlHelper.ExecuteDataset(con.GetConnection(), CommandType.StoredProcedure, "proc_UpdateVendorDetails", Params); ds.Locale = CultureInfo.InvariantCulture; string test = Params[0].Value.ToString(); return(transactionStatus); #endregion }
//Delete DeleteVendor public TransactionStatus DeleteVendor(VendorEditBo vendorEditBo) { var transactionStatus = new TransactionStatus(); var vendor = BuiltVendorDomain1(vendorEditBo); CemexDb con = new CemexDb(); SqlConnection conn = con.GetConnection(); conn.Open(); SqlCommand cmd = new SqlCommand("dbo.Proc_DeleteUser", conn); cmd.CommandType = CommandType.StoredProcedure; cmd.Parameters.AddWithValue("@Id", Convert.ToInt32(vendorEditBo.Vndr_Id)); cmd.ExecuteNonQuery(); return(transactionStatus); }
private VendorEdit BuiltVendorDomain1(VendorEditBo userBo) { return((VendorEdit) new VendorEdit().InjectFrom(userBo)); }