Example #1
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_Guid Invoke(string ConnectionString, P_L6DT_UDTSHwAD_1637 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }
Example #2
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_Guid Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L6DT_UDTSHwAD_1637 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_Guid functionReturn = new FR_Guid();

            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_Update_DeveloperTaskStatusHistoryWithAddDocument", ex);
            }
            return(functionReturn);
        }
Example #3
0
        protected static FR_Guid Execute(DbConnection Connection, DbTransaction Transaction, P_L6DT_UDTSHwAD_1637 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Guid();
            //Put your code here

            #region DocumentUpdated

            var documentUpdatedParam = new P_L2DT_GDTSfGPM_1121();
            documentUpdatedParam.GlobalPropertyMatchingID = EnumUtils.GetEnumDescription(EDeveloperTaskHistory.DocumentUpdated);

            var documentUpdatedID = cls_Get_DeveloperTaskStatus_for_GlobalPropertyMatchingID.Invoke(Connection, Transaction, documentUpdatedParam, securityTicket).Result;

            #endregion

            var dtask = new ORM_TMS_PRO_DeveloperTask();
            dtask.Load(Connection, Transaction, Parameter.DeveloperTaskID);

            ORM_TMS_PRO_ProjectMember.Query assinment_Query = new ORM_TMS_PRO_ProjectMember.Query();
            assinment_Query.USR_Account_RefID = securityTicket.AccountID;
            assinment_Query.Project_RefID     = dtask.Project_RefID;
            assinment_Query.IsDeleted         = false;

            List <ORM_TMS_PRO_ProjectMember> assinment = ORM_TMS_PRO_ProjectMember.Query.Search(Connection, Transaction, assinment_Query);

            ORM_TMS_PRO_DeveloperTask_StatusHistory statusHistory = new ORM_TMS_PRO_DeveloperTask_StatusHistory();

            statusHistory.TMS_PRO_DeveloperTask_StatusHistoryID = Guid.NewGuid();
            statusHistory.DeveloperTask_RefID             = dtask.TMS_PRO_DeveloperTaskID;
            statusHistory.DeveloperTask_Status_RefID      = documentUpdatedID.TMS_PRO_DeveloperTask_StatusID;
            statusHistory.TriggeredBy_ProjectMember_RefID = assinment.First().TMS_PRO_ProjectMemberID;
            statusHistory.Tenant_RefID       = securityTicket.TenantID;
            statusHistory.Creation_Timestamp = DateTime.Now;
            if (Parameter.FileType == "Document")
            {
                statusHistory.Comment = (String)HttpContext.GetGlobalResourceObject("Global", "File_Add") + Parameter.FileName;
            }
            else if (Parameter.FileType == "Revision")
            {
                statusHistory.Comment = (String)HttpContext.GetGlobalResourceObject("Global", "File_Add") + Parameter.FileName;
            }
            else
            {
                statusHistory.Comment = (String)HttpContext.GetGlobalResourceObject("Global", "Folder_Add") + Parameter.FileName;
            }

            statusHistory.Save(Connection, Transaction);

            return(returnValue);

            #endregion UserCode
        }
Example #4
0
 ///<summary>
 /// Invokes the method for the given Connection, and Transaction, leaving them open/not commited if no exceptions occured
 ///<summary>
 public static FR_Guid Invoke(DbConnection Connection, DbTransaction Transaction, P_L6DT_UDTSHwAD_1637 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }