Example #1
0
        public bool UpdatePayment(long WBranchTransferID, decimal PaidAmount, WBranchTransferPaymentStatus paymentStatus)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "UPDATE tblWBranchTransfer SET " +
                             "PaidAmount     = PaidAmount + @PaidAmount, " +
                             "UnpaidAmount   = UnpaidAmount - @PaidAmount, " +
                             "PaymentStatus  = @PaymentStatus " +
                             "WHERE WBranchTransferID = @WBranchTransferID;";

                cmd.Parameters.AddWithValue("@PaidAmount", PaidAmount);
                cmd.Parameters.AddWithValue("@PaymentStatus", paymentStatus.ToString("d"));
                cmd.Parameters.AddWithValue("@WBranchTransferID", WBranchTransferID);

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);

                return(true);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Example #2
0
        /**********************************
        * Lemuel E. Aceron
        * July 30, 2008 17:21
        * Added for Payment
        **********************************/
        public bool UpdatePaymentStatus(WBranchTransferPaymentStatus paymentStatus, string IDs)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "UPDATE tblWBranchTransfer SET PaymentStatus = @PaymentStatus WHERE WBranchTransferID IN (" + IDs + ");";

                cmd.Parameters.AddWithValue("@PaymentStatus", paymentStatus.ToString("d"));

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);

                return(true);
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Example #3
0
        public bool UpdatePayment(long WBranchTransferID, decimal PaidAmount, WBranchTransferPaymentStatus paymentStatus)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "UPDATE tblWBranchTransfer SET " +
                                "PaidAmount     = PaidAmount + @PaidAmount, " +
                                "UnpaidAmount   = UnpaidAmount - @PaidAmount, " +
                                "PaymentStatus  = @PaymentStatus " +
                             "WHERE WBranchTransferID = @WBranchTransferID;";
                
                cmd.Parameters.AddWithValue("@PaidAmount", PaidAmount);
                cmd.Parameters.AddWithValue("@PaymentStatus", paymentStatus.ToString("d"));
                cmd.Parameters.AddWithValue("@WBranchTransferID", WBranchTransferID);

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);

                return true;
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }
Example #4
0
        /**********************************
         * Lemuel E. Aceron
         * July 30, 2008 17:21
         * Added for Payment
         **********************************/
        public bool UpdatePaymentStatus(WBranchTransferPaymentStatus paymentStatus, string IDs)
        {
            try
            {
                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;

                string SQL = "UPDATE tblWBranchTransfer SET PaymentStatus = @PaymentStatus WHERE WBranchTransferID IN (" + IDs + ");";

                cmd.Parameters.AddWithValue("@PaymentStatus", paymentStatus.ToString("d"));

                cmd.CommandText = SQL;
                base.ExecuteNonQuery(cmd);

                return true;
            }
            catch (Exception ex)
            {
                throw base.ThrowException(ex);
            }
        }