Exemplo n.º 1
0
        public static List <ProjectStatus> GetAllStatus(int projectID)
        {
            List <ProjectStatus> prjStatusList = new List <ProjectStatus>();
            ProjectStatus        status        = null;

            using (DataSet dsProjectStatusDetails = DAL.ProjectStatus.GetAllStatuses(projectID))
            {
                if ((dsProjectStatusDetails != null) && (dsProjectStatusDetails.Tables.Count > 0) && (dsProjectStatusDetails.Tables[0].Rows.Count > 0))
                {
                    foreach (DataRow row in dsProjectStatusDetails.Tables[0].Rows)
                    {
                        status = new ProjectStatus(Convert.ToInt32(row["ProjectStatusID"]),
                                                   Convert.ToDateTime(row["ProjectStatusDate"]),
                                                   Delivery.GetDelivery(Convert.ToInt32(row["ProjectDelivery_DeliveryId"])),
                                                   BusinessDevelopment.GetBusinessDevelopment(Convert.ToInt32(row["ProjectBusinessDevelopment_BusinessDevelopmentId"])));

                        prjStatusList.Add(status);
                    }
                }
            }

            return(prjStatusList);
        }
Exemplo n.º 2
0
        public static ProjectStatus GetRecentProjectStatus(int projectID)
        {
            ProjectStatus prjStatus = null;

            using (DataSet dsStatusDetails = DAL.ProjectStatus.GetRecentProjectStatus(projectID))
            {
                if ((dsStatusDetails != null) && (dsStatusDetails.Tables.Count > 0))
                {
                    if (dsStatusDetails.Tables[0].Rows.Count > 0)
                    {
                        prjStatus = new ProjectStatus(Convert.ToInt32(dsStatusDetails.Tables[0].Rows[0]["ProjectStatusID"]),
                                                      Convert.ToDateTime(dsStatusDetails.Tables[0].Rows[0]["ProjectStatusDate"].ToString()),
                                                      Delivery.GetDelivery(Convert.ToInt32(dsStatusDetails.Tables[0].Rows[0]["ProjectDelivery_DeliveryId"])),
                                                      BusinessDevelopment.GetBusinessDevelopment(Convert.ToInt32(dsStatusDetails.Tables[0].Rows[0]["ProjectBusinessDevelopment_BusinessDevelopmentId"])));
                    }
                    else
                    {
                        prjStatus = new ProjectStatus();
                    }
                }
            }

            return(prjStatus);
        }