private async void mnuAdd_Click(object sender, EventArgs e) { try { var frm = new frmSanadMain(); if (frm.ShowDialog(this) == DialogResult.OK) { await LoadDataAsync(); } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private void mnuView_Click(object sender, EventArgs e) { try { if (DGrid.RowCount <= 0) { return; } if (DGrid.CurrentRow == null) { return; } var guid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; var frm = new frmSanadMain(guid, true); frm.ShowDialog(this); } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }
private async void mnuEdit_Click(object sender, EventArgs e) { try { if (DGrid.RowCount <= 0) { return; } if (DGrid.CurrentRow == null) { return; } var guid = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value; var sanad = await SanadBussines.GetAsync(guid); if (sanad.SanadStatus == EnSanadStatus.Permament) { frmNotification.PublicInfo.ShowMessage("شما مجاز به ویرایش سند دائمی نمی باشید "); return; } if (sanad.SanadType == EnSanadType.Auto) { frmNotification.PublicInfo.ShowMessage("شما مجاز به ویرایش سند اتومات نمی باشید "); return; } var frm = new frmSanadMain(guid, false); if (frm.ShowDialog(this) == DialogResult.OK) { await LoadDataAsync(txtSearch.Text); } } catch (Exception ex) { WebErrorLog.ErrorInstence.StartErrorLog(ex); } }