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

            return(View());
        }
Ejemplo 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());
        }
Ejemplo n.º 3
0
        public ActionResult TrayDetail(TrayDetailViewModel model)
        {
            if (ModelState.IsValid)
            {
                var db = new DbEntities <TrayDetail>().SimpleClient;

                ////入库明细、物资规格、托盘不能都相同
                //if (db.IsAny(t => t.InboundTaskDetailID == model.InboundTaskDetailID && t.MaterialSizeID == model.MaterialSizeID && t.TrayDetailID == model.TrayDetailID))

                //当前的托盘盘是否已经添加
                if (db.IsAny(t => t.TrayID == model.TrayID))
                {
                    TempData["Msg"] = "该托盘单细节已存在";
                }
                else
                {
                    //登录人信息
                    if (new IdentityAuth().GetCurUserID(HttpContext, out int curUserID))
                    {
                        TrayDetail entity = model.InitAddTrayDetail(curUserID);

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

            SetSelectListItems.InboundTaskDetail(this);
            SetSelectListItems.Material(this);
            return(View(model));
        }
Ejemplo n.º 4
0
        public ActionResult TrayDetail(string tdid = null)
        {
            //关联托盘单
            if (int.TryParse(tdid, out int id))
            {
                var db = new DbEntities <TrayDetail>().SimpleClient;

                if (db.GetById(id) == null)
                {
                    TrayDetailViewModel model = new TrayDetailViewModel
                    {
                        TrayID = id,
                    };

                    SetSelectListItems.InboundTaskDetail(this);
                    SetSelectListItems.Material(this);
                    return(View(model));
                }
            }

            TempData["Msg"] = "请先选择对应托盘";
            return(RedirectToAction("Tray", "Warehouse"));
        }