Пример #1
0
        private void CreateItem()
        {
            ClientsEditView v = new ClientsEditView();

            v._id = -1;
            v.ShowDialog();
        }
Пример #2
0
        private void EditSelectedItem()
        {
            int    id = 0;
            client b  = null;

            if (dgList.SelectedItem != null)
            {
                object sel = dgList.SelectedItem;
                b  = (client)sel;
                id = b.id;
            }
            if (id > 0)
            {
                ClientsEditView v = new ClientsEditView();
                v._id = b.id;

                v.cbCar.SelectedItem   = b.car_mark.name;
                v.cbProds.SelectedItem = b.car_mark.car_producer.name;
                v.edtName.Text         = b.name;
                v.edtDescr.Text        = b.description;
                v.ShowDialog();
                ReloadList();
            }
        }
Пример #3
0
        private void EditSelectedItem()
        {
            int id = 0;
            client b = null;
            if (dgList.SelectedItem != null)
            {
                object sel = dgList.SelectedItem;
                b = (client)sel;
                id = b.id;
            }
            if (id > 0)
            {
                ClientsEditView v = new ClientsEditView();
                v._id = b.id;

                v.cbCar.SelectedItem = b.car_mark.name;
                v.cbProds.SelectedItem = b.car_mark.car_producer.name;
                v.edtName.Text = b.name;
                v.edtDescr.Text = b.description;
                v.ShowDialog();
                ReloadList();
            }
        }
Пример #4
0
 private void CreateItem()
 {
     ClientsEditView v = new ClientsEditView();
     v._id = -1;
     v.ShowDialog();
 }