public void Create(UpazilaViewModel upazilaVM) { var Upazila = new Upazila { UpazilaName = upazilaVM.UpazilaName }; unitOfWork.UpazilaRepository.Insert(Upazila); unitOfWork.Save(); }
public void Update(UpazilaViewModel upazilaVM) { var Upazila = new Upazila { UpazilaId = upazilaVM.UpazilaId, UpazilaName = upazilaVM.UpazilaName }; unitOfWork.UpazilaRepository.Update(Upazila); unitOfWork.Save(); }
// GET: Upazila/Details/5 public ActionResult Details(int id = 0) { if (id == 0) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } UpazilaViewModel details = upazilaService.GetById(id); if (details == null) { return(HttpNotFound()); } return(View(details)); }
public ActionResult Create(UpazilaViewModel upazilaVM) { try { // TODO: Add insert logic here upazilaService.Create(upazilaVM); LoadDropdown(); return(RedirectToAction("Index")); } catch { return(View()); } }
public ActionResult Edit(UpazilaViewModel upazilaVM) { if (ModelState.IsValid) { try { // TODO: Add update logic here upazilaService.Update(upazilaVM); return(RedirectToAction("Index")); } catch { return(View()); } } return(View()); }
public ActionResult Create(UpazilaViewModel upazilaVM) { try { // TODO: Add insert logic here if (ModelState.IsValid) { upazilaService.Create(upazilaVM); } return(RedirectToAction("Index")); } catch { return(View()); } }