コード例 #1
0
ファイル: WareHouseController.cs プロジェクト: yezhaocan/OMS
        public IActionResult Add(WareHouse wareHouse)
        {
            string name = wareHouse.Name.ToString();

            if (_wareHouseService.GetCountByName(name))
            {
                return(View(wareHouse));
            }
            else
            {
                _wareHouseService.Add(wareHouse);
                return(RedirectToAction("Index"));
            }
        }
コード例 #2
0
        public IActionResult Add(WareHouse wareHouse)
        {
            if (!_permissionService.Authorize("AddWareHouse"))
            {
                return(View("_AccessDeniedView"));
            }
            string name = wareHouse.Name.Trim();
            string code = wareHouse.Code.Trim();

            if (_wareHouseService.GetCountByName(name, code))
            {
                return(Error("已有仓库名或仓库代码!"));
            }
            else
            {
                _wareHouseService.Add(wareHouse);
                return(Success());
            }
        }