Beispiel #1
0
        public void SetOtherData()
        {
            myOtherItem = new OtherFeesPaymentItem();

            if (isOld == true)
            {
                myOtherItem.OtherPay_OtherFees_Id = selectedOldId;
            }
            else
            {
                myOtherItem.OtherPay_OtherFees_Id = selectedOtherId;
            }
            if (isOld == true)
            {
                myOtherItem.OtherPay_Bill_Id = OldBillId;
            }
            else
            {
                myOtherItem.OtherPay_Bill_Id = Int32.Parse(lblHiddenBillId.Text);
            }
            myOtherItem.OtherPay_Std_Id   = selectedId;
            myOtherItem.OtherPay_Number   = payNumber + 1;
            myOtherItem.OtherPay_Paid     = amountPay;
            myOtherItem.OtherPay_DatePaid = datePay;
            if (isOld == true)
            {
                myOtherItem.OtherPay_IsOld = "true";
            }
            else
            {
                myOtherItem.OtherPay_IsOld = "false";
            }
            myOtherItem.OtherPay_Deleted = "no";
        }
        private void UpdateOldPayment()
        {
            using (EditPayments editPay = new EditPayments())
            {
                editPay.txtPayNo.text     = gridOtherPay[gridOtherPay.RowSel, 1].ToString();
                editPay.txtAmount.text    = gridOtherPay[gridOtherPay.RowSel, 2].ToString();
                editPay.calDatePaid.Value = DateTime.Parse(gridOtherPay[gridOtherPay.RowSel, 3].ToString());
                editPay.ShowDialog();
                if (editPay.isConfirmed == true)
                {
                    if (gridOld[gridOld.RowSel, 2].ToString() == "Tuition Fee")
                    {
                        var payManage = new PaymentManager();
                        var item      = new PaymentItem();

                        item.Payment_Number   = Int32.Parse(editPay.txtPayNo.text);
                        item.Payment_Paid     = Decimal.Parse(editPay.txtAmount.text);
                        item.Payment_DatePaid = editPay.calDatePaid.Value.ToString("MM/dd/yyyy");
                        item.Payment_Id       = selectedPayId;

                        payManage.UpdatePayment(item);
                    }
                    else
                    {
                        var otherPay = new OtherFeesPaymentManager();
                        var item     = new OtherFeesPaymentItem();

                        item.OtherPay_Number   = Int32.Parse(editPay.txtPayNo.text);
                        item.OtherPay_Paid     = Decimal.Parse(editPay.txtAmount.text);
                        item.OtherPay_DatePaid = editPay.calDatePaid.Value.ToString("MM/dd/yyyy");
                        item.OtherPay_Id       = selectedPayId;

                        otherPay.UpdateOtherPayment(item);
                    }
                }
            }
            StdClick();
        }