private void g_EFTButton_Click(object sender, EventArgs e) { if (g_InputTextBox.Text.Substring(Program.currency.Length).Equals("0.00")) { CConfirmDialogBox tempConfirmDialog = new CConfirmDialogBox("Confirm", "Are you sure you want to enter zero value?"); tempConfirmDialog.ShowDialog(); if (CConfirmDialogBox.DialogResult.Equals("No")) return; } if (g_EFTButton == g_EFTButton) { CConfirmDialogBox tempConfirmDialog = new CConfirmDialogBox("Confirm", "Do you want to pament in the card? If click on 'No' button then click on 'Clear' button"); tempConfirmDialog.ShowDialog(); if (CConfirmDialogBox.DialogResult.Equals("No")) return; } /*************/ EFTOptionForm eFTOptionForm = new EFTOptionForm(); DialogResult dr = eFTOptionForm.ShowDialog(); if (dr == DialogResult.Cancel) return; saveEFTCardAgainsOrderid(EFTOptionForm.seletedEFTCard); /*********************/ g_EFTLabel.Text = g_InputTextBox.Text; CurrentPaymentMethod = "EFT"; #region "Service charge payment section" //New added at 16.02.2009 if (this.IsFinishedActualAmount() == true) { Double tempTotalPaid = 0.0; tempTotalPaid = Double.Parse(g_CashLabel.Text.Substring(Program.currency.Length)) + Double.Parse(g_EFTLabel.Text.Substring(Program.currency.Length)) + Double.Parse(g_ChequeLabel.Text.Substring(Program.currency.Length)) + Double.Parse(g_AccountLabel.Text.Substring(Program.currency.Length)) + Double.Parse(g_VoucherLabel.Text.Substring(Program.currency.Length)); double serviceCharge = Convert.ToDouble(g_ServiceChargeLabel.Text.Substring(Program.currency.Length)); //double tobePaid = Convert.ToDouble(g_BillTotalLabel.Text.Substring(Program.currency.Length));//Total payment without service charge double dblAssignedServiceCharge = (m_serviceCharge_cash + m_serviceCharge_eft + m_serviceCharge_cheque + m_serviceCharge_voucher + m_serviceCharge_accounts); if (serviceCharge > dblAssignedServiceCharge)//If service charge is rest to pay { double extraPayBack = 0.0; if (g_BalaceLabel.Text.Contains("Pay Back")) { extraPayBack = Convert.ToDouble("0" + g_BalaceLabel.Text.Substring(9 + Program.currency.Length));//For deducting the payback amount } m_serviceCharge_eft = tempTotalPaid - (m_tobePaid + dblAssignedServiceCharge) - extraPayBack; if (m_serviceCharge_eft < 0) { m_serviceCharge_eft = 0; } } } if (g_BalaceLabel.Text.Contains("Pay Back")) { // string[] payBackArray = g_BalaceLabel.Text.Split(); double balance = Convert.ToDouble(g_BalaceLabel.Text.Substring(9 + Program.currency.Length)); if (balance > 0) { PayBackComfirmForm objPayBack = new PayBackComfirmForm(); objPayBack.ShowDialog(); if (PayBackComfirmForm.m_cancelStatus.Replace(" ", "").ToUpper() == "Cancel".Replace(" ", "").ToUpper()) { return; } if (PayBackComfirmForm.m_PaybackStatus.Replace(" ", "").ToUpper() == "Add to Service Charge".Replace(" ", "").ToUpper()) { m_serviceCharge_eft = m_serviceCharge_eft + Convert.ToDouble("0" + g_BalaceLabel.Text.Substring(9 + Program.currency.Length)); g_BalaceLabel.Text = "Pay Back " + Program.currency + "0.00"; m_isAddServiceCharge = true; } } } #endregion if (m_serviceCharge_eft < 0) { m_serviceCharge_eft = 0; } UpdateCalculation(2); g_InputTextBox.Text = Program.currency + "0.00"; g_EFTButton.Enabled = false; btnAlterEftCard.Enabled = true; btnAlterEftCard.Text = "'" + EFTOptionForm.seletedEFTCard.CardName + "' is chosen. Click to alter the Card Name."; }
private void duebillPaymentButton_Click(object sender, EventArgs e) { if (tempSearchOrderInfo.DueBill > 0) { DueBillPaymentForm aDueBillPaymentForm = new DueBillPaymentForm(); aDueBillPaymentForm.ShowDialog(); double amount = 0.0; if (DueBillPaymentForm.inputResult.Equals("Cancel")) return; string amt = DueBillPaymentForm.inputResult.Substring(Program.currency.Length); if (Convert.ToDouble(amt) == 0.00) { CMessageBox tempMessageBox = new CMessageBox("Error!", "Price cannot be zero."); tempMessageBox.ShowDialog(); return; } amount = Convert.ToDouble(amt); string paymentmethod = ""; string cardName = ""; PaymentMethod aPaymentMethod = new PaymentMethod(); aPaymentMethod.ShowDialog(); paymentmethod = PaymentMethod.inputResult; if (paymentmethod == "Card") { EFTOptionForm eFTOptionForm = new EFTOptionForm(); DialogResult dr = eFTOptionForm.ShowDialog(); if (dr == DialogResult.Cancel) return; saveEFTCardAgainsOrderid(EFTOptionForm.seletedEFTCard); } PaymentDueBill aPaymentDueBill = new PaymentDueBill(); CPayment aPayment = new CPayment(); aPayment.OrderID = orderID; double tempamount = 0; if (amount - tempSearchOrderInfo.DueBill >= 0) { tempamount = tempSearchOrderInfo.DueBill; } else if (tempSearchOrderInfo.DueBill - amount > 0) { tempamount = amount; } if (paymentmethod == "Cash") { aPayment.CashAmount = tempamount; aPayment.EFTAmount = 0; aPaymentDueBill.CashAmount = tempamount; } else if (paymentmethod == "Card") { aPayment.EFTAmount = tempamount; aPayment.CashAmount = 0; aPaymentDueBill.CardAmount = tempamount; } aPayment.ChequeAmount = tempSearchOrderInfo.DueBill - tempamount; aPaymentDueBill.PaymentDate = DateTime.Now; CPaymentDAO aPaymentDao = new CPaymentDAO(); string sr = aPaymentDao.UpdatePaymentForDueBill(aPayment, aPaymentDueBill); MessageBox.Show(sr); this.Close(); } else { MessageBox.Show("Due Bill Must be greater than zero"); } }
private void btnAlterEftCard_Click(object sender, EventArgs e) { EFTOptionForm eFTOptionForm = new EFTOptionForm(); DialogResult dr = eFTOptionForm.ShowDialog(); if (dr == DialogResult.Cancel) return; saveEFTCardAgainsOrderid(EFTOptionForm.seletedEFTCard); btnAlterEftCard.Text = "'" + EFTOptionForm.seletedEFTCard.CardName + "' is chosen. Click to alter the Card Name."; }