示例#1
0
        //*********************************************************************
        //
        // Retrieves a list of projects based on the user's role
        //
        //*********************************************************************

        public static ProjectsCollection GetProjects(int userID, string role)
        {
            string firstName = string.Empty;
            string lastName  = string.Empty;

            DataSet ds = SqlHelper.ExecuteDataset(
                ConfigurationSettings.AppSettings[Web.Global.CfgKeyConnString],
                "TT_ListProjects", userID, Convert.ToInt32(role));

            ProjectsCollection projects = new ProjectsCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                Project prj = new Project();
                prj.ProjectID       = Convert.ToInt32(r["ProjectID"]);
                prj.Name            = r["ProjectName"].ToString();
                prj.Description     = r["Description"].ToString();
                prj.ManagerUserID   = Convert.ToInt32(r["ManagerUserID"]);
                prj.ManagerUserName =
                    ITUser.GetDisplayName(Convert.ToString(r["UserName"]), ref firstName, ref lastName);
                prj.EstCompletionDate = Convert.ToDateTime(r["EstCompletionDate"]);
                prj.EstDuration       = Convert.ToDecimal(r["EstDuration"]);
                projects.Add(prj);
            }
            return(projects);
        }
示例#2
0
        //*********************************************************************
        //
        // Retrieves a list of projects based on project membership
        //
        //*********************************************************************

        public static ProjectsCollection GetProjects(int queryUserID, int userID)
        {
            ProjectsCollection projects = new ProjectsCollection();
            DataSet            ds       = SqlHelper.ExecuteDataset(
                ConfigurationSettings.AppSettings[Web.Global.CfgKeyConnString],
                "ListProjectsWithMembership", queryUserID, userID);

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                Project prj = new Project();
                prj.ProjectID         = Convert.ToInt32(r["ProjectID"]);
                prj.Name              = r["ProjectName"].ToString();
                prj.Description       = r["ProjectDescription"].ToString();
                prj.ManagerUserID     = Convert.ToInt32(r["ProjectManagerId"]);
                prj.EstCompletionDate = Convert.ToDateTime(r["EstCompletionDate"]);
                prj.EstDuration       = Convert.ToDecimal(r["EstDuration"]);
                projects.Add(prj);
            }
            return(projects);
        }
示例#3
0
        //*********************************************************************
        //
        // Retrieves the list of all the projects
        //
        //*********************************************************************

        public static ProjectsCollection GetProjects()
        {
            DataSet ds = SqlHelper.ExecuteDataset(
                ConfigurationSettings.AppSettings[Web.Global.CfgKeyConnString],
                CommandType.StoredProcedure, "TT_ListAllProjects");

            // Separate Data into a Collection of projects
            ProjectsCollection projects = new ProjectsCollection();

            foreach (DataRow r in ds.Tables[0].Rows)
            {
                Project prj = new Project();
                prj.ProjectID         = Convert.ToInt32(r["ProjectID"]);
                prj.Name              = r["ProjectName"].ToString();
                prj.Description       = r["Description"].ToString();
                prj.ManagerUserID     = Convert.ToInt32(r["ManagerUserID"]);
                prj.EstCompletionDate = Convert.ToDateTime(r["EstCompletionDate"]);
                prj.EstDuration       = Convert.ToDecimal(r["EstDuration"]);
                projects.Add(prj);
            }
            return(projects);
        }