示例#1
0
 private void toolEdit_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         if (DBGrid.CurrentRow == null)
         {
             return;
         }
         modProductionForm  mod = (modProductionForm)DBGrid.CurrentRow.DataBoundItem;
         EditProductionForm frm = new EditProductionForm();
         frm.EditItem(mod.FormId, false);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             LoadData();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
 private void toolPrice_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         if (DBGrid.CurrentRow == null)
         {
             return;
         }
         modProductionForm mod = (modProductionForm)DBGrid.CurrentRow.DataBoundItem;
         if (mod.AccSeq > 0)
         {
             MessageBox.Show("该单据已做凭证,不可修改单价!", clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
             //return;
         }
         EditProductionForm frm = new EditProductionForm();
         frm.EditItem(mod.FormId, true);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             DBGrid.CurrentRow.Cells["PriceStatus"].Value = 1;
             DBGrid.CurrentRow.DefaultCellStyle.ForeColor = Color.DarkGray;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }
示例#3
0
 private void toolNew_Click(object sender, EventArgs e)
 {
     try
     {
         this.Cursor = Cursors.WaitCursor;
         EditProductionForm frm = new EditProductionForm();
         frm.AddItem(Util.retValue1);
         if (frm.ShowDialog() == DialogResult.OK)
         {
             rbStatus0.Checked = true;
             LoadData();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, clsTranslate.TranslateString("Information"), MessageBoxButtons.OK, MessageBoxIcon.Information);
         return;
     }
     finally
     {
         this.Cursor = Cursors.Default;
     }
 }