Exemplo n.º 1
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 = (ReceptionNaqdBussines)GetRowInfo(DGrid.CurrentRow.Index);
                    var frm = new frmReceptionNaqd(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 = (ReceptionCheckBussines)GetRowInfo(DGrid.CurrentRow.Index);
                    var frm = new frmReceptionCheck(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 = (ReceptionHavaleBussines)GetRowInfo(DGrid.CurrentRow.Index);
                    var frm = new frmReceptionHavale(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);
            }
        }
Exemplo n.º 2
0
 private void mnuAddNaqd_Click(object sender, System.EventArgs e)
 {
     try
     {
         var frm = new frmReceptionNaqd(null);
         if (frm.ShowDialog(this) != DialogResult.OK)
         {
             return;
         }
         AddToGrid(frm.cls);
         FetchData();
         SetLables();
     }
     catch (Exception ex)
     {
         WebErrorLog.ErrorInstence.StartErrorLog(ex);
     }
 }