public ActionResult List(string searchText) { // string searchText = form["txtSearch"]; List <vw_Employees> empl = new List <vw_Employees>(); if (Session["ClientId"] != null) { if (Roles.IsUserInRole("CenterManager") && Session["BranchId"] != null) { empl = EmployeeModels.GetEmployeesList(searchText, (int)Session["ClientId"], (int)Session["BranchId"]); } else { empl = EmployeeModels.GetEmployeesList(searchText, (int)Session["ClientId"], null); } } else { if (Roles.IsUserInRole("SuperAdmin")) { empl = EmployeeModels.GetEmployeesList(); } } if (Request.IsAjaxRequest()) { return(PartialView("EmployeeListUserControl", empl)); } return(View()); }
public ActionResult List() { if (Session["ClientId"] != null) { if (Roles.IsUserInRole("CenterManager") && Session["BranchId"] != null) { ViewData.Model = EmployeeModels.GetEmployeesList((int)Session["ClientId"], (int)Session["BranchId"]); } else { ViewData.Model = EmployeeModels.GetEmployeesList((int)Session["ClientId"]); } } else { if (Roles.IsUserInRole("SuperAdmin")) { ViewData.Model = EmployeeModels.GetEmployeesList(); } } return(View()); }
public ActionResult Delete(string searchText, string idToDelete) { int result = 0; if (Roles.IsUserInRole("SuperAdmin")) { result = EmployeeModels.DeleteEmployee(idToDelete); } else { if (Session["ClientId"] != null) { result = EmployeeModels.DeleteEmployee((int)Session["ClientId"], idToDelete); } } List <vw_Employees> empl = new List <vw_Employees>(); if (Session["ClientId"] != null) { empl = EmployeeModels.GetEmployeesList((int)Session["ClientId"]); } else { if (Roles.IsUserInRole("SuperAdmin")) { empl = EmployeeModels.GetEmployeesList(); } } if (Request.IsAjaxRequest()) { return(PartialView("EmployeeListUserControl", empl)); } return(null); }