Ejemplo n.º 1
0
        public ActionResult Save(string InvoiceNo, string Notes, List <StockOut> stockOuts)
        {
            StockOut result      = new StockOut();
            StockOut FinalResult = new StockOut();

            //if (ModelState.IsValid)
            {
                foreach (var item in stockOuts)
                {
                    result.InvoiceNo      = InvoiceNo;
                    result.Notes          = Notes;
                    result.IsActive       = true;
                    result.CreatedDate    = DateTime.Now;
                    result.ProductionDate = DateTime.Now;
                    result.CreatedBy      = CurrentSession.GetCurrentSession().UserName;

                    result.ProductId   = item.ProductId;
                    result.BaleWeight  = item.BaleWeight;
                    result.WarehouseId = item.WarehouseId;
                    result.SupplierId  = item.SupplierId;
                    result.BaleQty     = item.BaleQty;
                    result.WeightInMon = item.WeightInMon;

                    FinalResult = service.Save(result);
                }
            }

            return(Json(FinalResult, JsonRequestBehavior.AllowGet));
        }
Ejemplo n.º 2
0
        public ActionResult Save(string InvoiceNo, string Notes, List <StockOutRequest> stockOuts)
        {
            var saved = service.Save(stockOuts, InvoiceNo, Notes);

            return(Json(saved, JsonRequestBehavior.AllowGet));
        }