コード例 #1
0
ファイル: NewRequestController.cs プロジェクト: tah182/Comet
        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);
        }
コード例 #2
0
ファイル: RequestMgr.cs プロジェクト: tah182/Comet
        public ElementView createElement(int parentID)
        {
            EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc());

            ElementView element = new ElementView(getRequest(parentID));

            return element;
        }
コード例 #3
0
ファイル: NewRequestController.cs プロジェクト: tah182/Comet
        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;
        }
コード例 #4
0
ファイル: LookupMgr.cs プロジェクト: tah182/Comet
        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;
        }
コード例 #5
0
ファイル: ConsoleController.cs プロジェクト: tah182/Comet
        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);
        }
コード例 #6
0
ファイル: RequestMgr.cs プロジェクト: tah182/Comet
        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;
        }
コード例 #7
0
ファイル: NewRequestController.cs プロジェクト: tah182/Comet
 public ActionResult Employees()
 {
     EmployeeMgr employeeMgr = new EmployeeMgr(ConsoleFactory.getEmployeeSvc());
     return Jsonify<IList<Employee>>.Serialize(employeeMgr.getUserList(true));
 }
コード例 #8
0
ファイル: ConsoleController.cs プロジェクト: tah182/Comet
        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);
        }
コード例 #9
0
ファイル: ConsoleController.cs プロジェクト: tah182/Comet
        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");
        }
コード例 #10
0
ファイル: ConsoleController.cs プロジェクト: tah182/Comet
        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);
        }
コード例 #11
0
ファイル: ConsoleController.cs プロジェクト: tah182/Comet
        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"]);
        }