예제 #1
0
 private void BtnEdit_Click(object sender, EventArgs e)
 {
     if (btnEdit.Enabled)
     {
         try
         {
             var row = ReplGridView.GetDataRow(ReplGridView.FocusedRowHandle);
             var ds  = ProjectFunctions.GetDataSet(string.Format("select * from ExMst Where ExId='" + row["ExId"].ToString() + "'"));
             if (ds.Tables[0].Rows[0]["ExLoadTag"].ToString() == string.Empty)
             {
                 var frm = new Forms_Transaction.FrmAdvanceAddEdit()
                 {
                     S1 = btnEdit.Text
                 };
                 var P = ProjectFunctions.GetPositionInForm(this);
                 frm.Location = new Point(P.X + (ClientSize.Width / 2 - frm.Size.Width / 2), P.Y + (ClientSize.Height / 2 - frm.Size.Height / 2));
                 frm.Text     = "Time Office Payment Editing";
                 frm.ExId     = row["ExId"].ToString();
                 frm.ShowDialog();
             }
             else
             {
                 XtraMessageBox.Show("Entry Has been Loaded");
             }
             FillGrid();
         }
         catch (Exception ex)
         {
             MessageBox.Show(ex.Message);
         }
     }
 }
예제 #2
0
        private void BtnAdd_Click(object sender, EventArgs e)
        {
            if (btnAdd.Enabled)
            {
                try
                {
                    var frm = new Forms_Transaction.FrmAdvanceAddEdit()
                    {
                        S1 = btnAdd.Text
                    };
                    var P = ProjectFunctions.GetPositionInForm(this);
                    frm.Location = new Point(P.X + (ClientSize.Width / 2 - frm.Size.Width / 2), P.Y + (ClientSize.Height / 2 - frm.Size.Height / 2));
                    frm.Text     = "Time Office Payment Addition";

                    frm.ShowDialog();
                    FillGrid();
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.Message);
                }
            }
        }