/// <summary> /// 保存成本计算表数据到XML文件 /// </summary> /// <param name="fileName"></param> /// <param name="sheet"></param> public void Save(string fileName,CostCalculationSheet sheet) { TextWriter tr = new StreamWriter(fileName); XmlSerializer xs = new XmlSerializer(typeof(CostCalculationSheet)); xs.Serialize(tr, sheet); tr.Close(); }
public StatisticOneSheet(CostCalculationSheet cs) { InitializeComponent(); FormOperate.SetFormToDialog(this, false); //初始化 this.cs = cs; ItemCategorysCount = new List<ItemCountUnit>(); ItemTypesCount = new List<ItemCountUnit>(); Total = 0; }
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); } }
private void f_New(object sender, CostCalculationSheetEventArgs e) { //初始化当前计算表 CurrentCalculateSheet = new CostCalculationSheet(e.CalcualteSheetFileName,e.Remark); //CreateTestData(); LoadCurrentCostSheetData(); }