public ActionResult AddBranch(AddBranchDetails model) { if (!ModelState.IsValid || _branchService.BranchExist(model.OrganisationId, model.Name) || _branchService.BranchCodeExist(model.OrganisationId, model.Code ?? 0)) return View(model); _branchService.AddBranch(model.OrganisationId,new BranchBO { Name = model.Name, Code = model.Code ?? 0 }); return RedirectToAction("OrganisationBranchesList",new { organisationId = model.OrganisationId }); }