Exemplo n.º 1
0
        public ActionResult InventoryList()
        {
            //下拉框设置
            SetSelectListItems.InboundTaskDetail(this);
            SetSelectListItems.OutboundTaskDetail(this);
            SetSelectListItems.Tray(this);
            SetSelectListItems.InventoryLocation(this);

            return(View());
        }
Exemplo n.º 2
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());
        }