Ejemplo n.º 1
0
        public ActionResult WavePickingDetail(string id)
        {
            if (int.TryParse(id, out int wpdid))
            {
                //当前的波次单
                var curWP = new DbEntities <WavePicking>().SimpleClient.GetById(wpdid);
                if (curWP != null)
                {
                    WavePickingDetailViewModel model = new WavePickingDetailViewModel
                    {
                        WavePickingID = curWP.WavePickingID,
                        WavePickingNo = curWP.WavePickingNo
                    };

                    //下拉框
                    SetSelectListItems.OutboundTaskDetail(this);
                    SetSelectListItems.Material(this);
                    SetSelectListItems.TrayDetail(this);
                    SetSelectListItems.InventoryList(this);

                    return(View(model));
                }
            }

            TempData["Msg"] = "没有找到对象";
            return(RedirectToAction("WavePicking", "Warehouse"));
        }
Ejemplo n.º 2
0
        public ActionResult OutboundTaskDetail(OutboundTaskDetailViewModel model)
        {
            if (ModelState.IsValid)
            {
                var db = new DbEntities <OutboundTaskDetail>().SimpleClient;

                if (new IdentityAuth().GetCurUserID(HttpContext, out int curUserID))
                {
                    OutboundTaskDetail entity = model.InitAddOutboundTaskDetail(curUserID);

                    if (db.Insert(entity))
                    {
                        TempData["Msg"] = $"出库任务细节单 [{model.OutboundTaskInfo_OutboundTaskNo}] 添加成功";
                        return(RedirectToAction("OutboundTask", "Warehouse"));
                    }
                    TempData["Msg"] = "添加失败";
                }
                else
                {
                    TempData["Msg"] = "登录身份过期,请重新登录";
                }
            }

            SetSelectListItems.Material(this, model.MaterialSizeID);
            return(View(model));
        }
Ejemplo n.º 3
0
        public ActionResult OutboundTaskDetail(string obtid = null)
        {
            //关联的出库单ID
            if (int.TryParse(obtid, out int curobtID))
            {
                var db = new DbEntities <OutboundTask>().SimpleClient;

                //当前出库任务单信息
                var OutboundTaskInfo = db.GetById(curobtID);

                if (OutboundTaskInfo != null)
                {
                    OutboundTaskDetailViewModel model = new OutboundTaskDetailViewModel
                    {
                        OutboundTaskID = curobtID,
                        OutboundTaskInfo_OutboundTaskNo = OutboundTaskInfo.OutboundTaskNo
                    };

                    //设置物资规格
                    SetSelectListItems.Material(this);
                    return(View(model));
                }
            }

            TempData["Msg"] = "没有找到对象";
            return(RedirectToAction("OutboundTask", "Warehouse"));
        }
Ejemplo n.º 4
0
        public ActionResult InboundTaskDetail(string ibtid = null)
        {
            //关联的入库单ID
            if (int.TryParse(ibtid, out int curibtID))
            {
                var db = new DbEntities <InboundTask>().SimpleClient;

                var InboundTaskInfo = db.GetById(curibtID);

                if (InboundTaskInfo != null)
                {
                    InboundTaskDetailViewModel model = new InboundTaskDetailViewModel
                    {
                        InboundTaskID = curibtID,
                        InboundTaskInfo_InboundTaskNo = InboundTaskInfo.InboundTaskNo
                    };

                    //设置物资规格
                    SetSelectListItems.Material(this);
                    return(View(model));
                }
            }

            TempData["Msg"] = "没有找到对象";
            return(RedirectToAction("InboundTask", "Warehouse"));
        }
Ejemplo n.º 5
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.º 6
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"));
        }