public ActionResult Edit(Models.Branch branch, int id) { if (ModelState.IsValid) { DataAccessLayerCommon.Branch Branch = branchMapper.MapFromModel(branch); branchRepository.Update(id, Branch); return(RedirectPermanent("/branch/showall")); } return(View(branch)); }
public ActionResult Add(Models.Branch branch) { if (ModelState.IsValid) { DataAccessLayerCommon.Branch Branch = branchMapper.MapFromModel(branch); branchRepository.Insert(Branch); return(RedirectPermanent("/branch/showall")); } return(View()); }
public ActionResult Edit(int id) { DataAccessLayerCommon.Branch branchFromCommon = branchRepository.GetItem(id); Models.Branch branch = branchMapper.MapFromEntity(branchFromCommon); return(View(branch)); }