コード例 #1
0
        /// <summary>
        /// Creates a requirement Folder
        /// </summary>
        /// <param name="folderName">Requirement folder name</param>
        /// <param name="folderPath">Requirement folder path</param>
        /// <returns>TDAPIOLELib.Req Object</returns>
        public TDAPIOLELib.Req CreateFolder(String folderName, String folderPath)
        {
            TDAPIOLELib.Req        req        = GetReqByPath(folderPath);
            TDAPIOLELib.ReqFactory reqFactory = tDConnection.ReqFactory;

            TDAPIOLELib.Req newReq = reqFactory.AddItem(System.DBNull.Value);

            newReq.ParentId      = req.ID;
            newReq["RQ_TYPE_ID"] = TDAPIOLELib.TDAPI_PREDEFINED_REQ_TYPES.REQ_TYPE_FOLDER;

            newReq.Name = folderName;

            newReq.Post();

            return(newReq);
        }
コード例 #2
0
        /// <summary>
        /// Creates a new requirement
        /// </summary>
        /// <param name="requirementDetails">dictionary object with requirement database field names and values</param>
        /// <param name="folderPath"></param>
        /// <param name="reqType"></param>
        /// <returns></returns>
        public TDAPIOLELib.Req Create(Dictionary <String, String> requirementDetails, String folderPath, TDAPIOLELib.TDAPI_PREDEFINED_REQ_TYPES reqType = TDAPIOLELib.TDAPI_PREDEFINED_REQ_TYPES.REQ_TYPE_UNDEFINED)
        {
            TDAPIOLELib.Req        req        = GetReqByPath(folderPath);
            TDAPIOLELib.ReqFactory reqFactory = tDConnection.ReqFactory;

            TDAPIOLELib.Req newReq = reqFactory.AddItem(System.DBNull.Value);

            newReq.ParentId      = req.ID;
            newReq["RQ_TYPE_ID"] = reqType;

            foreach (KeyValuePair <String, String> kvp in requirementDetails)
            {
                newReq[kvp.Key] = kvp.Value;
            }

            newReq.Post();

            return(newReq);
        }