Example #1
0
		public Int64 Insert(DebitPaymentDetails Details)
		{
			try  
			{
                Contacts clsContact = new Contacts(base.Connection, base.Transaction);
                clsContact.SubtractDebit(Details.CustomerDetails.ContactID, Details.Amount);

                Save(Details);

                return Int64.Parse(base.getLAST_INSERT_ID(this));
			}
			catch (Exception ex)
			{
				throw base.ThrowException(ex);
			}	
		}
Example #2
0
        public void UpdateDebit(long pvtlngContactID, long pvtlngTransactionID, string pvtstrTransactionNo, decimal pvtdecAmountPaid, string pvtstrRemarks)
		{
			try 
			{
                string SQL = "CALL procDebitCreditPaymentUpdateDebit(@TransactionID, @TransactionNo, @Amount, @Remarks);";

                MySqlCommand cmd = new MySqlCommand();
                cmd.CommandType = System.Data.CommandType.Text;
                cmd.CommandText = SQL;

                cmd.Parameters.AddWithValue("@TransactionID", pvtlngTransactionID);
                cmd.Parameters.AddWithValue("@TransactionNo", pvtstrTransactionNo);
                cmd.Parameters.AddWithValue("@Amount", pvtdecAmountPaid);

				base.ExecuteNonQuery(cmd);

				Contacts clsContact = new Contacts(base.Connection, base.Transaction);
                clsContact.SubtractDebit(pvtlngContactID, pvtdecAmountPaid);
			}

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