Esempio n. 1
0
        }         //ReadItemListFromDatabase

        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase_ByProjectID - read all records from "theTable" insert them into this.itemList, filter by projectID
        /// 1) Erase the current itemList in memory first
        /// 2) Read records from SQLServer, filling the itemList
        ///</summary>
        ///<input>List<mapping_note> itemList -  an ordinary List<> of type mapping_note, will be cleared if not already empty </input>
        ///<output>List<mapping_note> itemList- an ordinary List<> of type mapping_note, extracted from the database </output>
        ///<param name="projectId"></param>
        public void ReadItemListFromDatabase_ByProjectID(int projectId)
        {
            itemList.Clear();  //First, empty the existing list contents

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE projectId=" + "'" + projectId.ToString() + "'";

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    intID        = Convert.ToInt32(dr["ID"]);
                    int    intmappingId = Convert.ToInt32(dr["mappingId"]);
                    String strnotes     = dr["notes"].ToString();

                    //fill the itemList
                    mapping_note newRec = new mapping_note();
                    newRec.ID        = intID;
                    newRec.mappingId = intmappingId;
                    newRec.notes     = strnotes;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase_ByProjectID
Esempio n. 2
0
        }         //ReadItemListFromDatabase

        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase_ByProjectID - read all records from "theTable" insert them into this.itemList, filter by projectID
        /// 1) Erase the current itemList in memory first
        /// 2) Read records from SQLServer, filling the itemList
        ///</summary>
        ///<input>List<user> itemList - an ordinary List<> of type user, will be cleared if not already empty </input>
        ///<output>List<user>  itemList - an ordinary List<> of type user, extracted from the database </output>
        ///<param name="projectId"></param>
        public void ReadItemListFromDatabase_ByProjectID(int projectId)
        {
            itemList.Clear();  //First, empty the existing list contents

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE projectId=" + projectId.ToString();

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int intID = Convert.ToInt32(dr["ID"]);

                    String strusername     = dr["username"].ToString();
                    String strorganization = dr["organization"].ToString();
                    String strpassword     = dr["password"].ToString();

                    //fill the itemList
                    user newRec = new user();
                    newRec.username = strusername;
                    newRec.password = strpassword;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase_ByProjectID
Esempio n. 3
0
        }         //ReadItemListFromDatabase

        ///<summary>
        /// ReadItemListFromDatabase_BySessionId - read all records from "theTable" insert them into this.itemList, filter by projectID
        /// 1) Erase the current itemList in memory first
        /// 2) Read records from SQLServer, filling the itemList
        ///</summary>
        ///<input>List<interview_question> itemList -  an ordinary List<> of type interview_question, will be cleared if not already empty </input>
        ///<output>List<interview_question> itemList- an ordinary List<> of type interview_question, extracted from the database </output>
        ///<param name="projectId"></param>
        public void ReadItemListFromDatabase_BySessionId(int sessionId)
        {
            itemList.Clear();  //First, empty the existing list contents

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE sessionId=" + sessionId.ToString();

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    intID = Convert.ToInt32(dr["ID"]);
                    String strinterviewQuestions = dr["interviewQuestion"].ToString();
                    String strquestionNotes      = dr["questionNotes"].ToString();
                    int    intsessionId          = Convert.ToInt32(dr["sessionId"]);


                    //fill the itemList
                    interview_question newRec = new interview_question();
                    newRec.ID = intID;
                    newRec.interviewQuestions = strinterviewQuestions;
                    newRec.questionNotes      = strquestionNotes;
                    newRec.sessionId          = sessionId;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase_BySessionId
Esempio n. 4
0
        }         //ReadItemListFromDatabase

        ///<summary>
        /// ReadItemListFromDatabase_ByProjectID - read all records from "theTable" insert them into this.itemList, filter by projectID
        /// 1) Erase the current itemList in memory first
        /// 2) Read records from SQLServer, filling the itemList
        ///</summary>
        ///<input>List<project> itemList -  an ordinary List<> of type project, will be cleared if not already empty </input>
        ///<output>List<project> itemList- an ordinary List<> of type project, extracted from the database </output>
        ///<param name="projectIndex"></param>
        public void ReadItemListFromDatabase_ByProjectID(int projectIndex)
        {
            itemList.Clear();  //First, empty the existing list contents

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE projectIndex=" + projectIndex.ToString();

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    intID           = Convert.ToInt32(dr["ID"]);
                    int    intprojectId    = Convert.ToInt32(dr["projectId"]);
                    int    intprojectIndex = Convert.ToInt32(dr["projectIndex"]);
                    String strprojectName  = dr["projectName"].ToString();
                    String strcreator      = dr["creator"].ToString();
                    bool   standardProcess = Convert.ToBoolean(dr["standardProcess"]);

                    //fill the itemList
                    project newRec = new project();
                    newRec.projectId       = intprojectId;
                    newRec.projectIndex    = intprojectIndex;
                    newRec.projectName     = strprojectName;
                    newRec.creator         = strcreator;
                    newRec.standardProcess = standardProcess;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase_ByProjectID
Esempio n. 5
0
        }         //ReadItemListFromDatabase_ByProjectID

        public void ReadItemListFromDatabase_ByProjectIDAndName(int projectId, string paName)
        {
            itemList.Clear();  //First, empty the existing list contents

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE projectId = " + projectId.ToString() +
                            " AND paName = " + "'" + paName + "'";

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj == null)
            {
                LogManager.writeToLog("The dataset is null in process_area_Table.ReadItemListFromDatabase_ByProjectIDAndName()");
            }

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract all fields of the current row
                    int    intID               = Convert.ToInt32(dr["Id"]);
                    int    intProcessAreaId    = Convert.ToInt32(dr["processAreaId"]);
                    int    intProjectId        = Convert.ToInt32(dr["projectId"]);
                    string strname             = dr["paName"].ToString();
                    string strtext             = dr["text"].ToString();
                    bool   boolIsActive        = Convert.ToBoolean(dr["active"]);
                    bool   boolHasArtifacts    = Convert.ToBoolean(dr["hasArtifact"]);
                    bool   boolHasAffirmations = Convert.ToBoolean(dr["hasAffirmation"]);
                    string strRating           = (dr["rating"]).ToString();
                    bool   boolCoverage        = Convert.ToBoolean(dr["coverage"]);

                    //fill the itemList
                    process_area newRec = new process_area();
                    newRec.ID                    = intID;
                    newRec.processAreaId         = intProcessAreaId;
                    newRec.projectId             = intProjectId;
                    newRec.paName                = strname;
                    newRec.text                  = strtext;
                    newRec.active                = boolIsActive;
                    newRec.canContainArtifact    = boolHasArtifacts;
                    newRec.canContainAffirmation = boolHasAffirmations;
                    newRec.rating                = strRating;
                    newRec.coverage              = boolCoverage;

                    itemList.Add(newRec);
                }//for
            }
        }
Esempio n. 6
0
        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase - read all records from "theTable" insert them into this.itemList
        ///</summary>
        ///<input>List<interview_session> itemList - an ordinary List<> of type interview_session, will be cleared if not already empty </input>
        ///<output>List<interview_session>  itemList - an ordinary List<> of type interview_session, extracted from the database </output>
        public void ReadItemListFromDatabase()
        {
            itemList.Clear();  //First, empty the existing list contents

            string  sQuery = "SELECT * FROM " + theTable;
            DataSet dsObj  = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    intID           = Convert.ToInt32(dr["ID"]);
                    int    intsessionId    = Convert.ToInt32(dr["sessionId"]);
                    int    intsessionIndex = Convert.ToInt32(dr["sessionIndex"]);
                    String strsessionName  = dr["sessionName"].ToString();

                    int    intsessionDurationHours   = Convert.ToInt32(dr["sessionDurationHours"]);
                    int    intsessionDurationMinutes = Convert.ToInt32(dr["sessionDurationMinutes"]);
                    string strsessionDuration        = intsessionDurationHours.ToString() + ":" + intsessionDurationMinutes.ToString();

                    String strspecificGoal     = dr["specificGoal"].ToString();
                    String strspecificPractice = dr["specificPractice"].ToString();
                    String strgenericGoal      = dr["genericGoal"].ToString();
                    String strgenericPractice  = dr["genericPractice"].ToString();

                    String strprocessArea = dr["processArea"].ToString();

                    //fill the itemList
                    interview_session newRec = new interview_session();
                    newRec.ID                     = intID;
                    newRec.sessionId              = intsessionId;
                    newRec.sessionIndex           = intsessionIndex;
                    newRec.sessionName            = strsessionName;
                    newRec.sessionDurationHours   = intsessionDurationHours;
                    newRec.sessionDurationMinutes = intsessionDurationMinutes;
                    newRec.sessionDuration        = strsessionDuration;

                    newRec.specificGoal     = strspecificGoal;
                    newRec.specificPractice = strspecificPractice;
                    newRec.genericGoal      = strgenericGoal;
                    newRec.genericPractice  = strgenericPractice;
                    newRec.processArea      = strprocessArea;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase
Esempio n. 7
0
        }         //ReadItemListFromDatabase_ByProjectID

        public void ReadItemListFromDatabase_ByProjectIDAndNode(int projectId, string pa, string goal, string practice)
        {
            itemList.Clear();

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE " +
                            "projectId = " + projectId.ToString() +
                            " AND processArea = " + "'" + pa + "'" +
                            " AND goal = " + "'" + goal + "'" +
                            " AND practice = " + "'" + practice + "'";

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    int_ID              = Convert.ToInt32(dr["ID"]);
                    int    int_mappingId       = Convert.ToInt32(dr["mappingId"]);
                    String strmappingName      = dr["mappingName"].ToString();
                    String strmappingPath      = dr["mappingPath"].ToString();
                    String strspecificGoal     = dr["specificGoal"].ToString();
                    String strspecificPractice = dr["specificPractice"].ToString();
                    String strgenericGoal      = dr["genericGoal"].ToString();
                    String strgenericPractice  = dr["genericPractice"].ToString();
                    String strprocessArea      = dr["processArea"].ToString();
                    int    int_projectId       = Convert.ToInt32(dr["projectId"]);

                    //fill the itemList
                    mapping newRec = new mapping();
                    newRec.ID               = int_ID;
                    newRec.mappingId        = int_mappingId;
                    newRec.mappingName      = strmappingName;
                    newRec.mappingPath      = strmappingPath;
                    newRec.specificGoal     = strspecificGoal;
                    newRec.specificPractice = strspecificPractice;
                    newRec.genericGoal      = strgenericGoal;
                    newRec.genericPractice  = strgenericPractice;
                    newRec.processArea      = strprocessArea;
                    newRec.projectId        = int_projectId;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase_ByProjectIDAndNode
Esempio n. 8
0
        }         //ReadItemListFromDatabase_ByProjectID

        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase_By_processArea - read all records from "theTable" insert them into this.itemList, filter by processArea
        /// 1) Erase the current itemList in memory first
        /// 2) Read records from SQLServer, filling the itemList
        ///</summary>
        ///<input>List<affirmation> itemList -  an ordinary List<> of type affirmation, will be cleared if not already empty </input>
        ///<output>List<affirmation> itemList- an ordinary List<> of type affirmation, extracted from the database </output>
        ///<param name="processArea"></param>
        public void ReadItemListFromDatabase_By_processArea(String processArea)
        {
            String singleQuote = "'";

            itemList.Clear();  //First, empty the existing list contents

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE processArea  LIKE " + singleQuote + processArea + singleQuote;

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    intID               = Convert.ToInt32(dr["ID"]);
                    int    intaffirmationId    = Convert.ToInt32(dr["affirmationId"]);
                    String straffirmationName  = dr["affirmationName"].ToString();
                    String straffirmationType  = dr["affirmationType"].ToString();
                    String strspecificGoal     = dr["specificGoal"].ToString();
                    String strspecificPractice = dr["specificPractice"].ToString();
                    String strgenericGoal      = dr["genericGoal"].ToString();
                    String strgenericPractice  = dr["genericPractice"].ToString();

                    int intprojectId = Convert.ToInt32(dr["projectId"]);


                    //fill the itemList
                    affirmation newRec = new affirmation();
                    newRec.ID               = intID;
                    newRec.affirmationId    = intaffirmationId;
                    newRec.affirmationName  = straffirmationName;
                    newRec.affirmationType  = straffirmationType;
                    newRec.specificGoal     = strspecificGoal;
                    newRec.specificPractice = strspecificPractice;
                    newRec.genericGoal      = strgenericGoal;
                    newRec.genericPractice  = strgenericPractice;
                    newRec.processArea      = processArea;
                    newRec.projectId        = intprojectId;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase_By_processArea
Esempio n. 9
0
        }         //ReadItemListFromDatabase_ByProjectID

        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase_ByProjectID - read all records from "theTable" insert them into this.itemList, filter by projectID
        /// 1) Erase the current itemList in memory first
        /// 2) Read records from SQLServer, filling the itemList
        ///</summary>
        ///<input>List<improvement_opportunity> itemList -  an ordinary List<> of type improvement_opportunity, will be cleared if not already empty </input>
        ///<output>List<improvement_opportunity> itemList- an ordinary List<> of type improvement_opportunity, extracted from the database </output>
        ///<param name="projectId"></param>
        public void ReadItemListFromDatabase_ByProcessArea(String v_processArea)
        {
            itemList.Clear();  //First, empty the existing list contents

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE " +
                            " processArea  LIKE" + "@processArea";


            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    intID               = Convert.ToInt32(dr["ID"]);
                    String strnotes            = dr["notes"].ToString();
                    String strspecificGoal     = dr["specificGoal"].ToString();
                    String strspecificPractice = dr["specificPractice"].ToString();
                    String strgenericGoal      = dr["genericGoal"].ToString();
                    String strgenericPractice  = dr["genericPractice"].ToString();
                    int    int_projectId       = Convert.ToInt32(dr["projectId"]);
                    String strprocessArea      = dr["processArea"].ToString();


                    //fill the itemList
                    improvement_opportunity newRec = new improvement_opportunity();
                    newRec.ID               = intID;
                    newRec.notes            = strnotes;
                    newRec.specificGoal     = strspecificGoal;
                    newRec.specificPractice = strspecificPractice;
                    newRec.genericGoal      = strgenericGoal;
                    newRec.genericPractice  = strgenericPractice;
                    newRec.projectId        = int_projectId;
                    newRec.processArea      = strprocessArea;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase_ByProcessArea
Esempio n. 10
0
        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase - read all records from "theTable" insert them into this.itemList
        ///</summary>
        ///<input>List<process_area>  itemList - an ordinary List<> of type pa_tree_node, will be cleared if not already empty </input>
        ///<output>List<process_area> itemList - an ordinary List<> of type pa_tree_node, extracted from the database </output>
        public void ReadItemListFromDatabase()
        {
            itemList.Clear();  // ensure itemList is empty

            string  sQuery = "SELECT * FROM " + theTable;
            DataSet dsObj  = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract all fields of the current row
                    int    intID           = Convert.ToInt32(dr["Id"]);
                    int    processAreaId   = Convert.ToInt32(dr["processAreaId"]);
                    int    projectId       = Convert.ToInt32(dr["projectId"]);
                    string name            = dr["paName"].ToString();
                    string text            = dr["text"].ToString();
                    bool   boolIsActive    = Convert.ToBoolean(dr["active"]);
                    bool   hasArtifacts    = Convert.ToBoolean(dr["hasArtifact"]);
                    bool   hasAffirmations = Convert.ToBoolean(dr["hasAffirmation"]);
                    string strRating       = (dr["rating"]).ToString();
                    bool   boolCoverage    = Convert.ToBoolean(dr["coverage"]);

                    //fill the itemList
                    process_area newRec = new process_area();
                    newRec.ID                    = intID;
                    newRec.processAreaId         = processAreaId;
                    newRec.projectId             = projectId;
                    newRec.paName                = name;
                    newRec.text                  = text;
                    newRec.active                = boolIsActive;
                    newRec.canContainArtifact    = hasArtifacts;
                    newRec.canContainAffirmation = hasAffirmations;
                    newRec.rating                = strRating;
                    newRec.coverage              = boolCoverage;

                    itemList.Add(newRec);
                } //foreach
            }
        }         //ReadItemListFromDatabase
Esempio n. 11
0
        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase - read all records from "theTable" insert them into this.itemList
        ///</summary>
        ///<input>List<mapping> itemList - an ordinary List<> of type mapping, will be cleared if not already empty </input>
        ///<output>List<mapping>  itemList - an ordinary List<> of type mapping, extracted from the database </output>
        public void ReadItemListFromDatabase()
        {
            itemList.Clear();  //First, empty the existing list contents

            string  sQuery = "SELECT * FROM " + theTable;
            DataSet dsObj  = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    int_ID              = Convert.ToInt32(dr["ID"]);
                    int    int_mappingId       = Convert.ToInt32(dr["mappingId"]);
                    String strmappingName      = dr["mappingName"].ToString();
                    String strmappingPath      = dr["mappingPath"].ToString();
                    String strspecificGoal     = dr["specificGoal"].ToString();
                    String strspecificPractice = dr["specificPractice"].ToString();
                    String strgenericGoal      = dr["genericGoal"].ToString();
                    String strgenericPractice  = dr["genericPractice"].ToString();
                    String strprocessArea      = dr["processArea"].ToString();
                    int    int_projectId       = Convert.ToInt32(dr["projectId"]);

                    //fill the itemList
                    mapping newRec = new mapping();
                    newRec.ID               = int_ID;
                    newRec.mappingId        = int_mappingId;
                    newRec.mappingName      = strmappingName;
                    newRec.mappingPath      = strmappingPath;
                    newRec.specificGoal     = strspecificGoal;
                    newRec.specificPractice = strspecificPractice;
                    newRec.genericGoal      = strgenericGoal;
                    newRec.genericPractice  = strgenericPractice;
                    newRec.processArea      = strprocessArea;
                    newRec.projectId        = int_projectId;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase
Esempio n. 12
0
        }         // ReadItemListFromDatabase_ByProjectIDAndProcessAreaId

        /// <summary>
        /// Retrieve a specific node from the goal_practice table and put it in the item list.
        /// </summary>
        /// <param name="nodeName"></param>
        public void ReadItemFromDatabase_ByProjectIDAndNodeName(int projectId, string nodeName)
        {
            itemList.Clear();

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE  " +
                            " projectId  =  " + "'" + projectId + "'" +
                            " AND name  LIKE " + "'" + nodeName + "'";

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract all fields of the current row
                    int    intID            = Convert.ToInt32(dr["Id"]);
                    int    intNodeId        = Convert.ToInt32(dr["nodeId"]);
                    int    intProcessAreaId = Convert.ToInt32(dr["processAreaId"]);
                    string strnodename      = dr["name"].ToString();
                    bool   boolIsGoal       = Convert.ToBoolean(dr["isGoal"]);
                    bool   boolIsPractice   = Convert.ToBoolean(dr["isPractice"]);
                    string strRating        = (dr["rating"]).ToString();
                    bool   boolCoverage     = Convert.ToBoolean(dr["coverage"]);

                    //fill the itemList
                    goal_practice newRec = new goal_practice();
                    newRec.ID            = intID;
                    newRec.nodeId        = intNodeId;
                    newRec.processAreaId = intProcessAreaId;
                    newRec.name          = strnodename;
                    newRec.isGoal        = boolIsGoal;
                    newRec.isPractice    = boolIsPractice;
                    newRec.rating        = strRating;
                    newRec.coverage      = boolCoverage;

                    itemList.Add(newRec);
                } //foreach
            }     //if
        }         //ReadItemFromDatabase_ByProjectIDAndNodeName
Esempio n. 13
0
        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase - read all records from "theTable" insert them into this.itemList
        ///</summary>
        ///<input>List<process_area>  itemList - an ordinary List<> of type pa_tree_node, will be cleared if not already empty </input>
        ///<output>List<process_area> itemList - an ordinary List<> of type pa_tree_node, extracted from the database </output>
        public void ReadItemListFromDatabase()
        {
            itemList.Clear();  // ensure itemList is empty

            string  sQuery = "SELECT * FROM " + theTable;
            DataSet dsObj  = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract all fields of the current row
                    int    intID          = Convert.ToInt32(dr["Id"]);
                    int    nodeId         = Convert.ToInt32(dr["nodeId"]);
                    int    processAreaId  = Convert.ToInt32(dr["processAreaId"]);
                    int    projectId      = Convert.ToInt32(dr["projectId"]);
                    string name           = dr["name"].ToString();
                    bool   boolIsGoal     = Convert.ToBoolean(dr["isGoal"]);
                    bool   boolIsPractice = Convert.ToBoolean(dr["isPractice"]);
                    string strRating      = (dr["rating"]).ToString();
                    bool   boolcoverage   = Convert.ToBoolean(dr["coverage"]);


                    //fill the itemList
                    goal_practice newRec = new goal_practice();
                    newRec.ID            = intID;
                    newRec.nodeId        = nodeId;
                    newRec.processAreaId = processAreaId;
                    newRec.projectId     = projectId;
                    newRec.name          = name;
                    newRec.isGoal        = boolIsGoal;
                    newRec.isPractice    = boolIsPractice;
                    newRec.rating        = strRating;
                    newRec.coverage      = boolcoverage;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase
Esempio n. 14
0
        }         //ReadItemListFromDatabase

        //---------------------------------------------------------------------------------------------------------------
        ///<summary>
        /// ReadItemListFromDatabase_ByProjectID - read all records from "theTable" insert them into this.itemList, filter by appraisalName
        /// 1) Erase the current itemList in memory first
        /// 2) Read records from SQLServer, filling the itemList
        ///</summary>
        ///<input>List<appraisal> itemList</appraisal> itemList - an ordinary List<> of type appraisal, will be cleared if not already empty </input>
        ///<output>List<appraisal> itemList</appraisal> itemList - an ordinary List<> of type appraisal, extracted from the database </output>
        ///<param name="appraisalName"></param>
        public void ReadItemListFromDatabase_ByAppraisalName(string appraisalName)
        {
            itemList.Clear();  //First, empty the existing list contents

            string sQuery = "SELECT * FROM " + theTable +
                            " WHERE appraisalName=" + appraisalName;

            DataSet dsObj = DBUtils.ExecuteSqlQuery(sQuery);

            if (dsObj != null && dsObj.Tables[0].Rows.Count > 0)
            {
                DataTable dtObj = dsObj.Tables[0]; //get the DataTable reference once

                foreach (DataRow dr in dtObj.Rows)
                {
                    //extract data
                    int    intID            = Convert.ToInt32(dr["Id"]);
                    String strappraisalName = dr["appraisalName"].ToString();
                    String strcreator       = dr["creator"].ToString();
                    int    intmaturityLevel = Convert.ToInt32(dr["maturityLevel"]);
                    String strprojects      = dr["projects"].ToString();
                    bool   bsamSelected     = Convert.ToBoolean(dr["samSelected"]);
                    bool   bssdSelected     = Convert.ToBoolean(dr["ssdSelected"]);

                    //fill the itemList
                    appraisal newRec = new appraisal();
                    newRec.ID            = intID;
                    newRec.AppraisalName = strappraisalName;
                    newRec.Creator       = strcreator;
                    newRec.MaturityLevel = intmaturityLevel;
                    newRec.Projects      = strprojects;
                    newRec.SAMSelected   = bsamSelected;
                    newRec.SSDSelected   = bssdSelected;

                    itemList.Add(newRec);
                } //for
            }
        }         //ReadItemListFromDatabase_ByProjectID