public static MSupplier MSupplierEmpty(this BoSupplier oBSupplier) { var oObject = LiUtilsLib.bll_GetObjectByName(MGlobalVariables.LNameObjectSupplier); var oMSupplier = new MSupplier { LObject = new MObject { LIdObject = oObject.LIdObject, LNameObject = oObject.LNameObject }, LStatus = new MStatus { LDsEstado = null, LIdStatus = null }, LTypeIdentification = new MTypeIdentification { LIdTypeIdentification = 0, LTypeIdentification = null }, LListTypeIdentification = new List <SelectListItem>(), LListStatus = new List <SelectListItem>(), LNameSupplier = null, LNoIdentification = null, LIdSupplier = 0, LCreationDate = new DateTime(), LModificationDate = new DateTime() }; oMSupplier.LListTypeIdentification = LiTypeIdentification.bll_getListTypeIdentification().MListAllTypeIdentificationWithSelect(true); oMSupplier.LListStatus = LiStatus.Bll_getListStatusByIdObject(oMSupplier.LObject.LIdObject).MListStatusWithSelect(); return(oMSupplier); }
public static MSupplier MSupplierById(this BoSupplier pBoSupplier) { var lMSupplier = new MSupplier { LObject = new MObject { LIdObject = pBoSupplier.LObject.LIdObject, LNameObject = pBoSupplier.LObject.LNameObject }, LStatus = new MStatus { LDsEstado = pBoSupplier.LStatus.LDsEstado, LIdStatus = pBoSupplier.LStatus.LIdStatus }, LTypeIdentification = new MTypeIdentification { LIdTypeIdentification = pBoSupplier.LTypeIdentification.LIdTypeIdentification, LTypeIdentification = pBoSupplier.LTypeIdentification.LTypeIdentification }, LListTypeIdentification = new List <SelectListItem>(), LListStatus = new List <SelectListItem>(), LNameSupplier = pBoSupplier.LNameSupplier, LNoIdentification = pBoSupplier.LNoIdentification, LIdSupplier = pBoSupplier.LIdSupplier, LCreationDate = pBoSupplier.LCreationDate, LModificationDate = pBoSupplier.LModificationDate }; lMSupplier.LListTypeIdentification = LiTypeIdentification.bll_getListTypeIdentification().MListAllTypeIdentification(); lMSupplier.LListStatus = LiStatus.Bll_getListStatusByIdObject(pBoSupplier.LObject.LIdObject).MListAllStatus(); return(lMSupplier); }
public string bll_DeleteSupplier(int pIdSupplier) { var lSupplier = new BoSupplier { LIdSupplier = pIdSupplier }; return(this.LiDaosupplier.Dao_DeleteSupplier(lSupplier)); }
public string Dao_InsertSupplier(BoSupplier pSupplier) { this.LListParam = new List <SqlParameter>(); dao_Addparameters(this.LListParam, SqlDbType.VarChar, "@NameSupplier", pSupplier.LNameSupplier); dao_Addparameters(this.LListParam, SqlDbType.Int, "@IdTypeIdentification", pSupplier.LTypeIdentification.LIdTypeIdentification.ToString()); dao_Addparameters(this.LListParam, SqlDbType.VarChar, "@NoIdentification", pSupplier.LNoIdentification); dao_Addparameters(this.LListParam, SqlDbType.VarChar, "@IdStatus", pSupplier.LStatus.LIdStatus); dao_Addparameters(this.LListParam, SqlDbType.Int, "@IdObject", pSupplier.LObject.LIdObject.ToString()); return(Dao_executeSqlTransactionWithProcedement(this.LListParam, "LTranInsertSupplier", "spr_CreateSupplier")); }
public string bll_InsertSupplier(string pNameSupplier, string pNoIdentification, int pIdTypeIdentifiction, int pIdObject, string pIdStatus) { var lSupplier = new BoSupplier { LObject = new BoObject { LIdObject = pIdObject }, LStatus = new BoStatus { LIdStatus = pIdStatus }, LTypeIdentification = new BoTypeIdentification { LIdTypeIdentification = pIdTypeIdentifiction }, LNameSupplier = pNameSupplier, LNoIdentification = pNoIdentification }; return(this.LiDaosupplier.Dao_InsertSupplier(lSupplier)); }
public List <BoSupplier> Dao_getSupplierListAll() { SqlConnection lConex = new SqlConnection(); using (lConex = Dao_SqlConnection(lConex)) { var lListSupplier = new List <BoSupplier>(); try { var lCommand = new SqlCommand { CommandText = "spr_GetListAllSupplier", CommandTimeout = 30, CommandType = CommandType.StoredProcedure, Connection = lConex }; var lReader = lCommand.ExecuteReader(); if (lReader.HasRows) { while (lReader.Read()) { var oSupplier = new BoSupplier { LTypeIdentification = new BoTypeIdentification { LIdTypeIdentification = Convert.ToInt32(lReader["IdTypeIdentification"].ToString()), LTypeIdentification = lReader["TypeIdentification"].ToString() }, LIdSupplier = Convert.ToInt32(lReader["IdSupplier"].ToString()), LNameSupplier = lReader["NameSupplier"].ToString(), LNoIdentification = lReader["NoIdentification"].ToString(), LCreationDate = Convert.ToDateTime(lReader["CreationDate"].ToString()), LStatus = new BoStatus { LIdStatus = lReader["IdStatus"].ToString(), LDsEstado = lReader["DsEstado"].ToString() }, LObject = new BoObject { LIdObject = Convert.ToInt32(lReader["IdObject"].ToString()), LNameObject = lReader["NameObject"].ToString() }, LModificationDate = Convert.ToDateTime(lReader["ModificationDate"]) }; lListSupplier.Add(oSupplier); } } Dao_CloseSqlconnection(lConex); return(lListSupplier); } catch (Exception e) { lListSupplier = new List <BoSupplier>(); var oSupplier = new BoSupplier { LException = e.Message, LMessageDao = BoErrors.MsgErrorGetSql }; if (e.InnerException != null) { oSupplier.LInnerException = e.InnerException.ToString(); } Dao_CloseSqlconnection(lConex); lListSupplier.Add(oSupplier); return(lListSupplier); } } }
public string Dao_DeleteSupplier(BoSupplier pSupplier) { this.LListParam = new List <SqlParameter>(); dao_Addparameters(this.LListParam, SqlDbType.Int, "@IdSupplier", pSupplier.LIdSupplier.ToString()); return(Dao_executeSqlTransactionWithProcedement(this.LListParam, "LTranDeleteSupplier", "spr_DeleteSupplier")); }
// GET: Supplier/Create public ActionResult Create() { var lBoSupplier = new BoSupplier(); return(this.View(lBoSupplier.MSupplierEmpty())); }