Esempio n. 1
0
        public ActionResult InventoryAllocation(InventoryAllocationViewModel model)
        {
            if (ModelState.IsValid)
            {
                if (new IdentityAuth().GetCurUserID(HttpContext, out int curUserID))
                {
                    InventoryAllocation entity = model.InitAddInventoryAllocation(curUserID);

                    if (new DbEntities <InventoryAllocation>().SimpleClient.Insert(entity))
                    {
                        TempData["Msg"] = "库位分配成功";
                        return(RedirectToAction("InventoryAllocation", "Warehouse"));
                    }
                    TempData["Msg"] = "失败";
                }
                else
                {
                    TempData["Msg"] = "登录身份过期,请重新登录";
                }
            }

            SetSelectListItems.MaterialType(this, model.MaterialTypeID);
            SetSelectListItems.InventoryLocation(this, model.InventoryLocationID);
            return(View(model));
        }
Esempio n. 2
0
        public ActionResult InventoryList()
        {
            //下拉框设置
            SetSelectListItems.InboundTaskDetail(this);
            SetSelectListItems.OutboundTaskDetail(this);
            SetSelectListItems.Tray(this);
            SetSelectListItems.InventoryLocation(this);

            return(View());
        }
Esempio n. 3
0
        public ActionResult InventoryAllocation(string Id = null)
        {
            SetSelectListItems.MaterialType(this);

            if (int.TryParse(Id, out int curInventoryLocationID))
            {
                SetSelectListItems.InventoryLocation(this, curInventoryLocationID);
            }
            else
            {
                SetSelectListItems.InventoryLocation(this);
            }
            return(View());
        }
Esempio n. 4
0
        public ActionResult InventoryList(InventoryListViewModel model)
        {
            if (ModelState.IsValid)
            {
                var db = new DbEntities <InventoryList>().SimpleClient;

                //信息记录不重复
                if (db.IsAny(il => il.InboundTaskDetailID == model.InboundTaskDetailID && il.OutboundTaskDetailID == model.OutboundTaskDetailID && il.TrayID == model.TrayID && il.InventoryLocationID == model.InventoryLocationID && il.InventoryType == model.InventoryType))
                {
                    TempData["Msg"] = "该条记录已存在";
                }
                else
                {
                    //登录人信息
                    if (new IdentityAuth().GetCurUserID(HttpContext, out int curUserID))
                    {
                        InventoryList entity = model.InitAddInventoryList(curUserID);

                        if (db.Insert(entity))
                        {
                            TempData["Msg"] = $"添加成功";
                            return(RedirectToAction("InventoryList", "Warehouse"));
                        }
                        TempData["Msg"] = "添加失败";
                    }
                    else
                    {
                        TempData["Msg"] = "登录身份过期,请重新登录";
                    }
                }
            }

            //下拉框设置
            SetSelectListItems.InboundTaskDetail(this);
            SetSelectListItems.OutboundTaskDetail(this);
            SetSelectListItems.Tray(this);
            SetSelectListItems.InventoryLocation(this);
            return(View());
        }