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 Edit(int id)
 {
     ViewBag.ID = id;
     MVCHelper.DDLDepartment(this);
     MVCHelper.DDLCountry(this);
     return(View());
 }
 public ActionResult Add()
 {
     MVCHelper.DDLDepartment(this);
     MVCHelper.DDLCountry(this);
     //MVCHelper.DDLState(this);
     return(View());
 }
Esempio n. 4
0
 public ActionResult Add()
 {
     ViewBag.TempPath = DateTime.Now.Ticks;
     MVCHelper.DDLCountry(this);
     MVCHelper.DDLState(this);
     MVCHelper.DDLDepartment(this);
     return(PartialView());
 }
Esempio n. 5
0
 public ActionResult Index(string country, string q, string orderBy = null, bool asc = true, int page = 1, int pageSize = 20, int departmentId = 0)
 {
     using (var objBLL = new EmployeeBLL())
     {
         ViewBag.pageSize = pageSize;
         var objVM = objBLL.GetList(country, q, orderBy, asc, page, pageSize, departmentId);
         MVCHelper.DDLDepartment(this, selected: departmentId);
         MVCHelper.DDLCountry(this, selected: country);
         return(View(objVM));
     }
 }
Esempio n. 6
0
 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));
     }
 }