private void SetModel(string fileName) { var ofd = new OpenFileDialog() { FileName = fileName }; var dto = DeliverySerializer.LoadFromFile(ofd.FileName); SetModelToUI(dto); }
private void Open_Click(object sender, EventArgs e) { var ofd = new OpenFileDialog() { }; var result = ofd.ShowDialog(this); if (result == DialogResult.OK) { var dto = DeliverySerializer.LoadFromFile(ofd.FileName); SetModelToUI(dto); } }
private void экспортЗаказаВWordToolStripMenuItem_Click(object sender, EventArgs e) { if (OrderControl.SelectedIndex == 0) { if (listBox1.SelectedIndex != -1) { var dto = DeliverySerializer.LoadFromFile(PathReturnFromListBox1()); CheckExistFile(DeliverySerializer.newPath, listbox1Id[listBox1.SelectedIndex]); WordExportOrders.WordExport(dto); } } else if (listBox2.SelectedIndex != -1) { var dto = DeliverySerializer.LoadFromFile(PathReturnFromListBox2()); CheckExistFile(DeliverySerializer.newPath, listbox1Id[listBox1.SelectedIndex]); WordExportOrders.WordExport(dto); } }