Esempio n. 1
0
        private void CreateItem()
        {
            UnitsEditView v = new UnitsEditView();

            v._id = -1;
            v.ShowDialog();
        }
Esempio n. 2
0
        private void EditSelectedItem()
        {
            int  id = 0;
            unit b  = null;

            if (dgList.SelectedItem != null)
            {
                object sel = dgList.SelectedItem;
                b  = (unit)sel;
                id = b.id;
            }
            if (id > 0)
            {
                UnitsEditView v = new UnitsEditView();
                v._id           = b.id;
                v.edtName.Text  = b.name;
                v.edtDescr.Text = b.description;
                v.ShowDialog();
            }
            ReloadList();
        }
Esempio n. 3
0
 private void EditSelectedItem()
 {
     int id = 0;
     unit b = null;
     if (dgList.SelectedItem != null)
     {
         object sel = dgList.SelectedItem;
         b = (unit)sel;
         id = b.id;
     }
     if (id > 0)
     {
         UnitsEditView v = new UnitsEditView();
         v._id = b.id;
         v.edtName.Text = b.name;
         v.edtDescr.Text = b.description;
         v.ShowDialog();
     }
     ReloadList();
 }
Esempio n. 4
0
 private void CreateItem()
 {
     UnitsEditView v = new UnitsEditView();
     v._id = -1;
     v.ShowDialog();
 }