Exemplo n.º 1
0
        private void txtOtherCharges_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (e.Button.Index == 0)
            {
                if (txtStatus.Text == "Draft")
                {
                    MessageBox.Show("Your not able to add charges to draft documents!!!", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (txtStatus.Text == "Approved")
                {
                    MessageBox.Show("Your not able to add charges to approved status documents!!!", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                if (txtStatus.Text == "Closed" || txtStatus.Text == "Canceled")
                {
                    MessageBox.Show("Your not able to add charges to canceled or closed documents!!!", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                addOtherCharges oForm = new addOtherCharges();

                int iFocusedRowIndex = gridView1.FocusedRowHandle;
                string sScheduleNo = gridView1.GetRowCellValue(iFocusedRowIndex, gridView1.Columns["ScheduleNo"]).ToString();
                DateTime dtDueDate = (DateTime)gridView1.GetRowCellValue(iFocusedRowIndex, gridView1.Columns["ScheduledDate"]);

                oForm.ConnectionString = this.ConnectionString;
                oForm.DocumentNumber = txtLoanNo.Text;
                oForm.ScheduleNo = sScheduleNo;
                oForm.ScheduledDate = dtDueDate;

                oForm.ShowDialog();

                LoanManager oManager = new LoanManager();

                oManager.ConnectionString = this.ConnectionString;
                oManager.Open();
                this.LineScheduleOfPayment = oManager.GetLoanInfoLineItems(txtLoanNo.Text);
                oManager.Close();

                gridControl1.DataSource = this.LineScheduleOfPayment;
                gridControl1.Refresh();

                barSaveLoan.Caption = "Update";
                txtLoanNo.Enabled = false;

                BindCashReleased();
                BindCollections(txtLoanNo.Text);
                ComputeOutstandingBalance();
            }
            else
            {
                detailOtherCharges oForm = new detailOtherCharges();

                int iFocusedRowIndex = gridView1.FocusedRowHandle;
                string sScheduleNo = gridView1.GetRowCellValue(iFocusedRowIndex, gridView1.Columns["ScheduleNo"]).ToString();
                DateTime dtDueDate = (DateTime)gridView1.GetRowCellValue(iFocusedRowIndex, gridView1.Columns["ScheduledDate"]);

                oForm.ConnectionString = this.ConnectionString;
                oForm.DocumentNumber = txtLoanNo.Text;
                oForm.ScheduleNo = sScheduleNo;
                oForm.ShowDialog();
                ComputeOutstandingBalance();
            }
        }
Exemplo n.º 2
0
        private void txtPayment_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
        {
            if (e.Button.Index == 0)
            {
                if (txtStatus.Text == "Draft")
                {
                    MessageBox.Show("Your not able to add payment to draft documents!!!", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (txtStatus.Text == "Approved")
                {
                    MessageBox.Show("Your not able to add payment to approved documents!!!", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }

                if (txtStatus.Text == "Closed" || txtStatus.Text == "Canceled")
                {
                    MessageBox.Show("Your not able to add payment to closed documents!!!", "Payment", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    return;
                }
                addCollection oform = new addCollection();
                int iFocusedRowIndex = gridView1.FocusedRowHandle;

                oform.ConnectionString = this.ConnectionString;
                oform.ActiveUserID = this.ActiveUserID;
                oform.LoanNumber = txtLoanNo.Text;

                oform.ScheduledNo = Convert.ToInt16(gridView1.GetRowCellValue(iFocusedRowIndex, gridView1.Columns["ScheduleNo"]));

                oform.ShowDialog();

                LoanManager oManager = new LoanManager();

                oManager.ConnectionString = this.ConnectionString;
                oManager.Open();

                this.LineScheduleOfPayment = oManager.GetLoanInfoLineItems(txtLoanNo.Text);

                oManager.Close();

                gridControl1.DataSource = this.LineScheduleOfPayment;
                gridControl1.Refresh();

                BindCollections(txtLoanNo.Text);
                ComputeOutstandingBalance();
            }
            else
            {
                PaymentBreakdown oForm = new PaymentBreakdown();
                int iFocusedRowIndex = gridView1.FocusedRowHandle;

                oForm.ConnectionString = this.ConnectionString;
                oForm.ScheduleNo = Convert.ToInt16(gridView1.GetRowCellValue(iFocusedRowIndex, gridView1.Columns["ScheduleNo"]));
                oForm.DocumentNumber = txtLoanNo.Text;

                oForm.ShowDialog();
                ComputeOutstandingBalance();
            }
        }
Exemplo n.º 3
0
        public void OpenDocument(string sDocNum)
        {
            Initializetable();
            BindPayDayCode();

            cboModeOfPayment.SelectedIndex = 0;
            cboTransType.SelectedIndex = 0;

            txtCreatedBy.Text = this.ActiveUserID;
            txtModifiedBy.Text = this.ActiveUserID;

            DateTime dtNow = System.DateTime.Now;

            dtCreated.EditValue = dtNow;
            dtModified.EditValue = dtNow;

            dtStartOfPayment.EditValue = dtNow;
            dtDateOfRelease.EditValue = dtNow;

            txtTerms.Text = "1";

            LoanManager oManager = new LoanManager();

            oManager.ConnectionString = this.ConnectionString;
            oManager.Open();

            DataTable dtInfo = oManager.GetLoanInfo(sDocNum);

            DataRow oRow = dtInfo.Rows[0];

            //ounit.documentnumber = txtloanno.text;
            txtLoanNo.Text = oRow["DocNum"].ToString();
            txtCardCode.Text = oRow["CardCode"].ToString();
            txtCardName.Text = oRow["CardName"].ToString();
            cboTransType.Text = oRow["TransType"].ToString();
            txtGuarrantor.Text = oRow["Guarrantor"].ToString();
            txtLoanAmount.Text = string.Format("{0:N}", oRow["LoanAmount"].ToString());
            txtTerms.Text = string.Format("{0:N}", oRow["Terms"]);
            txtInterestRate.Text = oRow["InterestRate"].ToString();
            cboFrequencyOfPayment.Text = oRow["FreqOfPayment"].ToString();
            cboPayDayCode.EditValue = oRow["PayDayCode"].ToString();
            dtStartOfPayment.EditValue = (DateTime)oRow["FirstPaymentDate"];
            dtDateOfRelease.EditValue = (DateTime)oRow["DateOfReleasing"];
            txtAmortization.Text = string.Format("{0:N}", oRow["MonthlyPayment"]);
            txtNoOfPayments.Text = string.Format("{0}", oRow["NoOfPayment"]);
            txtTotalAmortization.Text = string.Format("{0:N}", oRow["TotalAmortization"]);
            txtTotalInterest.Text = string.Format("{0:N}", oRow["TotalInterest"]);
            txtStatus.Text = string.Format("{0:N}", oRow["DocStatus"]);

            txtCreatedBy.Text = oRow["CreatedBy"].ToString();
            dtCreated.EditValue = Convert.ToDateTime(oRow["DateCreated"]);
            txtModifiedBy.Text = oRow["ModifiedBy"].ToString();
            dtModified.EditValue = Convert.ToDateTime(oRow["DateModified"]);

            this.LineScheduleOfPayment = oManager.GetLoanInfoLineItems(sDocNum);

            gridControl1.DataSource = this.LineScheduleOfPayment;
            gridControl1.Refresh();

            barSaveLoan.Caption = "Update";
            txtLoanNo.Enabled = false;

            BindCashReleased();
            BindCollections(txtLoanNo.Text);
            ComputeOutstandingBalance();
        }