Example #1
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_L6DT_GDTIfT_1444_Array Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_L6DT_GDTIfT_1444_Array functionReturn = new FR_L6DT_GDTIfT_1444_Array();

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

                functionReturn = Execute(Connection, Transaction, 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_DeveloperTask_Info_for_Tenant", ex);
            }
            return(functionReturn);
        }
Example #2
0
        protected static FR_L6DT_GDTIfT_1444_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L6DT_GDTIfT_1444_Array();
            //Put your code here
            List <L6DT_GDTIfT_1444> DeveloperTasksInfo = new List <L6DT_GDTIfT_1444>();
            var devTasksAndFeaturesForTenant           = cls_Get_DeveloperTask_with_Features_for_Tenant.Invoke(Connection, Transaction, securityTicket).Result.ToList();
            var nonArchivedNonDeletedParents           = cls_Get_Features_for_Tenant.Invoke(Connection, Transaction, securityTicket).Result.ToList();

            foreach (var item in devTasksAndFeaturesForTenant)
            {
                L6DT_GDTIfT_1444 DeveloperTaskInfo = new L6DT_GDTIfT_1444();

                DeveloperTaskInfo.Identifier = item.IdentificationNumber;
                DeveloperTaskInfo.DeveloperTaskDescription = item.Description;
                DeveloperTaskInfo.DeveloperTaskName        = item.Name;
                DeveloperTaskInfo.DeveloperTaskID          = item.TMS_PRO_DeveloperTaskID;
                DeveloperTaskInfo.EstimatedTime            = item.DeveloperTime_RequiredEstimation_min;
                DeveloperTaskInfo.Points          = item.Developer_Points;
                DeveloperTaskInfo.DeadLine        = item.Completion_Deadline.Date.ToString("d");
                DeveloperTaskInfo.ProjectID       = item.Project_RefID;
                DeveloperTaskInfo.ProjectMemberID = item.TMS_PRO_ProjectMemberID;
                //checking for subscriptions for current user

                ORM_TMS_PRO_Peers_Development subscription = ORM_TMS_PRO_Peers_Development.Query.Search(Connection, Transaction, new ORM_TMS_PRO_Peers_Development.Query()
                {
                    DeveloperTask_RefID = item.TMS_PRO_DeveloperTaskID,
                    Tenant_RefID        = securityTicket.TenantID,
                    ProjectMember_RefID = item.TMS_PRO_ProjectMemberID,
                    IsDeleted           = false
                }).SingleOrDefault();

                if (subscription != null)
                {
                    DeveloperTaskInfo.IsSubscribed = true;
                }



                //**********************************
                var parents = nonArchivedNonDeletedParents.Where(f => f.TMS_PRO_FeatureID == item.TMS_PRO_FeatureID).SingleOrDefault();
                if (parents != null)
                {
                    DeveloperTaskInfo.Path = parents.BTPath;
                }
                else
                {
                    DeveloperTaskInfo.Path = "-";
                }



                DeveloperTaskInfo.DeveloperInfo = new L6DT_GDTIfT_1444DeveloperInfo();
                List <L6DT_GDTIfT_1444TagInfo> TagsInfo = new List <L6DT_GDTIfT_1444TagInfo>();
                P_L3PM_GAIfPMID_1345           ProjectMemberInfoParameter = new P_L3PM_GAIfPMID_1345();
                ProjectMemberInfoParameter.ProjectMemberID = item.GrabbedByMember_RefID;
                var projectMemberInfo = cls_Get_Account_Information_for_ProjectMemberID.Invoke(Connection, Transaction, ProjectMemberInfoParameter, securityTicket).Result.ToList().SingleOrDefault();
                if (projectMemberInfo != null)
                {
                    DeveloperTaskInfo.DeveloperInfo.ProjectMemberID  = projectMemberInfo.TMS_PRO_ProjectMemberID;
                    DeveloperTaskInfo.DeveloperInfo.FirstAndLastName = projectMemberInfo.FirstName + " " + projectMemberInfo.LastName;
                    DeveloperTaskInfo.DeveloperInfo.ProjectMemberID  = item.GrabbedByMember_RefID;


                    P_L3DT_GTfDT_1738 developerTaskTagsParameter = new P_L3DT_GTfDT_1738();
                    developerTaskTagsParameter.DTaskID = item.TMS_PRO_DeveloperTaskID;
                    var tagsForDeveloperTask = cls_Get_Tags_for_DeveloperTask.Invoke(Connection, Transaction, developerTaskTagsParameter, securityTicket).Result.ToList();

                    List <L6DT_GDTIfT_1444TagInfo> Tags4DeveloperTask = new List <L6DT_GDTIfT_1444TagInfo>();
                    foreach (var tag in tagsForDeveloperTask)
                    {
                        L6DT_GDTIfT_1444TagInfo tagInfo = new L6DT_GDTIfT_1444TagInfo();
                        tagInfo.TagID        = tag.TMS_PRO_TagID;
                        tagInfo.TagValue     = tag.TagValue;
                        tagInfo.AssignmentID = tag.AssignmentID;
                        Tags4DeveloperTask.Add(tagInfo);
                    }
                    DeveloperTaskInfo.TagsInfo = Tags4DeveloperTask.ToArray();
                    DeveloperTasksInfo.Add(DeveloperTaskInfo);
                }
            }
            returnValue.Result = DeveloperTasksInfo.ToArray();
            return(returnValue);

            #endregion UserCode
        }