public string employeeGroupName(int employeeID) { EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); Employee thisUser = (Employee)employeeMgr.getUser(employeeID); IList<GroupManager> groupList = employeeMgr.getGroupList(true); return employeeMgr.getUserGroupName(thisUser); }
public ElementView createElement(int parentID) { EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); ElementView element = new ElementView(getRequest(parentID)); return element; }
public string employeeManager(int employeeID) { EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); UserMgr usrMgr = new UserMgr(MainFactory.getUserSvc()); Employee thisUser = (Employee)employeeMgr.getUser(employeeID); IList<GroupManager> groupList = employeeMgr.getGroupList(true); return usrMgr.getUser(groupList.Where(x => x.GroupManagerID == thisUser.GroupManagerID).FirstOrDefault().ID).EnglishName; }
public IList<IUser> getEmployees(string match, bool activeOnly) { UserMgr userMgr = new UserMgr(MainFactory.getUserSvc()); EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); IList<IEmployee> list = employeeMgr.getUserList(activeOnly).Cast<IEmployee>().ToList(); IList<IUser> userList = userMgr.getAllUsers().Where(x => x.Name.ToLower().Contains(match.ToLower())).ToList(); IList<IUser> users = (from a in list join e in userList on a.ID equals e.EmployeeID select e).ToList(); return users; }
public ActionResult createElement(int type) { RequestMgr requestMgr = new RequestMgr(ConsoleFactory.getRequestSvc()); EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); ViewData["statusList"] = requestMgr.getStatusList(EOpenType.Element); ViewData["assignedTo"] = employeeMgr.getAdminList(); ViewData["error"] = TempData["error"] ?? ""; ViewBag.Message = "New Element"; ViewData["type"] = EOpenType.Element; ViewData["isValidated"] = TempData["valid"] ?? true; ViewData["user"] = (IUser)Session["User"]; ElementView element = requestMgr.createElement(type); element.AssignedTo = (User)ViewData["user"]; return View("FullView", element); }
public ElementView getElement(int id) { EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); ElementView element = null; foreach (RequestView r in this.requestList.Data) foreach (ElementView e in r.ElementList) if (e.ID == id) element = e; return element; }
public ActionResult Employees() { EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); return Jsonify<IList<Employee>>.Serialize(employeeMgr.getUserList(true)); }
public new ActionResult Request(int? type = null) { int? id = type; if (id == null) throw new HttpException(404, "Not Found"); RequestMgr requestMgr = new RequestMgr(ConsoleFactory.getRequestSvc()); LookupMgr lookupMgr = new LookupMgr(ConsoleFactory.getRequestSvc()); EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); RequestView request = requestMgr.getRequest((int)id); if (request == null) throw new HttpException(404, "Not Found"); ViewData["statusList"] = requestMgr.getStatusList(EOpenType.Request); ViewData["programList"] = lookupMgr.getPrograms(); ViewData["typeList"] = lookupMgr.getRequestTypes(EOpenType.Request, false); ViewData["supportArea"] = lookupMgr.getSupportAreas(); ViewData["valueDriver"] = lookupMgr.getValueDrivers(); IList<IEmployee> admin = employeeMgr.getAdminList(); ViewData["assignedTo"] = employeeMgr.getAdminList(); ViewData["requestCategory"] = lookupMgr.getRequestCategories(false); ViewData["project"] = requestMgr.getProjects(); ViewBag.Message = "Request #" + request.ID; ViewData["type"] = EOpenType.Request; ViewData["error"] = TempData["error"] ?? ""; ViewData["isValidated"] = TempData["valid"] ?? true; ViewData["user"] = (IUser)Session["User"]; return View("FullView", request); }
public ActionResult NewRequest() { MainFactory.getLogSvc().logAction("Console - New Request"); ViewBag.Message = "New Request"; EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); Employee thisUser = (Employee)employeeMgr.getUser((IUser)Session["User"]); ViewData["user"] = Session["User"]; ViewData["isAdmin"] = employeeMgr.isAdmin(thisUser); ViewData["groupManager"] = new NewRequestController().employeeManager(thisUser.ID); ViewData["groupName"] = new NewRequestController().employeeGroupName(thisUser.ID); return View("NewRequest"); }
public ActionResult NewRequest(NewRequestModel request, bool? success, string message) { if (request == null) return RedirectToAction("NewRequest"); ViewBag.Message = "New Request"; EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); Employee thisUser = (Employee)employeeMgr.getUser((IUser)Session["User"]); ViewData["user"] = Session["User"]; ViewData["isAdmin"] = employeeMgr.isAdmin(thisUser); ViewData["groupName"] = new NewRequestController().employeeGroupName(thisUser.ID); ViewData["groupManager"] = new NewRequestController().employeeManager(thisUser.ID); ViewData["displayMessage"] = message; ViewData["success"] = success; return View("NewRequest", request); }
public ActionResult Element(int? type = null) { int? id = type; if (id == null) throw new HttpException(404, "Not Found"); RequestMgr requestMgr = new RequestMgr(ConsoleFactory.getRequestSvc()); EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc()); ElementView element = requestMgr.getElement((int)id); if (element == null) throw new HttpException(404, "Not Found"); ViewData["statusList"] = requestMgr.getStatusList(EOpenType.Element); ViewData["assignedTo"] = employeeMgr.getAdminList(); ViewData["error"] = TempData["error"] ?? ""; ViewBag.Message = "Element #" + element.ID; ViewData["type"] = EOpenType.Element; ViewData["isValidated"] = TempData["valid"] ?? true; ViewData["user"] = (IUser)Session["User"]; return View("FullView", TempData["model"] == null ? element : (ElementView)TempData["model"]); }