Esempio n. 1
0
        public ActionResult InboundTaskDetail(InboundTaskDetailViewModel model)
        {
            if (ModelState.IsValid)
            {
                var db = new DbEntities <InboundTaskDetail>().SimpleClient;

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

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

            SetSelectListItems.Material(this, model.MaterialSizeID);
            return(View(model));
        }
Esempio n. 2
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"));
        }
Esempio n. 3
0
        /// <summary>
        /// 获取入库任务细节视图模型
        /// </summary>
        /// <param name="inboundTask"></param>
        /// <returns></returns>
        public static InboundTaskDetailViewModel GetInboundTaskDetailViewModel(InboundTaskDetail inboundTask)
        {
            InboundTaskDetailViewModel inboundTaskDetail = ConvertToViewModel <InboundTaskDetailViewModel, InboundTaskDetail>(inboundTask);

            //入库任务信息
            inboundTaskDetail.InboundTask = new DbEntities <View_InboundTask>().SimpleClient.GetSingle(ib => ib.InboundTaskID == inboundTask.InboundTaskID);

            //入库任务细节信息
            inboundTaskDetail.InboundTaskDetail = new DbEntities <View_InboundTaskDetail>().SimpleClient.GetSingle(ibd => ibd.InboundTaskDetailID == inboundTask.InboundTaskDetailID);

            return(inboundTaskDetail);
        }