Beispiel #1
0
        public IList<Employee> getAllEmployees()
        {
            IList<Employee> employeeList = new List<Employee>();
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            try {
                using (ConsoleDataContext db = (ConsoleDataContext)MainFactory.getDb("Console", true)) {
                    var query  = from e in db.GetTable<EMPLOYEE>()
                                select new {
                                    id = e.EMPLOYEE_ID,
                                    startDate = e.START_DATE,
                                    endDate = e.END_DATE,
                                    groupManagerStart = e.GROUP_MANAGER_START
                                };
                    foreach(var e in query) {
                        employeeList.Add(new Employee(userMgr.getUser(e.id),
                                                    e.startDate,
                                                    e.endDate,
                                                    e.groupManagerStart));
                    }
                }
            } catch (SqlException se) {
                MainFactory.getLogSvc().logError(this.GetType().Name,
                                                 MainFactory.getCurrentMethod(),
                                                 "esid-gae-01",
                                                 se.Message + "\n" + se.StackTrace);
            }

            return employeeList;
        }
Beispiel #2
0
        public ARequestView createRequest(ARequestView request)
        {
            if (request.GetType() == typeof(RequestView)) {
                LookupMgr lookupMgr = new LookupMgr(ConsoleFactory.getRequestSvc());
                UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
                int defaultID = Int32.Parse((string)MainFactory.getConfiguration().get("BIManagerID"));
                int supportID = lookupMgr.getSupportAreas().Where(x => x.ID == ((RequestView)request).SupportArea.ID).FirstOrDefault().DeveloperID ?? defaultID;
                if (((RequestView)request).CType.ID == 3 || ((RequestView)request).CType.ID == 7)
                    supportID = lookupMgr.getSupportAreas().Where(x => x.ID == ((RequestView)request).SupportArea.ID).FirstOrDefault().SupportID ?? defaultID;

                // auto select program based off support area.
                ((RequestView)request).Program = lookupMgr.getPrograms().Where(x => x.ID == this.svc.getProgramFromSupportArea(((RequestView)request).SupportArea.ID)).Cast<Program>().FirstOrDefault();

                ((RequestView)request).AssignedTo = (User)userMgr.getUser(supportID);
                request.setLastUpdated();
                RequestView requestView = (RequestView)request;
                if (((RequestView)request).AssignedTo.EmployeeID != defaultID)
                    requestView = (RequestView)this.setStatusID((AProjectView)request, 2);
                else
                    requestView = (RequestView)this.setStatusID((AProjectView)request, 1);

                Configuration config = MainFactory.getConfiguration();
                if (((RequestView)request).ValueDriver.ID != 1)
                    ((RequestView)request).Value = ((RequestView)request).Value * Decimal.Parse((string)config.get("HoursCostMultiplierExternal"));

                requestView = convertRequest(this.svc.saveRequest(requestView));

                this.requestList.Data.Add(requestView);
                HttpContext.Current.Application.Lock();
                HttpContext.Current.Application["Request"] = this.requestList;
                HttpContext.Current.Application.UnLock();
                return requestView;
            }
            throw new NotSupportedException("Cannot createa a request that is not a project or a request type at this time.");
        }
Beispiel #3
0
        public IList<Director> getAllDirectors()
        {
            IList<Director> directorList = new List<Director>();
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            try {
                using (ConsoleDataContext db = (ConsoleDataContext)MainFactory.getDb("Console", true)) {
                    var query = from d in db.GetTable<DIRECTOR>()
                                select new {
                                    id = d.DIRECTOR_ID,
                                    startDate = d.START_DATE,
                                    endDate = d.END_DATE
                                };
                    foreach (var e in query) {
                        directorList.Add(new Director(userMgr.getUser(e.id),
                                                     e.startDate,
                                                     e.endDate));
                    }
                }
            } catch (SqlException se) {
                MainFactory.getLogSvc().logError(this.GetType().Name,
                                                 MainFactory.getCurrentMethod(),
                                                 "esid-gad-01",
                                                 se.Message + "\n" + se.StackTrace);
            }

            return directorList;
        }
Beispiel #4
0
        public void TestGetByEmpID()
        {
            UserMgr userSvc = new UserMgr(svc.Object);
            IUser user = userSvc.getUser(198724);

            Assert.AreEqual(user.EnglishName.ToLower(), "takashi tatsumoto");
            Assert.AreEqual(user.ManagerID, 9218);
        }
Beispiel #5
0
        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;
        }
Beispiel #6
0
        public IEmployee createEmployee(int employeeID)
        {
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            IUser user;
            if (!userMgr.getAllUsers().Any(x => x.EmployeeID == employeeID))
                throw new ArgumentException(employeeID + " is not a valid employeeID.");

            user = userMgr.getUser(employeeID);
            int? groupManagerID = groupManagerList.Data
                                    .Where(x => x.ID == user.ManagerID).FirstOrDefault().ID;

            if (groupManagerID == null) {              // Create Group in repository
                GroupManager groupManager = createGroupManager((int)user.ManagerID);
                this.groupManagerList.Data.Add(groupManager);
                HttpContext.Current.Application["GroupManager"] = this.groupManagerList;
                groupManagerID = groupManager.ID;
            }

            Employee employee = new Employee(user, DateTime.Today, null, (int)groupManagerID);
            this.employeeList.Data.Add(this.repository.saveEmployee(employee));
            HttpContext.Current.Application["Employee"] = this.employeeList;
            return employee;
        }
Beispiel #7
0
        private IUser getUser(int id)
        {
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());

            return userMgr.getUser(id);
        }
Beispiel #8
0
        void Session_Start(object sender, EventArgs e)
        {
            string sessionId = Session.SessionID;
            string userNT = Environment.UserName.ToLower();

            //if (userNT == "grodsky.holly")
            //    userNT = "long.kim";
            //if (userNT == "tatsumoto.takashi")
            //    userNT = "ranger.sherri";

            // Get The User Information from the Factory
            if (userNT.Length > 0 && !userNT.ToLower().Equals("iusr")) {
                UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
                HttpContext.Current.Session["User"] = userMgr.getUser(userNT);
            }

            if (HttpContext.Current.Request.Url.Host.ToLower().StartsWith("comet") && ((IUser) Session["User"]).UserType == UserType.PLANNER_911)
                Response.Redirect("~/Home/E911");

            //if (DateTime.Now.Hour < 12)
            //    HttpContext.Current.Session["Greeting"] = "Good Morning";
            //else if (DateTime.Now.Hour < 17)
            //    HttpContext.Current.Session["Greeting"] = "Good Afternoon";
            //else
            //    HttpContext.Current.Session["Greeting"] = "Good Evening";
        }
Beispiel #9
0
        private RequestView convertRequest(REQUEST request)
        {
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            LookupMgr lookupMgr = new LookupMgr(this.svc);
            Configuration config = MainFactory.getConfiguration();
            RequestView r = new RequestView(request,
                                    (User)userMgr.getUser(request.SUBMITTED_BY_ID),
                                    (User)userMgr.getUser(request.REQUESTED_BY_ID),
                                    (User)userMgr.getUser((int)request.ASSIGNED_TO_ID),
                                    null,
                                    lookupMgr.getRequestCategories(false).Where(x => x.ID == request.REQUEST_CATEGORY_ID).FirstOrDefault(),
                                    lookupMgr.getSupportAreas().Where(x => x.ID == request.SUPPORT_AREA_ID).FirstOrDefault(),
                                    null,
                                    lookupMgr.getPrograms().Where(x => x.ID == request.PROGRAM_ID).Cast<Program>().FirstOrDefault(),
                                    lookupMgr.getValueDrivers().Where(x => x.ID == request.VALUE_DRIVER_ID).Cast<ValueDriver>().FirstOrDefault(),
                                    this.requestStatusList.Data.Where(x => x.ID == request.REQUEST_STATUS_ID).FirstOrDefault(),
                                    lookupMgr.getRequestTypes(EOpenType.Request, false).Where(x => x.ID == request.REQUEST_TYPE_ID).FirstOrDefault(),
                                    Decimal.Parse((string)config.get("HoursCostMultiplierInternal")),
                                    Decimal.Parse((string)config.get("HoursCostMultiplierExternal")));

            return r;
        }
Beispiel #10
0
 private ProjectView convertProject(PROJECT project)
 {
     UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
     LookupMgr lookupMgr = new LookupMgr(this.svc);
     Configuration config = MainFactory.getConfiguration();
     return new ProjectView(project,
                 (User)userMgr.getUser(project.SUBMITTED_BY_ID),
                 (User)userMgr.getUser(project.REQUESTED_BY_ID),
                 null,
                 lookupMgr.getSupportAreas().Where(x => x.ID == project.SUPPORT_AREA_ID).FirstOrDefault(),
                 lookupMgr.getPrograms().Where(x => x.ID == project.PROGRAM_ID).Cast<Program>().FirstOrDefault(),
                 lookupMgr.getValueDrivers().Where(x => x.ID == project.VALUE_DRIVER_ID).Cast<ValueDriver>().FirstOrDefault(),
                 this.projectStatusList.Data.Where(x => x.ID == project.PROJECT_STATUS_ID).FirstOrDefault(),
                 lookupMgr.getRequestTypes(EOpenType.Project, false).Where(x => x.ID == project.PROJECT_TYPE_ID).FirstOrDefault(),
                 Decimal.Parse((string)config.get("HoursCostMultiplierInternal")),
                 Decimal.Parse((string)config.get("HoursCostMultiplierExternal")),
                 (User)userMgr.getUser(project.PROJECT_LEAD_ID ?? 0));
 }
Beispiel #11
0
        public RequestView updateRequest(RequestView request)
        {
            LookupMgr lookupMgr = new LookupMgr(this.svc);
            RequestView oldRequest = getRequest(request.ID);

            string from = (string)MainFactory.getConfiguration().get(CONFIG_EMAIL);

            if (request.EstimatedDueDate == null)
                throw new ArgumentException("Estimated Due Date cannot be empty.");

            string status = this.requestStatusList.Data.Where(x => x.ID == request.Status.ID).FirstOrDefault().Text.ToLower();
            request.Status.Text = status;
            // update elements
            if (status.Equals("complete") && request.Status.ID != oldRequest.Status.ID) {
                if (request.Resolution == null || request.Resolution.Length < 1)
                    throw new ArgumentException("You are closing this request. Please provide a resolution.");
                foreach (ElementView element in oldRequest.ElementList.ToList()) {
                    if (element.ClosedDate == null) {
                        if (!element.AssignedTo.Equals(request.AssignedTo))
                            throw new InvalidOperationException("There are elements that are not assigned to you. You cannot close this request until these elements are closed manually.");

                        element.PercentComplete = 100;
                        element.Resolution = "AutoStamp: " + request.Resolution;
                        element.Status = this.elementStatusList.Data.Where(x => x.Text.Equals("Complete")).FirstOrDefault();
                        updateElement(element, true);
                    }
                }
                request.setClosed();
                EmailSvc.Email(from,
                                request.RequestedBy.EmailAddress,
                                "",
                                "Request " + request.ID + " - " + request.Summary + " has been completed",
                                ConsoleFactory.requestEmailSubmitterStatusChange(request));
            } else if ((status.Equals("rejected") || status.Equals("cancelled")) && request.Status.ID != oldRequest.Status.ID) {
                if (request.Resolution == null || request.Resolution.Length < 1)
                    throw new ArgumentException("You are closing this request. Please provide a resolution.");
                request.setClosed();
                EmailSvc.Email(from,
                                request.RequestedBy.EmailAddress,
                                "",
                                "Request " + request.ID + " - " + request.Summary + " has been " + request.Resolution + ".",
                                ConsoleFactory.requestEmailSubmitterStatusChange(request));
            } else if (status.Equals("on hold") && request.Status.ID != oldRequest.Status.ID)
                request.setHoldDate();
            else if (oldRequest.Status.Text.ToLower().Equals("on hold") && request.Status.ID != oldRequest.Status.ID)
                request.setResumeDate();
            else if (status.Equals("moved to project") && request.Status.ID != oldRequest.Status.ID) {
                UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());

                if (request.EstimatedHours == null || request.EstimatedHours <= 0)
                    throw new ArgumentException("Request must have estimated hours before being requested for promotion.");

                EmailSvc.Email(from,
                                userMgr.getUser(Int32.Parse((string)MainFactory.getConfiguration().get("BIManagerID"))).EmailAddress,
                                "",
                                "Request " + request.ID + " - " + request.Summary + " has been updated",
                                ConsoleFactory.requestEmailPromoteBody(request));
                request.ManagerQueueDate = DateTime.Today;
            }

            // hours are different. update cost
            if (request.EstimatedHours != oldRequest.EstimatedHours)
                request.EstimatedCost = request.EstimatedHours * request.InternalHoursMultiplier;

            request.ActualCost = oldRequest.ElementList.Sum(x => x.Hours) * request.InternalHoursMultiplier;
            request.isNew = false;
            request.setLastUpdated();

            RequestView r = convertRequest(this.svc.updateRequest(request));

            //change oldRequest's child Element's parent pointer to this
            foreach (ElementView e in oldRequest.ElementList)
                e.Parent = r;

            r.ElementList = oldRequest.ElementList;

            // change Parent's pointer to this
            if (r.Parent != null) {
                r.Parent.RequestList.Remove(r);
                r.Parent.RequestList.Add(r);
            }

            // if a u parent was added in this update.
            if (r.Parent == null && request.Parent != null && request.Parent.ID != 0) {
                foreach (RequestView rv in this.requestList.Data)
                    if (rv.Parent != null && rv.Parent.ID == request.Parent.ID) {
                        r.Parent = rv.Parent;
                        r.Parent.RequestList.Add(r);
                        break;
                    }
            }

            // change the pointer in the requestList to point to this object
            foreach (RequestView rv in this.requestList.Data.ToList())
                if (rv.ID == request.ID)
                    this.requestList.Data.Remove(rv);
            this.requestList.Data.Add(r);

            HttpContext.Current.Application.Lock();
            HttpContext.Current.Application["Request"] = this.requestList;
            HttpContext.Current.Application.UnLock();
            return r;
        }
Beispiel #12
0
        public ProjectView saveProject(RequestView request, DateTime startDate)
        {
            if (request.Parent != null && request.Parent.ID != 0)
                throw new ArgumentException("Request is already part of a project. It cannot be promoted to project.");
            LookupMgr lookupMgr = new LookupMgr(this.svc);
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            request.SubmittedBy = (User)userMgr.getUser(request.SubmittedBy.EmployeeID);
            request.RequestedBy = (User)userMgr.getUser(request.RequestedBy.EmployeeID);
            request.AssignedTo = (User)userMgr.getUser(request.AssignedTo.EmployeeID);
            request.Program = lookupMgr.getPrograms().Where(x => x.ID == request.Program.ID).Cast<Program>().FirstOrDefault();
            request.RequestCategory = lookupMgr.getRequestCategories(true).Where(x => x.ID == request.RequestCategory.ID).FirstOrDefault();
            request.Status = this.requestStatusList.Data.Where(x => x.Text.ToLower().Equals("moved to project")).FirstOrDefault();
            request.CType = lookupMgr.getRequestTypes(EOpenType.Request, true).Where(x => x.ID == request.CType.ID).FirstOrDefault();
            request.SupportArea = lookupMgr.getSupportAreas().Where(x => x.ID == request.SupportArea.ID).FirstOrDefault();
            request.ValueDriver = lookupMgr.getValueDrivers().Where(x => x.ID == request.ValueDriver.ID).Cast<ValueDriver>().FirstOrDefault();

            ProjectView project = new ProjectView(request);
            project.Status = this.projectStatusList.Data.Where(x => x.Text.Equals("Pending")).FirstOrDefault();
            project.StartDate = startDate;
            project.ManagerApprovedDate = DateTime.Today;
            project = convertProject(this.svc.saveProject(project));
            request.Parent = project;
            request.isNew = false;
            request.setLastUpdated();

            project.RequestList.Add(getRequest(request.ID));

            updateRequest(request);

            // update pointer and status
            foreach (RequestView rv in this.requestList.Data.ToList()) {
                if (rv.ID == request.ID) {
                    request.ElementList = rv.ElementList;
                    this.requestList.Data.Remove(rv);
                }
            }
            this.requestList.Data.Add(request);

            HttpContext.Current.Application.Lock();
            HttpContext.Current.Application["Request"] = this.requestList;
            HttpContext.Current.Application.UnLock();

            return project;
        }
Beispiel #13
0
        private RequestView submitRequest(NewRequestModel request)
        {
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            LookupMgr lookupMgr = new LookupMgr(ConsoleFactory.getRequestSvc());
            RequestView submittal = new RequestView();
            submittal.RequestedBy = (User)userMgr.getUser(request.RequestBy);
            submittal.SubmittedBy = (User)userMgr.getUser(request.SubmittedBy);
            submittal.SupportArea = lookupMgr.getSupportAreas().Where(x => x.ID == request.SupportAreaID).FirstOrDefault();
            submittal.CType = lookupMgr.getRequestTypes(EOpenType.Request, true).Where(x => x.ID == request.TypeID).FirstOrDefault();
            submittal.RequestCategory = lookupMgr.getRequestCategories(true).Where(x => x.ID == request.RequestCategory).FirstOrDefault();
            submittal.RequestedDueDate = request.RequestedDueDate;
            submittal.Summary = request.RequestSummary;
            submittal.Description = request.RequestDescription;
            submittal.ValueDriver = lookupMgr.getValueDrivers().Where(x => x.ID == request.ValueDriverID).Cast<ValueDriver>().FirstOrDefault();
            submittal.Value = request.Value;
            submittal.ValueReason = request.ValueReason;

            RequestMgr requestMgr = new RequestMgr(ConsoleFactory.getRequestSvc());
            RequestView r = (RequestView)requestMgr.createRequest(submittal);
            addToNewRequests(r);
            return r;
        }
Beispiel #14
0
        public ActionResult updateRequest(RequestView requestView)
        {
            RequestView request = null;
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            if (requestView != null) {
                try {
                    RequestMgr requestMgr = new RequestMgr(ConsoleFactory.getRequestSvc());
                    requestView.RequestedBy = (User)userMgr.getUser(requestView.RequestedBy.EmployeeID);
                    requestView.AssignedTo = (User)userMgr.getUser(requestView.AssignedTo.EmployeeID);
                    request = requestMgr.updateRequest(requestView);
                    TempData["error"] = "Update Successful";
                    TempData["valid"] = true;

                    string from = (string)MainFactory.getConfiguration().get(CONFIG_EMAIL);

                    return RedirectToAction("Request", "Console", new { id = request.ID });
                } catch (Exception e) {
                    request = requestView;
                    request.isNew = false;
                    TempData["error"] = e.Message;
                    TempData["valid"] = false;
                    return RedirectToAction("Request", "Console", new { id = request.ID });
                }
            }
            return Dashboard(null, null);
        }
Beispiel #15
0
        public GroupManager createGroupManager(int employeeID)
        {
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            IUser user = userMgr.getUser(employeeID);

            int? groupID = getGroupList(true)
                                .Where(x => x.ID == employeeID)
                                .Select(y => y.GroupID)
                                .FirstOrDefault();
            int? directorID = getDirectorList(true)
                                .Where(x => x.ID == user.ManagerID)
                                .Select(y => y.ID)
                                .FirstOrDefault();

            if (groupID == null)
                groupID = createGroup(user.DeptName).ID;

            if (directorID == null) {
                int? temp = userMgr.getAllUsers().Where(x => x.EmployeeID == groupID).Select(y => y.ManagerID).FirstOrDefault();
                directorID = createDirector((int)temp).ID;
            }

            GroupManager groupManager = this.repository.saveGroupManager((int)groupID, employeeID, (int)directorID);
            this.groupManagerList.Data.Add(groupManager);
            HttpContext.Current.Application.Add("GroupManager", groupManagerList);

            return groupManager;
        }
Beispiel #16
0
        public Director saveDirector(int directorID)
        {
            MainFactory.getLogSvc().logAction("Save new Director - " + directorID + " into console.");
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            Director director = new Director(userMgr.getUser(directorID));
            DIRECTOR d = new DIRECTOR {
                DIRECTOR_ID = director.ID,
                START_DATE = director.StartDate
            };

            try {
                using (ConsoleDataContext db = (ConsoleDataContext)MainFactory.getDb("Console", false)) {
                    db.DIRECTORs.InsertOnSubmit(d);
                    db.SubmitChanges();
                }
            } catch (SqlException se) {
                MainFactory.getLogSvc().logError(this.GetType().Name,
                                                MainFactory.getCurrentMethod(),
                                                "esid-sgm-01",
                                                se.Message + "\n" + se.StackTrace);
                throw new Exception("Unable to create Director. Please see error log for further details.");
            }
            return director;
        }
Beispiel #17
0
        private ElementView convertElement(ELEMENT element)
        {
            // find parent Request
            RequestView parentRequest = getRequest(element.PARENT_REQUEST_ID);

            if (parentRequest == null)
                throw new NullReferenceException("Unable to find the parent request of the element: " + element.ELEMENT_SUMMARY);

            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            return new ElementView(element,
                                    null,
                                    userMgr.getUser(element.ASSIGNED_TO_ID),
                                    this.elementStatusList.Data.Where(x => x.ID == element.ELEMENT_STATUS_ID).FirstOrDefault(),
                                    parentRequest);
        }
Beispiel #18
0
        public GroupManager saveGroupManager(int groupID, int managerID, int directorID)
        {
            MainFactory.getLogSvc().logAction("Save new GroupManager - " + managerID + " into console.");
            GROUP_MANAGER gm = new GROUP_MANAGER {
                GROUP_ID = (short)groupID,
                MANAGER_ID = managerID,
                DIRECTOR_ID = directorID,
                START_DATE = DateTime.Today
            };
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            GroupManager groupManager;

            try {
                using (ConsoleDataContext db = (ConsoleDataContext)MainFactory.getDb("Console", false)) {
                    db.GROUP_MANAGERs.InsertOnSubmit(gm);
                    db.SubmitChanges();
                    groupManager = new GroupManager(userMgr.getUser(managerID),
                                                    gm.DIRECTOR_ID,
                                                    gm.START_DATE,
                                                    gm.END_DATE,
                                                    gm.GROUP_ID,
                                                    gm.GROUP_MANAGER_START,
                                                    getGroupName(gm.GROUP_ID));
                }
            } catch (SqlException se) {
                MainFactory.getLogSvc().logError(this.GetType().Name,
                                                MainFactory.getCurrentMethod(),
                                                "esid-sgm-01",
                                                se.Message + "\n" + se.StackTrace);
                throw new Exception("Unable to create Group Manager. Please see error log for further details.");
            }
            return groupManager;
        }
Beispiel #19
0
        private Note convertNote(NOTE note)
        {
            // find parent element
            ElementView parentElement = null;
            foreach (RequestView request in this.requestList.Data) {
                foreach (ElementView element in request.ElementList)
                    if (element.ID == note.ELEMENT_ID)
                        parentElement = element;
            }

            if (parentElement == null)
                throw new NullReferenceException("Unable to find the parent element of the note: " + note.NOTE_TEXT);

            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            return new Note(note, userMgr.getUser(note.UPDATED_BY_ID), parentElement);
        }
Beispiel #20
0
        public IList<GroupManager> getAllGroupManagers()
        {
            IList<GroupManager> groupManagerList = new List<GroupManager>();
            UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
            try {
                using (ConsoleDataContext db = (ConsoleDataContext)MainFactory.getDb("Console", true)) {
                    var query = from e in db.GetTable<GROUP_MANAGER>()
                                join g in db.GetTable<GROUP_lkp>()
                                on e.GROUP_ID equals g.GROUP_ID
                                 select new {
                                     name = g.GROUP_TEXT,
                                     managerID = e.MANAGER_ID,
                                     directorID = e.DIRECTOR_ID,
                                     startDate = e.START_DATE,
                                     endDate = e.END_DATE,
                                     groupID = e.GROUP_ID,
                                     groupManagerStart = e.GROUP_MANAGER_START
                                 };

                    foreach (var e in query) {
                        groupManagerList.Add(new GroupManager(userMgr.getUser(e.managerID),
                                                        e.directorID,
                                                        e.startDate,
                                                        e.endDate,
                                                        e.groupID,
                                                        e.groupManagerStart,
                                                        e.name));
                    }
                }
            } catch (SqlException se) {
                MainFactory.getLogSvc().logError(this.GetType().Name,
                                                 MainFactory.getCurrentMethod(),
                                                 "esid-gag-01",
                                                 se.Message + "\n" + se.StackTrace);
            }

            return groupManagerList;
        }
Beispiel #21
0
 public ActionResult EmployeeDetails(int employeeID)
 {
     UserMgr userMgr = new UserMgr(MainFactory.getUserSvc());
     return PartialView("~/Views/Partial/_EmployeeDetails.ascx", userMgr.getUser(employeeID));
 }