public ActionResult OutboundTask() { //下拉框 SetSelectListItems.OutboundType(this); SetSelectListItems.SaleType(this); return(View()); }
public ActionResult OutboundTask(OutboundTaskViewModel model) { if (ModelState.IsValid) { var db = new DbEntities <OutboundTask>().SimpleClient; //编号不重复 if (db.IsAny(ob => ob.OutboundTaskNo == model.OutboundTaskNo)) { ModelState.AddModelError("OutboundTaskNo", "该编号已存在"); } else { //登录人信息 if (new IdentityAuth().GetCurUserID(HttpContext, out int curUserID)) { OutboundTask entity = model.InitAddOutboundTask(curUserID); if (db.Insert(entity)) { TempData["Msg"] = $"出库任务单 [{entity.OutboundTaskNo}] 添加成功"; return(RedirectToAction("OutboundTask", "Warehouse")); } TempData["Msg"] = "添加失败"; } else { TempData["Msg"] = "登录身份过期,请重新登录"; } } } //下拉框 SetSelectListItems.OutboundType(this); SetSelectListItems.SaleType(this); return(View(model)); }