Exemplo n.º 1
0
        /// <summary>
        /// method that use the DataRow that is given by ProjectDB.ProjectByUserID(userID) and returns a list of projects the user has, that method will later be used +
        /// </summary>
        public static List <Project> ReturnUserProjects(int userID)
        {
            List <Project> projects    = new List <Project>();
            DataTable      userProject = ProjectDB.ProjectByUserID(userID);

            foreach (DataRow row in userProject.Rows)
            {
                Project newpr = new Project();
                newpr.ProjectID      = (int)row["ProjectID"];
                newpr.AdminUSID      = (int)row["AdminUSID"];
                newpr.MinAge         = (int)row["MinAge"];
                newpr.ProjectStatus  = (int)row["ProjectStatus"];
                newpr.NumRateVoters  = (int)row["NumRateVoters"];
                newpr.ProjectRate    = (int)row["ProjectRate"];
                newpr.ProjectContent = (string)row["ProjectContent"];
                newpr.DateCreated    = (DateTime)row["DateCreated"];
                projects.Add(newpr);
            }
            return(projects);
        }