Example #1
0
        internal static int UpdateTransaction()
        {
            try
            {
                daTransactions = new tblTransactionsTableAdapter();
                dtTransactions = new DAL.DataObjects.dbDSCMainDataSet.tblTransactionsDataTable();

                daTransactions.FillById(dtTransactions, TransactionsBL.ID);
                drwTransactions = dtTransactions[0];

                //drwTransactions.TransactionDate = TransactionsBL.TransactionDate;
                drwTransactions.FormTypeCode        = TransactionsBL.FormTypeCode;
                drwTransactions.FormTypeDescription = TransactionsBL.FormTypeDescription;
                drwTransactions.FormsBfwd           = TransactionsBL.FormsBfwd;
                drwTransactions.FormsReceived       = TransactionsBL.FormsReceived;
                drwTransactions.FormsSorted         = TransactionsBL.FormsSorted;
                drwTransactions.FormsScanned        = TransactionsBL.FormsScanned;
                drwTransactions.FormsVerified       = TransactionsBL.FormsVerified;
                drwTransactions.BackLog             = TransactionsBL.BackLog;
                drwTransactions.DataClerk           = TransactionsBL.DataClerk;
                drwTransactions.DateCreated         = TransactionsBL.DateCreated;
                drwTransactions.CreatedBy           = TransactionsBL.CreatedBy;
                drwTransactions.DateModified        = TransactionsBL.DateModified;
                drwTransactions.ModifiedBy          = TransactionsBL.ModifiedBy;

                n = daTransactions.Update(dtTransactions);
                return(n);
            }
            catch (SqlException ex)
            {
                MessageBox.Show("Error: " + ex.Message.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
                return(n);
            }
        }
Example #2
0
        internal static int DeleteTransaction()
        {
            n = 0;
            try
            {
                daTransactions = new tblTransactionsTableAdapter();
                dtTransactions = new DAL.DataObjects.dbDSCMainDataSet.tblTransactionsDataTable();
                daTransactions.FillById(dtTransactions, TransactionsBL.ID);

                drwTransactions = dtTransactions[0];

                drwTransactions.BeginEdit();

                drwTransactions.Deleted     = TransactionsBL.Deleted;
                drwTransactions.DeletedBy   = TransactionsBL.DeletedBy;
                drwTransactions.DateDeleted = TransactionsBL.DateDeleted;

                drwTransactions.EndEdit();

                n = daTransactions.Update(dtTransactions);

                return(n);
            }
            catch
            {
                return(n);
            }
        }