示例#1
0
 private void изменитьToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (dataGridView1.CurrentRow.Tag != null)
     {
         var id = Convert.ToInt32(dataGridView1.CurrentRow.Tag);
         using (UserContext db = new UserContext(Settings.constr))
         {
             var item = db.CalculationItems.FirstOrDefault(x => x.ID == id);
             CalculationItemForm f = new CalculationItemForm(this, 2, item);
             f.ShowDialog();
         }
     }
 }
示例#2
0
        private void добавитьToolStripMenuItem_Click(object sender, EventArgs e)
        {
            CalculationItemForm f = new CalculationItemForm(this, 1, null);

            f.ShowDialog();
        }