Beispiel #1
0
        public async Task <JsonResult> getWarehouseProductList(string warehouseCode, string criteria)
        {
            List <WarehouseProduct> list = new List <WarehouseProduct>();

            try
            {
                _productTransferServices = new ProductTransferServices();
                var result = await _productTransferServices.GetByCriteria(warehouseCode, criteria);

                if (result == null)
                {
                    ModelState.AddModelError("", "Error al buscar el producto");
                }
                else
                {
                    list = result;
                }
            }
            catch (System.Exception)
            {
                return(null);
            }

            return(Json(list, JsonRequestBehavior.AllowGet));
        }
Beispiel #2
0
        public async Task <ActionResult> Detail(string id)
        {
            TransferDetail transfer = new TransferDetail();

            try
            {
                _productTransferServices = new ProductTransferServices();

                var result = await _productTransferServices.Get(int.Parse(id));

                if (result == null)
                {
                    ModelState.AddModelError("", "Error al cargar la lista de almacenes");
                }
                else
                {
                    transfer = result;
                }
            }
            catch (System.Exception)
            {
                return(null);

                throw;
            }

            return(View("Detail", transfer));
        }
Beispiel #3
0
        public async Task <ActionResult> SaveTransfer(ProductTransferModels model)
        {
            ProductTransfer productTransfer = new ProductTransfer()
            {
                warehouseOrigin  = model.warehouseOrigin,
                warehouseDestiny = model.warehouseDestiny,
                observation      = model.observation,
                status           = "0",
                products         = model.products,
                dateCreated      = DateTime.Now.ToString("dd/MM/yyyy hh:mm")
            };

            try
            {
                _productTransferServices = new ProductTransferServices();
                var result = await _productTransferServices.SaveProductTransfer(productTransfer);

                if (result == null)
                {
                    ModelState.AddModelError("", "Error al buscar el producto");
                }
            }
            catch (System.Exception)
            {
                return(null);
            }

            return(RedirectToAction("getAll"));
        }
 public WarehouseProductTransferViewModel()
 {
     _warehouseServices        = new WarehouseServices();
     _productTransferServices  = new ProductTransferServices();
     _xmlServices              = new XmlServices();
     ProductTransferCollection = new ObservableCollection <ProductToTransfer>();
     LoadWarehouses();
 }
Beispiel #5
0
        private async Task <StaticPagedList <TransferDetail> > ListTransfer(int aPage, int aItemsPerPage, string aStringSearch)
        {
            _productTransferServices = new ProductTransferServices();

            List <TransferDetail> x = new List <TransferDetail>();

            var transfers = await _productTransferServices.GetRequests(aPage - 1, aItemsPerPage, aStringSearch);

            x = transfers.Item1;

            return(new StaticPagedList <TransferDetail>(x, aPage, aItemsPerPage, transfers.Item2));
        }
Beispiel #6
0
 public ProductTransferDetailViewModel(int id)
 {
     ProductsCollection       = new ObservableCollection <ProductTransferDetailExtend>();
     _productTransferServices = new ProductTransferServices();
     loadDetail(id);
 }
Beispiel #7
0
 public SearchProductTransferViewModel()
 {
     _productTransferServices         = new ProductTransferServices();
     ProductTransferSummaryCollection = new ObservableCollection <TransferDetail>();
     Search();
 }