Beispiel #1
0
 public void fillLstByFolio(IDbTransaction trans = null)
 {
     try
     {
         this.comm = GenericDataAccess.CreateCommandSP("sp_Proforma");
         addParameters(6);
         if (trans == null)
         {
             this.dt = GenericDataAccess.ExecuteSelectCommand(comm);
         }
         else
         {
             this.dt = GenericDataAccess.ExecuteSelectCommand(comm, trans);
         }
         this._lst = new List <Proforma>();
         foreach (DataRow dr in dt.Rows)
         {
             Proforma o = new Proforma();
             BindByDataRow(dr, o);
             this._lst.Add(o);
         }
     }
     catch
     {
         throw;
     }
 }
Beispiel #2
0
 protected void BindByDataRow(DataRow dr, Proforma o)
 {
     try
     {
         Int64.TryParse(dr["id"].ToString(), out entero64);
         o.Id     = entero64;
         entero64 = 0;
         if (dr["fecha_recibo"] != DBNull.Value)
         {
             DateTime.TryParse(dr["fecha_recibo"].ToString(), out fecha);
             o.Fecha_recibo = fecha;
             fecha          = default(DateTime);
         }
         o.Cliente = dr["cliente"].ToString();
         if (dr["id_cliente"] != DBNull.Value)
         {
             int.TryParse(dr["id_cliente"].ToString(), out entero);
             o.Id_cliente = entero;
             entero       = 0;
         }
         o.Referencia = dr["referencia"].ToString();
         o.Sid        = dr["sid"].ToString();
         o.Sku        = dr["sku"].ToString();
         o.Mercancia  = dr["mercancia"].ToString();
         o.Serielote  = dr["serielote"].ToString();
         o.Calidad    = dr["calidad"].ToString();
         if (dr["id_servicio"] != DBNull.Value)
         {
             int.TryParse(dr["id_servicio"].ToString(), out entero);
             o.Id_servicio = entero;
             entero        = 0;
         }
         if (dr["fecha_servicio"] != DBNull.Value)
         {
             DateTime.TryParse(dr["fecha_servicio"].ToString(), out fecha);
             o.Fecha_servicio = fecha;
             fecha            = default(DateTime);
         }
         o.Nombre_servicio = dr["nombre_servicio"].ToString();
         if (dr["dias_servicio"] != DBNull.Value)
         {
             int.TryParse(dr["dias_servicio"].ToString(), out entero);
             o.Dias_servicio = entero;
             entero          = 0;
         }
         if (dr["costo_servicio"] != DBNull.Value)
         {
             float.TryParse(dr["costo_servicio"].ToString(), out flotante);
             o.Costo_servicio = flotante;
             flotante         = 0;
         }
         if (dr["fecha_expedicion"] != DBNull.Value)
         {
             DateTime.TryParse(dr["fecha_expedicion"].ToString(), out fecha);
             o.Fecha_expedicion = fecha;
             fecha = default(DateTime);
         }
         else
         {
             o.Fecha_expedicion = null;
         }
         if (dr["entradas"] != DBNull.Value)
         {
             int.TryParse(dr["entradas"].ToString(), out entero);
             o.Entradas = entero;
             entero     = 0;
         }
         else
         {
             o.Entradas = null;
         }
         if (dr["salidas"] != DBNull.Value)
         {
             int.TryParse(dr["salidas"].ToString(), out entero);
             o.Salidas = entero;
             entero    = 0;
         }
         else
         {
             o.Salidas = null;
         }
         if (dr["saldo"] != DBNull.Value)
         {
             int.TryParse(dr["saldo"].ToString(), out entero);
             o.Saldo = entero;
             entero  = 0;
         }
         else
         {
             o.Saldo = null;
         }
         if (dr["valor_mercancia"] != DBNull.Value)
         {
             float.TryParse(dr["valor_mercancia"].ToString(), out flotante);
             o.Valor_mercancia = flotante;
             flotante          = 0;
         }
         if (dr["cantidad"] != DBNull.Value)
         {
             int.TryParse(dr["cantidad"].ToString(), out entero);
             o.Cantidad = entero;
             entero     = 0;
         }
         if (dr["total"] != DBNull.Value)
         {
             float.TryParse(dr["total"].ToString(), out flotante);
             o.Total  = flotante;
             flotante = 0;
         }
         if (dr["aplicada"] != DBNull.Value)
         {
             bool.TryParse(dr["aplicada"].ToString(), out logica);
             o.Aplicada = logica;
             logica     = false;
         }
         o.Folio_aplicada = dr["folio_aplicada"].ToString();
         if (dr["corte_ini"] != DBNull.Value)
         {
             DateTime.TryParse(dr["corte_ini"].ToString(), out fecha);
             o.Corte_ini = fecha;
             fecha       = default(DateTime);
         }
         if (dr["corte_fin"] != DBNull.Value)
         {
             DateTime.TryParse(dr["corte_fin"].ToString(), out fecha);
             o.Corte_fin = fecha;
             fecha       = default(DateTime);
         }
     }
     catch
     {
         throw;
     }
 }
Beispiel #3
0
 public ProformaMng()
 {
     this._oProforma = new Proforma();
     this._lst       = new List <Proforma>();
 }