private void btn_Export_Click(object sender, EventArgs e) { saveFileDialog.Filter = "xml文件|*.xml"; saveFileDialog.ShowDialog(); string fileName = saveFileDialog.FileName; if (fileName.Length == 0) { return; } orderService.Export(saveFileDialog.FileName); }
private void button1_Click(object sender, EventArgs e) { if (form1.CheckPhoneNum()) { foreach (var o in orderService.orders) { o.OrdMon = 0; foreach (var od in o.orderDetails) { o.OrdMon += od.GoodsPrice * od.GoodsNum; } } orderService.Export(@"..\..\s.xml"); orderService = OrderService.Import(@"..\..\s.xml"); form1.ReFresh(); MessageBox.Show("修改成功"); this.Close(); } }