コード例 #1
0
        //Constructor for ProjectReportViewModel
        public ProjectReportViewModel(ProjectReport projectReport, EmployeeNameViewModel projectManager,
                                      List <EmployeeNameViewModel> engineers, List <WorkPackageReportSnapshot> lowWpStatus, List <WorkPackageReportSnapshot> highWpStatus)
        {
            ProjectReportId = projectReport.ProjectReportId;
            ProjectId       = projectReport.ProjectId;
            ProjectCode     = projectReport.ProjectCode;
            ProjectName     = projectReport.ProjectName;
            ReportDate      = DateTime.Now;
            StartDate       = projectReport.StartDate;
            EndDate         = projectReport.EndDate;
            ProjectManager  = projectManager;
            Engineers       = engineers;
            LowWpStatus     = new List <LowWorkPackage>();
            HighWpStatus    = new List <HighWorkPackage>();

            foreach (WorkPackageReportSnapshot wp in lowWpStatus)
            {
                LowWpStatus.Add(new LowWorkPackage(wp));
            }

            foreach (WorkPackageReportSnapshot wp in highWpStatus)
            {
                HighWpStatus.Add(new HighWorkPackage(wp));
            }

            //Inner class totals
            totals = new Totals(LowWpStatus);
        }
コード例 #2
0
 public EmployeeChildrenListViewModel(Employee emp, EmployeeNameViewModel timesheetApprover)
 {
     this.EmployeeId        = emp.EmployeeId;
     this.EmpCode           = emp.EmployeeCode;
     this.EmpFirstName      = emp.EmployeeFirstName;
     this.EmpLastName       = emp.EmployeeLastName;
     this.TimesheetApprover = timesheetApprover;
 }
コード例 #3
0
 public EmployeeProjectViewModel(int projectId, string projectName, EmployeeNameViewModel projectManager,
                                 DateTime startDate, DateTime endDate, bool isClosed)
 {
     this.ProjectId      = projectId;
     this.ProjectName    = projectName;
     this.ProjectManager = projectManager;
     this.StartDate      = startDate;
     this.EndDate        = endDate;
     this.IsClosed       = isClosed;
 }
コード例 #4
0
 public ProjectViewModel(int projectId, string projectName, int projectCode, double budget, string description,
                         bool isClosed, DateTime startDate, DateTime endDate, EmployeeNameViewModel projectManager,
                         List <EmployeeNameViewModel> employees)
 {
     ProjectId      = projectId;
     ProjectName    = projectName;
     ProjectCode    = projectCode;
     Budget         = budget;
     Description    = description;
     IsClosed       = isClosed;
     StartDate      = startDate;
     EndDate        = endDate;
     ProjectManager = projectManager;
     Employees      = employees;
 }
コード例 #5
0
        public EmployeeDetailsViewModel(Employee emp, Credential cred, LabourGradeViewModel labourGrade,
                                        EmployeeNameViewModel timesheetApprover, EmployeeNameViewModel supervisor)
        {
            this.EmployeeId       = emp.EmployeeId;
            this.EmpUsername      = cred.CredentialId;
            this.EmpCode          = emp.EmployeeCode;
            this.EmpFirstName     = emp.EmployeeFirstName;
            this.EmpLastName      = emp.EmployeeLastName;
            this.IsActivated      = emp.IsActivated;
            this.IsProjectManager = emp.IsProjectManager;
            this.IsAdmin          = emp.IsAdmin;
            this.IsHumanResources = emp.IsHumanResources;
            this.LabourGrade      = labourGrade;

            if (timesheetApprover != null)
            {
                this.TimesheetApprover = timesheetApprover;
            }
            if (supervisor != null)
            {
                this.Supervisor = supervisor;
            }
        }
コード例 #6
0
 //Used for getAllWpByEmpId
 public WorkPackageViewModel(WorkPackage wp, string parentWpCode, Project proj, EmployeeNameViewModel re)
 {
     this.WorkPackageId         = wp.WorkPackageId;
     this.ProjectCode           = proj.ProjectCode;
     this.ProjectName           = proj.ProjectName;
     this.WorkPackageCode       = wp.WorkPackageCode;
     this.WorkPackageTitle      = wp.Name;
     this.Contractor            = wp.Contractor;
     this.IssueDate             = wp.IssueDate;
     this.IsClosed              = wp.IsClosed;
     this.ParentWorkPackageCode = parentWpCode;
     this.ResponsibleEngineer   = re;
 }
コード例 #7
0
 //Used for GET,PUT,POST
 public WorkPackageViewModel(WorkPackage wp, string parentWpCode, Project proj, EmployeeNameViewModel re, IList <EmployeeNameViewModel> emps,
                             IList <PmPlanningViewModel> pmPlannings)
 {
     this.WorkPackageId         = wp.WorkPackageId;
     this.ProjectCode           = proj.ProjectCode;
     this.ProjectName           = proj.ProjectName;
     this.WorkPackageCode       = wp.WorkPackageCode;
     this.WorkPackageTitle      = wp.Name;
     this.Contractor            = wp.Contractor;
     this.IssueDate             = wp.IssueDate;
     this.IsClosed              = wp.IsClosed;
     this.ParentWorkPackageCode = parentWpCode;
     this.ResponsibleEngineer   = re;
     this.Employees             = emps;
     this.PmPlannings           = pmPlannings;
 }