private void btnAddTBLBuyorder_Click(object sender, EventArgs e)
 {
     try
     {
         TBLEznSarfEditorDlg frm = new TBLEznSarfEditorDlg(-1, true);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             XPSCSMain.FixedFilterString = "EznSarfId = " + frm._m_EznSarfId;
             XPSCSMain.Session.DropIdentityMap();
             XPSCSMain.Reload();
             gridViewMain.RefreshData();
             gridViewMain.FocusedRowHandle = 1;
             tBLEznSarfDetailsTableAdapter.FillByEznSarfId(dsData.TBLEznSarfDetails, frm._m_EznSarfId);
         }
     }
     catch (Exception ex)
     {
         MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex);
     }
 }
 private void btnEditTBLBuyorder_Click(object sender, EventArgs e)
 {
     try
     {
         XPDataTableObject row = (XPDataTableObject)gridViewMain.GetRow(gridViewMain.FocusedRowHandle);
         if (row == null)
         {
             return;
         }
         TBLEznSarfEditorDlg frm = new TBLEznSarfEditorDlg(Convert.ToInt32(row.GetMemberValue("EznSarfId")), false);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             XPSCSMain.Session.DropIdentityMap();
             XPSCSMain.Reload();
             gridViewMain.RefreshData();
         }
     }
     catch (Exception ex)
     {
         MsgDlg.Show(ex.Message, MsgDlg.MessageType.Error, ex);
     }
 }