Esempio n. 1
0
        protected static FR_Base Execute(DbConnection Connection, DbTransaction Transaction, P_L5CM_DCSFL_1545 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Base();


            foreach (var item in Parameter.Items)
            {
                //Office
                if (item.StructureType == 1)
                {
                    P_L5OF_DO_0952 par = new P_L5OF_DO_0952();
                    par.CMN_STR_OfficeID = item.StructureItemID;
                    par.CMN_CAL_CalendarInstance_RefID = item.CMN_CAL_CalendarInstance_RefID;
                    cls_Delete_Office.Invoke(Connection, Transaction, par);
                }
                //WorkArea
                else if (item.StructureType == 2)
                {
                    P_L5WA_DWA_0923 par = new P_L5WA_DWA_0923();
                    par.CMN_STR_PPS_WorkAreaID         = item.StructureItemID;
                    par.CMN_CAL_CalendarInstance_RefID = item.CMN_CAL_CalendarInstance_RefID;
                    cls_Delete_WorkArea.Invoke(Connection, Transaction, par);
                }
                //WorkPlace
                else if (item.StructureType == 3)
                {
                    P_L5WP_DWP_0917 par = new P_L5WP_DWP_0917();
                    par.CMN_STR_PPS_WorkplaceID        = item.StructureItemID;
                    par.CMN_CAL_CalendarInstance_RefID = item.CMN_CAL_CalendarInstance_RefID;
                    cls_Delete_WorkPlace.Invoke(Connection, Transaction, par);
                }
            }
            return(returnValue);

            #endregion UserCode
        }
Esempio n. 2
0
        ///<summary>
        /// Method Invocation of wrapper classes
        ///<summary>
        protected static FR_Base Invoke(DbConnection Connection, DbTransaction Transaction, string ConnectionString, P_L5WA_DWA_0923 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            bool cleanupConnection  = Connection == null;
            bool cleanupTransaction = Transaction == null;

            FR_Base functionReturn = new FR_Base();

            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 ex;
            }
            return(functionReturn);
        }
Esempio n. 3
0
 ///<summary>
 /// Opens the connection/transaction for the given connectionString, and closes them when complete
 ///<summary>
 public static FR_Base Invoke(string ConnectionString, P_L5WA_DWA_0923 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(null, null, ConnectionString, Parameter, securityTicket));
 }
Esempio n. 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_Base Invoke(DbConnection Connection, DbTransaction Transaction, P_L5WA_DWA_0923 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
 {
     return(Invoke(Connection, Transaction, null, Parameter, securityTicket));
 }
Esempio n. 5
0
        protected static FR_Base Execute(DbConnection Connection, DbTransaction Transaction, P_L5WA_DWA_0923 Parameter, CSV2Core.SessionSecurity.SessionSecurityTicket securityTicket = null)
        {
            #region UserCode
            var returnValue = new FR_Base();



            ORM_CMN_STR_PPS_WorkArea whereInstance = CSV2Core_MySQL.Support.SQLClassFilter.GetDefaultInstance <ORM_CMN_STR_PPS_WorkArea>();
            whereInstance.CMN_STR_PPS_WorkAreaID = Parameter.CMN_STR_PPS_WorkAreaID;
            int result = CSV2Core_MySQL.Support.SQLClassFilter.Delete(Connection, Transaction, whereInstance);

            ORM_CMN_CAL_CalendarInstance CalendarWhereInstance = CSV2Core_MySQL.Support.SQLClassFilter.GetDefaultInstance <ORM_CMN_CAL_CalendarInstance>();
            CalendarWhereInstance.CMN_CAL_CalendarInstanceID = Parameter.CMN_CAL_CalendarInstance_RefID;
            CSV2Core_MySQL.Support.SQLClassFilter.Delete(Connection, Transaction, CalendarWhereInstance);
            return(returnValue);

            #endregion UserCode
        }