Example #1
0
        public bool setExhibit_Exhibition(DataSetMuseum dataSet)
        {
            bool       result     = false;
            Connection connection = new Connection();

            connection.Open();
            try
            {
                Transaction transaction = connection.BeginTransaction();
                try
                {
                    exhibit_Exhibition = new Exhibit_Exhibition();
                    exhibit_Exhibition.Save(dataSet, connection, transaction);
                    transaction.Commit();
                    result = true;
                }
                catch (Exception ex)
                {
                    ShowError(ex.ToString());
                    transaction.Rollback();
                    result = false;
                }
            }
            finally
            {
                connection.Close();
            }
            return(result);
        }
Example #2
0
        public DataSetMuseum getExhibit_Exhibition()
        {
            DataSetMuseum result     = new DataSetMuseum();
            Connection    connection = new Connection();

            connection.Open();
            try
            {
                Transaction transaction = connection.BeginTransaction();
                try
                {
                    exhibit_Exhibition = new Exhibit_Exhibition();
                    exhibit_Exhibition.Read(result, connection, transaction);
                    transaction.Commit();
                }
                catch (Exception ex)
                {
                    ShowError(ex.ToString());
                    transaction.Rollback();
                    result = null;
                }
            }
            finally
            {
                connection.Close();
            }
            return(result);
        }