Esempio n. 1
0
        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.";
        }
Esempio n. 2
0
        private void g_ChequeButton_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;
            }

            g_ChequeLabel.Text = g_InputTextBox.Text;
            CurrentPaymentMethod = "Due";

            #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 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_cheque = tempTotalPaid - (m_tobePaid + dblAssignedServiceCharge) - extraPayBack;
                }
            }

            if (g_BalaceLabel.Text.Contains("Pay Back"))
            {
                double payBackArray = Convert.ToDouble(g_BalaceLabel.Text.Substring(9+Program.currency.Length));
                if (Convert.ToDouble("0" + payBackArray) > 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_cheque = m_serviceCharge_cheque + 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_cheque < 0)
            {
                m_serviceCharge_cheque = 0;
            }

            UpdateCalculation(3);
            g_InputTextBox.Text = Program.currency.Length + "0.00";
            g_ChequeButton.Enabled = false;
        }
Esempio n. 3
0
        private void g_DiscountButton_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;
            }

            g_DiscountLabel.Text = g_InputTextBox.Text;
            CurrentPaymentMethod = "Discount";
            UpdateCalculation(0);
            g_InputTextBox.Text = Program.currency + "0.00";
            g_DiscountButton.Enabled = false;
        }
Esempio n. 4
0
        private void g_VoucherButton_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;
            }

            //CCalculatorForm tempCalculatorForm = new CCalculatorForm("Voucher Number", "Enter Voucher Number");
            //tempCalculatorForm.ShowDialog();

            //if (CCalculatorForm.inputResult.Equals("Cancel"))
            //    return;

            Double voucherAmount = 0;
            Double.TryParse(g_InputTextBox.Text.Substring(Program.currency.Length), out voucherAmount);
            if (voucherAmount > m_dBalance)
            {
                m_dTotalAmount = m_dTotalAmount - m_dBalance;
                g_VoucherLabel.Text = Program.currency + m_dBalance.ToString("F02");
            }
            else
            {
                m_dTotalAmount = m_dTotalAmount - voucherAmount;
                g_VoucherLabel.Text = g_InputTextBox.Text;
            }

            g_BillTotalLabel.Text = Program.currency + m_dTotalAmount.ToString("F02");

            //insert order voucher
            m_oOrderVoucher = new COrderVoucher();
               // m_oOrderVoucher.VoucherID = Int64.Parse(CCalculatorForm.inputResult);
            m_oOrderVoucher.OrderID = m_iOrderID;
            m_oOrderVoucher.VoucherAmount = Double.Parse(g_VoucherLabel.Text.Substring(Program.currency.Length));

            CurrentPaymentMethod = "Voucher";

            #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_voucher = tempTotalPaid - (m_tobePaid + dblAssignedServiceCharge) - extraPayBack;
                    if (m_serviceCharge_voucher < 0)
                    {
                        m_serviceCharge_voucher = 0;
                    }
                }
            }

            if (g_BalaceLabel.Text.Contains("Pay Back"))
            {
                double payBackAmount = Convert.ToDouble(g_BalaceLabel.Text.Substring(9+Program.currency.Length));
                if (Convert.ToDouble("0" + payBackAmount) > 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_voucher = m_serviceCharge_voucher + 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_voucher < 0)
            {
                m_serviceCharge_voucher = 0;
            }

            UpdateCalculation(4);
            g_InputTextBox.Text = Program.currency + "0.00";
            g_VoucherButton.Enabled = false;
        }