示例#1
0
        public static Project GetProject(int projectID)
        {
            Project prj = null;

            using (DataSet prjDetails = DAL.Project.GetProjectDetails(projectID))
            {
                if ((prjDetails != null) && (prjDetails.Tables.Count > 0))
                {
                    prj = new Project(Convert.ToInt32(prjDetails.Tables[0].Rows[0]["ProjectID"]),
                                      prjDetails.Tables[0].Rows[0]["Name"].ToString(), prjDetails.Tables[0].Rows[0]["Description"].ToString(),
                                      Person.GetPerson(Convert.ToInt32(prjDetails.Tables[0].Rows[0]["SogetiPractitioner_PersonID"])),
                                      Person.GetPerson(Convert.ToInt32(prjDetails.Tables[0].Rows[0]["AccountManager_PersonID"])),
                                      Person.GetPerson(Convert.ToInt32(prjDetails.Tables[0].Rows[0]["DeliveryManager_PersonID"])),
                                      Person.GetPerson(Convert.ToInt32(prjDetails.Tables[0].Rows[0]["Administrator_PersonID"])),
                                      Client.GetClient(Convert.ToInt32(prjDetails.Tables[0].Rows[0]["Client_ClientID"])),
                                      Convert.ToDateTime(prjDetails.Tables[0].Rows[0]["StartDate"].ToString()),
                                      Convert.ToDateTime(prjDetails.Tables[0].Rows[0]["EndDate"].ToString()),
                                      Convert.ToDateTime(prjDetails.Tables[0].Rows[0]["RevisedDate"].ToString()),
                                      Person.GetPerson(Convert.ToInt32(prjDetails.Tables[0].Rows[0]["Lead_PersonID"])),
                                      (CommercialTerms)Convert.ToChar(prjDetails.Tables[0].Rows[0]["CommercialTerms"]),
                                      (Frequency)Convert.ToChar(prjDetails.Tables[0].Rows[0]["ReviewFrequency"]),
                                      (SogetiDepartments)Convert.ToChar(prjDetails.Tables[0].Rows[0]["SogetiServiceLine"]));

                    prj.ProjectStatusList = new List <ProjectStatus>();
                    prj.ProjectStatusList.Add(ProjectStatus.GetRecentProjectStatus(prj.ProjectID));
                }
            }

            return(prj);
        }
示例#2
0
        public static List <Project> GetAllProjects(int clientID, int accountManager, int deliveryManager, int lead,
                                                    char serviceLine, char commTerms, char reviewFrequency)
        {
            List <Project> prjList = new List <Project>();
            Project        prj;

            using (DataSet dsProjects = DAL.Project.GetAllProjects(clientID, accountManager, deliveryManager, lead, serviceLine, commTerms, reviewFrequency))
            {
                if ((dsProjects != null) && (dsProjects.Tables.Count > 0))
                {
                    foreach (DataRow row in dsProjects.Tables[0].Rows)
                    {
                        prj = new Project();
                        prj = new Project(Convert.ToInt32(row["ProjectID"]),
                                          row["Name"].ToString(), row["Description"].ToString(),
                                          Person.GetPerson(Convert.ToInt32(row["SogetiPractitioner_PersonID"])),
                                          Person.GetPerson(Convert.ToInt32(row["AccountManager_PersonID"])),
                                          Person.GetPerson(Convert.ToInt32(row["DeliveryManager_PersonID"])),
                                          Person.GetPerson(Convert.ToInt32(row["Administrator_PersonID"])),
                                          Client.GetClient(Convert.ToInt32(row["Client_ClientID"])),
                                          Convert.ToDateTime(row["StartDate"].ToString()),
                                          Convert.ToDateTime(row["EndDate"].ToString()),
                                          Convert.ToDateTime(row["RevisedDate"].ToString()),
                                          Person.GetPerson(Convert.ToInt32(row["Lead_PersonID"])),
                                          (CommercialTerms)Convert.ToChar(row["CommercialTerms"]),
                                          (Frequency)Convert.ToChar(row["ReviewFrequency"]),
                                          (SogetiDepartments)Convert.ToChar(row["SogetiServiceLine"]));
                        prj.ProjectStatusList = new List <ProjectStatus>();
                        prj.ProjectStatusList.Add(BAL.ProjectStatus.GetRecentProjectStatus(prj.ProjectID));

                        prjList.Add(prj);
                    }
                }
            }

            return(prjList);
        }