예제 #1
0
        protected override void doDeleteNoTransaction(EventJournal e)
        {
            CustomerOutStandingInvoice st = (CustomerOutStandingInvoice)e;

            try
            {
                if (getEventStatus(st.ID) == EventStatus.Confirm)
                {
                    throw new Exception("Revise before delete");
                }
                m_command.CommandText = CustomerOutStandingInvoiceItem.DeleteAllByEventSQL(st.ID);
                m_command.ExecuteNonQuery();
                m_command.CommandText = CustomerOutStandingInvoice.DeleteSQL(st.ID);
                m_command.ExecuteNonQuery();
            }
            catch (Exception x)
            {
                throw x;
            }
        }
예제 #2
0
        protected override void doDelete(EventJournal e)
        {
            CustomerOutStandingInvoice st = (CustomerOutStandingInvoice)e;

            MySql.Data.MySqlClient.MySqlTransaction trc = m_connection.BeginTransaction();
            m_command.Transaction = trc;
            try
            {
                if (getEventStatus(st.ID) == EventStatus.Confirm)
                {
                    throw new Exception("Revise before delete");
                }
                m_command.CommandText = CustomerOutStandingInvoiceItem.DeleteAllByEventSQL(st.ID);
                m_command.ExecuteNonQuery();
                m_command.CommandText = CustomerOutStandingInvoice.DeleteSQL(st.ID);
                m_command.ExecuteNonQuery();
                trc.Commit();
            }
            catch (Exception x)
            {
                trc.Rollback();
                throw x;
            }
        }