예제 #1
0
        /// <summary>
        /// Get list productions
        /// </summary>
        /// <param name="wareHouse"></param>
        /// <returns></returns>
        public async Task <List <ProductionViewModel> > GetListProductions(string wareHouse)
        {
            List <ProductionViewModel> result     = new List <ProductionViewModel>();
            List <OracleParameter>     parameters = new List <OracleParameter>();
            var query = @"select * from V_PRODUCCION  ORDER BY PRODUCCION";

            OracleParameter opwareHouse = new OracleParameter();

            opwareHouse.DbType        = DbType.String;
            opwareHouse.Value         = wareHouse;
            opwareHouse.ParameterName = "wharehouse";
            parameters.Add(opwareHouse);


            var records = _IOracleManagment.GetData(parameters, query);

            foreach (IDataRecord rec in records)
            {
                string id   = rec.GetString(rec.GetOrdinal("CODIGO_TIPO_BODEGA"));
                string name = rec.GetString(rec.GetOrdinal("NOMBRE_TIPO_BODEGA"));
                int    cod  = rec.GetInt32(rec.GetOrdinal("CODIGO_PRODUCCION"));
                string prod = rec.GetString(rec.GetOrdinal("PRODUCCION"));


                result.Add(new ProductionViewModel
                {
                    Id                = id,
                    InternalOrder     = string.Empty,
                    NameWareHouseType = name,
                    ProductionCode    = cod,
                    ProductionName    = prod
                });
            }

            return(result);
        }
예제 #2
0
        public async Task <List <WareHouseViewModel> > GetListWareHouseByUser(string userName, int companyId)
        {
            List <WareHouseViewModel> result = new List <WareHouseViewModel>();
            var query   = @"select * from V_TIPO_BODEGA";
            var records = _IOracleManagment.GetData(null, query);

            foreach (IDataRecord rec in records)
            {
                string tipo_bodega = rec.GetString(rec.GetOrdinal("TIPO_BODEGA"));
                string id          = rec.GetString(rec.GetOrdinal("CODIGO"));
                result.Add(new WareHouseViewModel
                {
                    Id            = id,
                    WareHouseName = tipo_bodega
                });
            }

            return(result);
        }