Пример #1
0
 public void fillForOperation()
 {
     try
     {
         this.comm = GenericDataAccess.CreateCommandSP("sp_Transporte_condicion_cliente");
         addParameters(5);
         this.dt = GenericDataAccess.ExecuteSelectCommand(comm);
         this._oTransporte_condicion_cliente.PLstTransporte_condicion = new List <Transporte_condicion>();
         Transporte_condicionMng oTCMng = new Transporte_condicionMng();
         foreach (DataRow dr in dt.Rows)
         {
             Transporte_condicion o = new Transporte_condicion();
             oTCMng.BindByDataRow(dr, o);
             o.PTransCondCat = new Transporte_condicion_categoria()
             {
                 Nombre = dr["categoria"].ToString()
             };
             this._oTransporte_condicion_cliente.PLstTransporte_condicion.Add(o);
         }
     }
     catch
     {
         throw;
     }
 }
Пример #2
0
        public static List <Transporte_condicion> TransCondByTransporteTipo(int id_transporte_tipo, bool entrada, bool salida)
        {
            List <Transporte_condicion> lst = new List <Transporte_condicion>();

            try
            {
                Transporte_condicion_transporte_tipoMng oMng = new Transporte_condicion_transporte_tipoMng()
                {
                    O_Transporte_condicion_transporte_tipo = new Transporte_condicion_transporte_tipo()
                    {
                        Id_transporte_tipo = id_transporte_tipo,
                        Entrada            = entrada,
                        Salida             = salida
                    }
                };
                oMng.fillLstByTransporteTipo();
                Transporte_condicionMng           oTCMng  = new Transporte_condicionMng();
                Transporte_condicion_categoriaMng oTCCMng = new Transporte_condicion_categoriaMng();
                foreach (Transporte_condicion_transporte_tipo itemTCTT in oMng.Lst)
                {
                    Transporte_condicion oTC = new Transporte_condicion()
                    {
                        Id = itemTCTT.Id_transporte_condicion
                    };
                    oTCMng.O_Transporte_condicion = oTC;
                    oTCMng.selById();
                    if (oTC.Id_transporte_condicion_categoria != null)
                    {
                        Transporte_condicion_categoria oTCC = new Transporte_condicion_categoria()
                        {
                            Id = (int)oTC.Id_transporte_condicion_categoria
                        };
                        oTCCMng.O_Transporte_condicion_categoria = oTCC;
                        oTCCMng.selById();
                        oTC.PTransCondCat = oTCC;
                    }
                    itemTCTT.PTransCond = oTC;
                    lst.Add(oTC);
                }
            }
            catch
            {
                throw;
            }
            return(lst);
        }