Exemple #1
0
        public void AddPayOther()
        {
            using (PaymentWindowForm addPay = new PaymentWindowForm())
            {
                addPay.lblSelectedFee.Text = gridOther[gridOther.RowSel, 2].ToString();
                addPay.lblBalance.Text     = gridOther[gridOther.RowSel, 4].ToString();
                addPay.payNum = payNumber;
                addPay.ShowDialog();
                if (addPay.isConfirmed == true)
                {
                    amountPay       = addPay.amountHold;
                    datePay         = addPay.dateHold;
                    balanceDiff     = Decimal.Parse(gridOther[gridOther.RowSel, 4].ToString()) - amountPay;
                    totalBalDiff    = Decimal.Parse(lblBalance.Text) - amountPay;
                    payMadeSum      = Decimal.Parse(gridOther[gridOther.RowSel, 6].ToString()) + amountPay;
                    totalPayMadeSum = Decimal.Parse(lblPaymentMade.Text) + amountPay;
                    InsertOtherPay();
                    UpdateOtherBalance();

                    LoadSelectedBill();
                    LoadSelectedOtherPay();

                    if (gridOther.Rows.Count != 1)
                    {
                        selectedOtherId = Int32.Parse(gridOther[gridOther.RowSel, 1].ToString());
                    }
                    else
                    {
                        selectedOtherId = 0;
                    }
                    LoadSelectedOtherPayments();
                }
                // do what ever with result...
            }
        }
Exemple #2
0
        public void AddPayOld()
        {
            using (PaymentWindowForm addPay = new PaymentWindowForm())
            {
                addPay.lblSelectedFee.Text = gridOld[gridOld.RowSel, 2].ToString();
                addPay.lblBalance.Text     = gridOld[gridOld.RowSel, 4].ToString();
                addPay.ShowDialog();
                if (addPay.isConfirmed == true)
                {
                    amountPay   = addPay.amountHold;
                    datePay     = addPay.dateHold;
                    balanceDiff = Decimal.Parse(gridOld[gridOld.RowSel, 4].ToString()) - amountPay;
                    payMadeSum  = Decimal.Parse(gridOld[gridOld.RowSel, 5].ToString()) + amountPay;

                    isOld = true;
                    if (gridOld[gridOld.RowSel, 2].ToString() == "Tuition Fee")
                    {
                        InsertTuitionPay();
                        UpdateOldBalance();
                    }
                    else
                    {
                        InsertOtherPay();
                        UpdateOldOtherBalance();
                    }

                    LoadOld();

                    if (gridOld.Rows.Count != 1)
                    {
                        selectedOldId = Int32.Parse(gridOld[gridOld.RowSel, 1].ToString());
                    }
                    else
                    {
                        selectedOldId = 0;
                    }
                    isOld = false;
                }
                // do what ever with result...
            }
        }