Example #1
0
 protected void BindByDataRow(DataRow dr, Mercancia_servicio o)
 {
     try
     {
         int.TryParse(dr["id"].ToString(), out entero);
         o.Id   = entero;
         entero = 0;
         if (dr["id_cliente_mercancia"] != DBNull.Value)
         {
             int.TryParse(dr["id_cliente_mercancia"].ToString(), out entero);
             o.Id_cliente_mercancia = entero;
             entero = 0;
         }
         o.Sku = dr["sku"].ToString();
         if (dr["id_servicio"] != DBNull.Value)
         {
             int.TryParse(dr["id_servicio"].ToString(), out entero);
             o.Id_servicio = entero;
             entero        = 0;
         }
         if (dr["precio"] != DBNull.Value)
         {
             float.TryParse(dr["precio"].ToString(), out flotante);
             o.Precio = flotante;
             flotante = 0;
         }
     }
     catch
     {
         throw;
     }
 }
Example #2
0
 public override void fillLst(IDbTransaction trans = null)
 {
     try
     {
         this.comm = GenericDataAccess.CreateCommandSP("sp_Mercancia_servicio");
         addParameters(0);
         if (trans == null)
         {
             this.dt = GenericDataAccess.ExecuteSelectCommand(comm);
         }
         else
         {
             this.dt = GenericDataAccess.ExecuteSelectCommand(comm, trans);
         }
         this._lst = new List <Mercancia_servicio>();
         foreach (DataRow dr in dt.Rows)
         {
             Mercancia_servicio o = new Mercancia_servicio();
             BindByDataRow(dr, o);
             this._lst.Add(o);
         }
     }
     catch
     {
         throw;
     }
 }
Example #3
0
 public Mercancia_servicioMng()
 {
     this._oMercancia_servicio = new Mercancia_servicio();
     this._lst = new List <Mercancia_servicio>();
 }