/// <summary> /// 保存当前的计算表 /// </summary> private void SaveCurrentCostSheet() { if (!IsSaved) { try { XMLDocOp doc = new XMLDocOp(); string fileName = Path.Combine(Environment.CurrentDirectory, Properties.Settings.Default.WorkingDirectory, CurrentCalculateSheet.SheetName + ".xml"); doc.Save(fileName, CurrentCalculateSheet); MessageBox.Show("Save Successfully!","Information",MessageBoxButtons.OK,MessageBoxIcon.Information); SetCurrentCalculateSheetSaved(); } catch (Exception ex) { MessageBox.Show(ex.Message); } } }
private void f_OpenDoc(object sender, CostCalculationSheetEventArgs e) { try { XMLDocOp doc = new XMLDocOp(); string fileName = e.CalcualteSheetFileName; CurrentCalculateSheet = doc.Read(fileName); LoadCurrentCostSheetData(); //设置为已经保存 SetCurrentCalculateSheetSaved(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }