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()); }
public JsonResult AddBranch(string nameBranch, string addressBranch) { _branchService.AddBranch(nameBranch, addressBranch); return(new JsonResult(StatusCode(200))); }
/// <summary> /// 添加机构信息 /// </summary> /// <param name="branch"></param> /// <returns></returns> public static Branch AddBranch(Branch branch) { return(BranchService.AddBranch(branch)); }