private void GetEventLog(string text) { string[] vs = text.Split(' '); try { using (kipEntities context = new kipEntities()) { var type = vs[0]; var number = vs[1]; Equipment eq = context.EquipmentSet.Where(b => b.EquipmentType.name == type && b.number == number).Single(); Form form = new ServiceLogForm(eq.Id); form.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
internal static void ShowEditForm(ListBox list, DataGridView view) { try { Form form; var str = list.SelectedItem.ToString(); switch (str) { case "Оборудование": form = new EquipmentForm(view); form.ShowDialog(); break; case "Типы оборудования": form = new EquipmentTypeForm(view); form.ShowDialog(); break; case "Производители": form = new ManufacturerForm(view); form.ShowDialog(); break; case "Типы систем": form = new SystemTypeForm(view); form.ShowDialog(); break; case "Роли МВПС": form = new MVPSRoleForm(view); form.ShowDialog(); break; case "Типы МВПС": form = new MVPSTypeForm(view); form.ShowDialog(); break; case "МВПС": form = new MVPSForm(view); form.ShowDialog(); break; case "Правила компелктования": form = new EquipmentRuleForm(view); form.ShowDialog(); break; case "Работники": form = new WorkerForm(view); form.ShowDialog(); break; case "График ТО и ТР": form = new SheduleForm(view); form.ShowDialog(); break; case "Замены оборудования": //form = new ReplacingLogForm(view); //form.ShowDialog(); break; case "Журнал проверки/ремонта": form = new ServiceLogForm(view); form.ShowDialog(); break; default: break; } FillGrid(listBox, gridView); } catch (Exception ex) { MessageBox.Show(ex.Message); } }