Exemple #1
0
        private void Btn_Add_Click(object sender, EventArgs e)
        {
            var FRMA = new FrmLoanMonthlyData();
            var P    = ProjectFunctions.GetPositionInForm(this);

            FRMA.Location = new Point(P.X + (ClientSize.Width / 2 - FRMA.Size.Width / 2), P.Y + (ClientSize.Height / 2 - FRMA.Size.Height / 2));
            FRMA.Text     = "Loan Monthly Addition";
            FRMA.ShowDialog();
            FillGrid();
        }
Exemple #2
0
        private void Btn_Edit_Click(object sender, EventArgs e)
        {
            var Dr = LoanGridView.GetFocusedDataRow();

            if (btn_Edit.Enabled)
            {
                if (LoanGridView.DataSource != null)
                {
                    if (LoanGridView.RowCount > 0)
                    {
                        using (var FMRU = new FrmLoanMonthlyData()
                        {
                            IsUpdate = true, LoanId = Dr["TransID"].ToString()
                        })
                        {
                            var P = ProjectFunctions.GetPositionInForm(this);
                            FMRU.Location = new Point(P.X + (ClientSize.Width / 2 - FMRU.Size.Width / 2), P.Y + (ClientSize.Height / 2 - FMRU.Size.Height / 2));
                            FMRU.Text     = "Loan Monthly Editing";

                            FMRU.ShowDialog();
                            FillGrid();
                        }
                    }
                    else
                    {
                        XtraMessageBox.Show("No Records to Edit", "!Error");
                    }
                }
                else
                {
                    XtraMessageBox.Show("No Datasource, Or Unable to fetch Data.", "!Error");
                }
            }
            else
            {
                XtraMessageBox.Show("You have No permission.", "!Error");
            }
        }