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

            FR_L6DN_GADfNP_1449_Array functionReturn = new FR_L6DN_GADfNP_1449_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_All_Data_for_Notes_Page", ex);
            }
            return(functionReturn);
        }
コード例 #2
0
        protected static FR_L6DN_GADfNP_1449_Array Execute(DbConnection Connection, DbTransaction Transaction, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_L6DN_GADfNP_1449_Array();
            //Put your code here

            // return data
            List <L6DN_GADfNP_1449> notesData = new List <L6DN_GADfNP_1449>();

            //get notes
            var notes = cls_Get_Data_for_NotesPage_without_Collaborators_and_Tags_for_TenantID.Invoke(Connection, Transaction, securityTicket).Result;

            // get tags and collaborators for each note
            foreach (var note in notes)
            {
                L6DN_GADfNP_1449 notesObj = new L6DN_GADfNP_1449();

                notesObj.Notes = note;

                P_L3N_GTfPaT_1028 tagParam = new P_L3N_GTfPaT_1028();
                tagParam.ProjectNoteID = note.TMS_PRO_Project_NoteID;
                var tags = cls_Get_Tags_for_ProjectID_and_TenantID.Invoke(Connection, Transaction, tagParam, securityTicket).Result;

                notesObj.Tags = tags;

                P_L3N_GCfPaT_1422 collabParam = new P_L3N_GCfPaT_1422();
                collabParam.ProjectNoteID = note.TMS_PRO_Project_NoteID;
                var collaborators = cls_Get_Collaborators_for_ProjectID_and_TenantID.Invoke(Connection, Transaction, collabParam, securityTicket).Result;

                notesObj.Collaborators = collaborators;

                notesData.Add(notesObj);
            }

            returnValue.Result = notesData.ToArray();


            return(returnValue);

            #endregion UserCode
        }