Exemplo n.º 1
0
 private async void mnuAdd_Click(object sender, EventArgs e)
 {
     try
     {
         var frm = new frmTafsilMain(HesabType.Hazine);
         if (frm.ShowDialog(this) == DialogResult.OK)
         {
             await LoadDataAsync();
         }
     }
     catch (Exception ex)
     {
         WebErrorLog.ErrorInstence.StartErrorLog(ex);
     }
 }
Exemplo n.º 2
0
 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 frmTafsilMain(guid, true);
         frm.ShowDialog(this);
     }
     catch (Exception ex)
     {
         WebErrorLog.ErrorInstence.StartErrorLog(ex);
     }
 }
Exemplo n.º 3
0
        private async void mnuViewPardazande_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGrid.RowCount <= 0 || DGrid.CurrentRow == null)
                {
                    return;
                }
                var guid = (Guid)DGrid[DgPardazandeGuid.Index, DGrid.CurrentRow.Index].Value;

                var tafsil = await TafsilBussines.GetAsync(guid);

                if (tafsil == null)
                {
                    return;
                }

                if (tafsil.HesabType == HesabType.Bank)
                {
                    var frm = new frmBankMain(guid, true);
                    frm.ShowDialog(this);
                    return;
                }

                if (tafsil.HesabType == HesabType.Customer)
                {
                    var frm = new frmPeoples(guid, true);
                    frm.ShowDialog(this);
                    return;
                }

                var _frm = new frmTafsilMain(guid, true);
                _frm.ShowDialog(this);
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }
Exemplo n.º 4
0
        private async void mnuEdit_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGrid.RowCount <= 0)
                {
                    return;
                }
                if (DGrid.CurrentRow == null)
                {
                    return;
                }
                if (!_st)
                {
                    frmNotification.PublicInfo.ShowMessage(
                        "شما مجاز به ویرایش داده حذف شده نمی باشید \r\n برای این منظور، ابتدا فیلد موردنظر را از حالت حذف شده به فعال، تغییر وضعیت دهید");
                    return;
                }
                var guid   = (Guid)DGrid[dgGuid.Index, DGrid.CurrentRow.Index].Value;
                var tafsil = await TafsilBussines.GetAsync(guid);

                if (tafsil == null)
                {
                    frmNotification.PublicInfo.ShowMessage("حساب انتخاب شده معتبر نمی باشد");
                    return;
                }

                var frm = new frmTafsilMain(guid, false, HesabType.Hazine);
                if (frm.ShowDialog(this) == DialogResult.OK)
                {
                    await LoadDataAsync(txtSearch.Text);
                }
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }