public ActionResult InsertAllot(AllotViewModel vm) { if (vm.FromShelfId == vm.ToShelfId) { ModelState.AddModelError("", "调入调出柜台不能相同"); return(View("Allot", GetAllotViewModel())); } if (!TaskManager.IsSameCategory(vm.FromShelfId, vm.ToShelfId)) { ModelState.AddModelError("", "只能在相同品类中调拨"); return(View("Allot", GetAllotViewModel())); } _taskAppService.InsertAllot(vm.ObjectId, vm.FromShelfId, vm.ToShelfId, vm.Quantity, vm.Remark, GetWorkerId()); return(RedirectToAction("AllotList")); }