예제 #1
0
        private void ButOpen_Click(object sender, EventArgs e)
        {
            if (FileOpenClick != null)
            {
                FileOpenClick(this, EventArgs.Empty);
            }
            var wtf = new OpenFileDialog()
            {
                Filter = "Файлы заказа|*.txt"
            };
            var result = wtf.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                var mem = Kekus.LoadFromFile(wtf.FileName);
                SetModelToUI(mem);
                Setter(mem);
            }
        }
예제 #2
0
        private void ButSave_Click(object sender, EventArgs e)
        {
            if (FileSaveClick != null)
            {
                FileSaveClick(this, EventArgs.Empty);
            }
            var wtf = new SaveFileDialog()
            {
                Filter = "Файлы заказов|*.txt"
            };
            var result = wtf.ShowDialog(this);

            if (result == DialogResult.OK)
            {
                var mem = GetModelFromUI();
                Saver(mem);
                Kekus.WriteToFile(wtf.FileName, mem);
            }
        }