コード例 #1
0
        public IHttpActionResult AddBranch([FromBody] BranchDTO branchDTO)
        {
            if (branchDTO == null)
            {
                return(BadRequest("BranchDTO cannot be null"));
            }

            branchDTO = branchSvc.AddBranch(branchDTO);
            return(Ok(branchDTO));
        }
 public ActionResult AddBranch(BranchModel Branch)
 {
     try
     {
         _branchService.AddBranch(Branch);
         _branchService.Save();
         ModelState.Clear();
         ViewData["Message"] = "1";
     }
     catch
     {
         ViewData["Message"] = "0";
     }
     return(View());
 }
コード例 #3
0
 public JsonResult AddBranch(string nameBranch, string addressBranch)
 {
     _branchService.AddBranch(nameBranch, addressBranch);
     return(new JsonResult(StatusCode(200)));
 }
コード例 #4
0
ファイル: BranchManager.cs プロジェクト: Gaushee/MyOffice
 /// <summary>
 /// 添加机构信息
 /// </summary>
 /// <param name="branch"></param>
 /// <returns></returns>
 public static Branch AddBranch(Branch branch)
 {
     return(BranchService.AddBranch(branch));
 }