Пример #1
0
        internal void selByFolio()
        {
            try
            {
                this.comm = GenericDataAccess.CreateCommandSP("sp_Salida_remision");
                addParameters(7);
                DataSet ds = GenericDataAccess.ExecuteMultSelectCommand(comm);
                this.dt = ds.Tables[0];
                if (dt.Rows.Count == 1)
                {
                    DataRow dr = dt.Rows[0];
                    BindByDataRow(dr, this._oSalida_remision);

                    DataTable dtDetail = ds.Tables[1];
                    Salida_remision_detailMng oMngSRD = new Salida_remision_detailMng();
                    this._oSalida_remision.LstSRDetail = new List <Salida_remision_detail>();
                    foreach (DataRow drDet in dtDetail.Rows)
                    {
                        Salida_remision_detail oSRD = new Salida_remision_detail();
                        oMngSRD.BindByDataRow(drDet, oSRD);
                        this._oSalida_remision.LstSRDetail.Add(oSRD);
                        this._oSalida_remision.PiezaTotal += oSRD.Piezas;
                    }
                }
            }
            catch
            {
                throw;
            }
        }
Пример #2
0
 public void BindByDataRow(DataRow dr, Salida_remision_detail o)
 {
     try
     {
         int.TryParse(dr["id"].ToString(), out entero);
         o.Id   = entero;
         entero = 0;
         if (dr["id_salida_remision"] != DBNull.Value)
         {
             int.TryParse(dr["id_salida_remision"].ToString(), out entero);
             o.Id_salida_remision = entero;
             entero = 0;
         }
         if (dr["bulto"] != DBNull.Value)
         {
             int.TryParse(dr["bulto"].ToString(), out entero);
             o.Bulto = entero;
             entero  = 0;
         }
         if (dr["piezaxbulto"] != DBNull.Value)
         {
             int.TryParse(dr["piezaxbulto"].ToString(), out entero);
             o.Piezaxbulto = entero;
             entero        = 0;
         }
         if (dr["piezas"] != DBNull.Value)
         {
             int.TryParse(dr["piezas"].ToString(), out entero);
             o.Piezas = entero;
             entero   = 0;
         }
         if (dr["danado"] != DBNull.Value)
         {
             bool.TryParse(dr["danado"].ToString(), out logica);
             o.Danado = logica;
             logica   = false;
         }
         o.Lote = dr["lote"].ToString();
     }
     catch
     {
         throw;
     }
 }
Пример #3
0
 public override void fillLst()
 {
     try
     {
         this.comm = GenericDataAccess.CreateCommandSP("sp_Salida_remision_detail");
         addParameters(0);
         this.dt   = GenericDataAccess.ExecuteSelectCommand(comm);
         this._lst = new List <Salida_remision_detail>();
         foreach (DataRow dr in dt.Rows)
         {
             Salida_remision_detail o = new Salida_remision_detail();
             BindByDataRow(dr, o);
             this._lst.Add(o);
         }
     }
     catch
     {
         throw;
     }
 }
Пример #4
0
        public override void selById()
        {
            try
            {
                this.comm = GenericDataAccess.CreateCommandSP("sp_Salida_remision");
                addParameters(1);
                DataSet ds = GenericDataAccess.ExecuteMultSelectCommand(comm);
                this.dt = ds.Tables[0];
                if (dt.Rows.Count == 1)
                {
                    DataRow dr = dt.Rows[0];
                    BindByDataRow(dr, this._oSalida_remision);

                    this._oSalida_remision.Mercancia           = dr["mercancia"].ToString();
                    this._oSalida_remision.Vendor              = dr["vendor"].ToString();
                    this._oSalida_remision.Proveedor           = dr["proveedor"].ToString();
                    this._oSalida_remision.Proveedor_direccion = dr["Proveedor_direccion"].ToString();
                    this._oSalida_remision.Autorizo            = dr["autorizo"].ToString();
                    this._oSalida_remision.Elaboro             = dr["elaboro"].ToString();
                    entero = 0;
                    if (dr["id_salida_trafico"] != DBNull.Value)
                    {
                        int.TryParse(dr["id_salida_trafico"].ToString(), out entero);
                        this._oSalida_remision.Id_salida_trafico = entero;
                        entero = 0;
                    }

                    //this.O_Salida_remision.Lote = dr["lote"].ToString();

                    DataTable dtDetail = ds.Tables[1];
                    Salida_remision_detailMng oMngSRD = new Salida_remision_detailMng();
                    this._oSalida_remision.LstSRDetail = new List <Salida_remision_detail>();
                    foreach (DataRow drDet in dtDetail.Rows)
                    {
                        Salida_remision_detail oSRD = new Salida_remision_detail();
                        oMngSRD.BindByDataRow(drDet, oSRD);
                        this._oSalida_remision.LstSRDetail.Add(oSRD);
                        this._oSalida_remision.PiezaTotal += oSRD.Piezas;
                    }

                    DataTable         dtTrafico = ds.Tables[2];
                    Salida_traficoMng oMngST    = new Salida_traficoMng();
                    Salida_trafico    oST       = new Salida_trafico();
                    oMngST.BindByDataRow(dtTrafico.Rows[0], oST);
                    oST.Transporte                  = dtTrafico.Rows[0]["transporte"].ToString();
                    oST.Transporte_tipo             = dtTrafico.Rows[0]["transporte_tipo"].ToString();
                    this._oSalida_remision.PTrafico = oST;
                }
                else if (dt.Rows.Count > 1)
                {
                    throw new Exception("Error de integridad");
                }
                else
                {
                    throw new Exception("No existe información para el registro solicitado");
                }
            }
            catch
            {
                throw;
            }
        }
Пример #5
0
 public Salida_remision_detailMng()
 {
     this._oSalida_remision_detail = new Salida_remision_detail();
     this._lst = new List <Salida_remision_detail>();
 }