public ActionResult Edit(EmployeeVM objVM) { try { using (var objBLL = new EmployeeBLL()) { objVM.Logo = Helper.FilePaths(Server.MapPath("~/content/employee/" + objVM.ID + "/img/")); //objVM.LastActivityBy = ActiveUser.ID; int id = objBLL.SaveData(objVM); if (id > 0) { TempData[Toastr.SUCCESS] = "Record updated successfully!"; return(RedirectToAction("Index")); } else { TempData[Toastr.ERROR] = "Failed to update record!"; } } } catch (Exception ex) { TempData[Toastr.ERROR] = "Something went wrong!"; Helper.LogException(ex); } MVCHelper.DDLDepartment(this, selected: objVM.DepartmentId); MVCHelper.DDLCountry(this, selected: objVM.Country); MVCHelper.DDLState(this, selected: objVM.State, countryName: objVM.Country); return(View(objVM)); }
public ActionResult Add() { ViewBag.TempPath = DateTime.Now.Ticks; MVCHelper.DDLCountry(this); MVCHelper.DDLState(this); MVCHelper.DDLDepartment(this); return(PartialView()); }
public ActionResult Edit(int id) { using (var objBLL = new EmployeeBLL()) { var objVM = objBLL.GetById(id); MVCHelper.DDLCountry(this, selected: objVM.Country); MVCHelper.DDLState(this, selected: objVM.State, countryName: objVM.Country); MVCHelper.DDLDepartment(this, selected: objVM.DepartmentId); return(PartialView(objVM)); } }