Example #1
0
        public ActionResult Edit(int id, bool IfInventoryData = true)
        {
            var purchase = new PurchaseData();

            if (IfInventoryData)
            {
                purchase = _purchaseDataService.GetById(id);
            }
            else
            {
                purchase = _purchaseDataService.GetByInventoryDataID(id);
                if (purchase == null)
                {
                    purchase = _purchaseDataService.GetTransferCargoDataOldIdByInventoryDataID(id);
                }
            }

            //20170225 去掉 判断销售出货已经存在但是不允许修改的判断
            //if (_salesShipmentsDataService.GetByInventoryDataID(purchase.InventoryDataID)==null)
            //{
            var model = purchase.MapTo <PurchaseData, PurchaseDataModel>();

            model.GoodsList         = GetGoodsList();
            model.SupplierList      = GetSupplierList();
            model.WarehouseList     = GetWarehouseList();
            model.SpecificationList = GetSpecificationList();
            model.GoodsTypeList     = GetGoodsTypeList();
            return(View(model));
            //}
            //ErrorNotification("已经存在销售出货记录"+purchase.GoodsName+"不允许修改");
            //return RedirectToAction("Index");
        }