Example #1
0
        protected static FR_L6DT_GDTFBTfPbP_1258_Array Execute(DbConnection Connection, DbTransaction Transaction, P_L6DT_GDTFBTfPbP_1258 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            //Leave UserCode region to enable user code saving
            #region UserCode
            var returnValue = new FR_L6DT_GDTFBTfPbP_1258_Array();
            //Put your code here
            List <L6DT_GDTFBTfPbP_1258> sortedList = new List <L6DT_GDTFBTfPbP_1258>();


            P_L3PR_GDTfPbP_1034 devParameter = new P_L3PR_GDTfPbP_1034();
            devParameter.ProjectID = Parameter.ProjectID;

            List <L3PR_GDTfPbP_1034> devTasks = cls_Get_DeveloperTasks_for_Project_by_ProjectID.Invoke(Connection, Transaction, devParameter, securityTicket).Result.ToList();

            if (devTasks.Count != 0)
            {
                sortedList = devTasks.Select(x => new L6DT_GDTFBTfPbP_1258

                {
                    ID       = x.TMS_PRO_DeveloperTaskID,
                    Name     = x.DeveloperTask,
                    TaskType = "devtask"
                }).OrderBy(x => x.Name).ToList();
            }


            P_L3PR_GFfPbP_1103 featureParameter = new P_L3PR_GFfPbP_1103();
            featureParameter.ProjectID = Parameter.ProjectID;

            List <L3PR_GFfPbP_1103> features = cls_Get_Features_for_Project_by_ProjectID.Invoke(Connection, Transaction, featureParameter, securityTicket).Result.ToList();

            if (features.Count != 0)
            {
                var sortedFeatures = features.Select(x => new L6DT_GDTFBTfPbP_1258

                {
                    ID       = x.TMS_PRO_FeatureID,
                    Name     = x.Name_DictID.GetContent(Parameter.LanguageID),
                    TaskType = "feature"
                }).OrderBy(x => x.Name).ToList();

                sortedList.AddRange(sortedFeatures);
            }


            P_L3PR_GBTfPbP_1241 bizParameter = new P_L3PR_GBTfPbP_1241();
            bizParameter.ProjectID = Parameter.ProjectID;

            List <L3PR_GBTfPbP_1241> bizTasks = cls_Get_BusinessTasks_for_Project_by_ProjectID.Invoke(Connection, Transaction, bizParameter, securityTicket).Result.ToList();

            if (bizTasks.Count != 0)
            {
                var sortedbiztasks = bizTasks.Select(x => new L6DT_GDTFBTfPbP_1258
                {
                    ID       = x.TMS_PRO_BusinessTaskID,
                    Name     = x.Task_Name_DictID.GetContent(Parameter.LanguageID),
                    TaskType = "biztask"
                }).OrderBy(x => x.Name).ToList();

                sortedList.AddRange(sortedbiztasks);
            }


            returnValue.Result = sortedList.ToArray();


            return(returnValue);

            #endregion UserCode
        }
Example #2
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_L6DT_GDTFBTfPbP_1258_Array Invoke(DbConnection Connection, DbTransaction Transaction, P_L6DT_GDTFBTfPbP_1258 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Example #3
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6DT_GDTFBTfPbP_1258_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6DT_GDTFBTfPbP_1258 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6DT_GDTFBTfPbP_1258_Array functionReturn = new FR_L6DT_GDTFBTfPbP_1258_Array();

            try
            {
                if (cleanupConnection == true)
                {
                    Connection = CSV2Core_MySQL.Support.DBSQLSupport.CreateConnection(ConnectionString);
                    Connection.Open();
                }
                if (cleanupTransaction == true)
                {
                    Transaction = Connection.BeginTransaction();
                }

                functionReturn = Execute(Connection, Transaction, Parameter, securityTicket);

                #region Cleanup Connection/Transaction
                //Commit the transaction
                if (cleanupTransaction == true)
                {
                    Transaction.Commit();
                }
                //Close the connection
                if (cleanupConnection == true)
                {
                    Connection.Close();
                }
                #endregion
            }
            catch (Exception ex)
            {
                try
                {
                    if (cleanupTransaction == true && Transaction != null)
                    {
                        Transaction.Rollback();
                    }
                }
                catch { }

                try
                {
                    if (cleanupConnection == true && Connection != null)
                    {
                        Connection.Close();
                    }
                }
                catch { }

                throw new Exception("Exception occured in method cls_Get_DevTasks_Features_BizTasks_for_Project_by_ProjectID", ex);
            }
            return(functionReturn);
        }
Example #4
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_L6DT_GDTFBTfPbP_1258_Array Invoke(string ConnectionString, P_L6DT_GDTFBTfPbP_1258 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }