示例#1
0
        public List <Requirement> GetRequirements(string projectID)
        {
            List <Requirement> tempList = new List <Requirement>();
            Requirement        req      = new Requirement();

            using (var sc = new SQLCommand("RMsisDB"))
            {
                sc.CommandText.AppendFormat("SELECT * from {0} where {1} = {2}",
                                            sc.WrapObjectName("Requirement"),
                                            sc.WrapObjectName("project_id"),
                                            projectID);

                using (var dr = sc.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        req             = new Requirement();
                        req.ID          = dr.GetValue(RMSIS_REQ_ID_LOCATION).ToString();
                        req.Description = dr.GetValue(RMSIS_REQ_DESC_LOCATION).ToString();
                        tempList.Add(req);
                    }
                }
            }

            return(tempList);
        }
示例#2
0
        public List <Project> GetProjectList()
        {
            List <Project> tempList = new List <Project>();
            Project        proj     = new Project();

            using (var sc = new SQLCommand("RMsisDB"))
            {
                sc.CommandText.AppendFormat("SELECT * from {0}",
                                            sc.WrapObjectName("Project"));
                using (var dr = sc.ExecuteReader())
                {
                    while (dr.Read())
                    {
                        Object[] val = new Object[dr.FieldCount];
                        dr.GetValues(val);
                        proj      = new Project();
                        proj.ID   = dr.GetValue(RMSIS_PROJECT_ID_LOCATION).ToString();
                        proj.Name = dr.GetValue(RMSIS_PROJECT_NAME_LOCATION).ToString();
                        tempList.Add(proj);
                    }
                }
            }
            return(tempList);
        }