コード例 #1
0
 private void mnuAddCheckSh_Click(object sender, EventArgs e)
 {
     try
     {
         var frm = new frmPardakhtCheckSh(null);
         if (frm.ShowDialog(this) != DialogResult.OK)
         {
             return;
         }
         AddToGrid(frm.cls);
         FetchData();
         SetLables();
     }
     catch (Exception ex)
     {
         WebErrorLog.ErrorInstence.StartErrorLog(ex);
     }
 }
コード例 #2
0
        private void mnuEdit_Click(object sender, EventArgs e)
        {
            try
            {
                if (DGrid.RowCount == 0 || DGrid.CurrentRow == null)
                {
                    return;
                }

                if (DGrid[DGType.Index, DGrid.CurrentRow.Index].Value.ToString() == "نقد")
                {
                    var str = (PardakhtNaqdBussines)GetRowInfo(DGrid.CurrentRow.Index);
                    var frm = new frmPardakhtNaqd(str);
                    if (frm.ShowDialog(this) != DialogResult.OK)
                    {
                        return;
                    }
                    DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index);
                    AddToGrid(frm.cls);
                }
                else if (DGrid[DGType.Index, DGrid.CurrentRow.Index].Value.ToString() == "چک دریافتی")
                {
                    var str = (PardakhtCheckMoshtariBussines)GetRowInfo(DGrid.CurrentRow.Index);
                    var frm = new frmPardakhtCheckM(str);
                    if (frm.ShowDialog(this) != DialogResult.OK)
                    {
                        return;
                    }
                    DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index);
                    AddToGrid(frm.cls);
                }
                else if (DGrid[DGType.Index, DGrid.CurrentRow.Index].Value.ToString() == "حواله")
                {
                    var str = (PardakhtHavaleBussines)GetRowInfo(DGrid.CurrentRow.Index);
                    var frm = new frmPardakhtHavale(str);
                    if (frm.ShowDialog(this) != DialogResult.OK)
                    {
                        return;
                    }
                    DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index);
                    AddToGrid(frm.cls);
                }
                else if (DGrid[DGType.Index, DGrid.CurrentRow.Index].Value.ToString() == "چک شخصی")
                {
                    var str = (PardakhtCheckShakhsiBussines)GetRowInfo(DGrid.CurrentRow.Index);
                    var frm = new frmPardakhtCheckSh(str);
                    if (frm.ShowDialog(this) != DialogResult.OK)
                    {
                        return;
                    }
                    DGrid.Rows.RemoveAt(DGrid.CurrentRow.Index);
                    AddToGrid(frm.cls);
                }
                FetchData();
                SetLables();
            }
            catch (Exception ex)
            {
                WebErrorLog.ErrorInstence.StartErrorLog(ex);
            }
        }