/// <summary> /// 读取汇总分析文件 /// </summary> public void LoadMetaanalysis() { //默认加载四种汇总分析模板2012扣劳保与2012不扣劳保 this.m_Metaanalysis = new DataSet("汇总分析"); string fs0 = this.AppFolder + "模板文件\\汇总分析模板\\" + "2012汇总分析表【扣劳保】.hzfx"; string fs1 = this.AppFolder + "模板文件\\汇总分析模板\\" + "2012汇总分析表【不扣劳保】.hzfx"; string fs2 = this.AppFolder + "模板文件\\汇总分析模板\\" + "2009汇总分析表【扣劳保】.hzfx"; string fs3 = this.AppFolder + "模板文件\\汇总分析模板\\" + "2009汇总分析表【不扣劳保】.hzfx"; DataTable t0 = CFiles.Deserialize(fs0) as DataTable; DataTable t1 = CFiles.Deserialize(fs1) as DataTable; DataTable t2 = CFiles.Deserialize(fs2) as DataTable; DataTable t3 = CFiles.Deserialize(fs3) as DataTable; t0.TableName = "2012扣劳保"; t1.TableName = "2012不扣劳保"; t2.TableName = "2009扣劳保"; t3.TableName = "2009不扣劳保"; this.m_Metaanalysis.Tables.Add(t0); this.m_Metaanalysis.Tables.Add(t1); this.m_Metaanalysis.Tables.Add(t2); this.m_Metaanalysis.Tables.Add(t3); this.m_Metaanalysis.AcceptChanges(); //为模板添加自增长列 /*foreach (DataTable table in this.m_TempList.Tables) * { * table.Columns["ID"].AutoIncrement = true; * table.Columns["ID"].AutoIncrementSeed = 0; * table.Columns["ID"].AutoIncrementStep = 1; * } */ }
/// <summary> /// 读取模板数据 /// </summary> /// <param name="FilePath"></param> /// <returns></returns> public void Load(string FilePath) { DataTable dt = CFiles.Deserialize(FilePath) as DataTable; if (dt == null) { dt = (CFiles.Deserialize(FilePath) as DataSet).Tables[0]; } m_DataSource = dt; if (!this.m_DataSource.Columns.Contains("Check")) { this.m_DataSource.Columns.Add("Check", typeof(bool)); for (int i = 0; i < this.m_DataSource.Rows.Count; i++) { if (this.m_DataSource.Rows[i]["IsCheck"].ToString() == "1") { this.m_DataSource.Rows[i]["Check"] = true; } else { this.m_DataSource.Rows[i]["Check"] = false; } } } }
/// <summary> /// 提取报表 /// </summary> /// <returns></returns> private _List ExtractReport() { _Files files = new _Files(); files.ExtName = _Files.报表格式扩展名; files.DirName = string.Format("{0}库文件\\系统库", AppFolder.FullName); files.FileName = "报表格式"; try { FileInfo info = new FileInfo(files.FullName); if (info.Exists) { //文件存在的时候读取 this.m_BaseReport = new _List(); object ywj = CFiles.Deserialize(files.FullName); ArrayList dsd = ywj as ArrayList; if (dsd != null) { this.m_BaseReport.AddRange(dsd.ToArray()); if (this.m_BaseReport.Count <= 0) { this.m_BaseReport = null; } } } return(this.m_BaseReport); } catch (Exception ex) { this.m_BaseReport = null; return(this.m_BaseReport); } }
/// <summary> /// 获取或设置 /// </summary> public static _Configuration CreateInstance(string p_FileName, DirectoryInfo p_AppFolder) { _Configuration cfg = null; FileInfo info = new FileInfo(p_FileName); if (info.Exists) { //存对象文件 try { cfg = CFiles.Deserialize(p_FileName) as _Configuration; } catch (Exception ex) { cfg = new _Configuration(); } } else { cfg = new _Configuration(); cfg.AppFolder = p_AppFolder; } cfg.ConfigPath = p_FileName; return(cfg); }
/// <summary> /// 读取管理费利润表 /// </summary> public void LoadCostSelectList() { this.m_CostSelectList = new DataSet("管理费利润表"); string fs0 = this.AppFolder + "库文件\\系统库\\管理费利润表.qtsx"; this.m_CostSelectList = CFiles.Deserialize(fs0) as DataSet; this.m_CostSelectList.AcceptChanges(); }
/// <summary> /// 读取模板文件 /// </summary> /// <param name="p_FileName"></param> public void Load(string p_FileName) { //if (this.IsInit) { this.m_Source = CFiles.Deserialize(p_FileName) as DataTable; //this.Calculate(); this.m_Parent.BeginEdit(this); //this.m_IsInit = false; } }
/// <summary> ///从指定文件初始化数据集 /// </summary> public void Load(string Path) { if (this.m_Source != null) { object obj = CFiles.Deserialize(Path); this.m_Source = obj as DataTable; this.m_FilePath = Path; FileInfo info = new FileInfo(Path); this.m_FileName = info.Name.Replace(info.Extension, ""); } }
/// <summary> ///从指定文件初始化数据集 /// </summary> public void MeasuresProjectLoad(string Path) { if (this.MeasuresProject != null) { object obj = CFiles.Deserialize(Path); this.MeasuresProject = null; this.MeasuresProject = obj as _MeasuresProject; this.MeasuresProject.Parent = this.Parent as _UnitProject; this.MeasuresProject.InSerializable(this.Parent); } }
/// <summary> /// 加载配置文件 /// </summary> /// <param name="p_dir"></param> /// <returns></returns> public static _DataObjects Load(DirectoryInfo p_dir) { string str = string.Format("{0}config\\options.cfg", p_dir.FullName); object obj = CFiles.Deserialize(str); _DataObjects _data = obj as _DataObjects; _data.m_Path = str; /* _data.m_Columns = new _Columns();*/ //_data.m_GColor = new GlobalStyle(); return(_data); }
public DataTable LoadOtherProject(string GCDD) { switch (GCDD) { case "汉中": string fs0 = this.AppFolder + "模板文件\\其他项目\\" + "其他项目【汉中】.qtsx"; DataTable t0 = CFiles.Deserialize(fs0) as DataTable; //FilePath = fs0; return(t0); default: string fs1 = this.AppFolder + "模板文件\\其他项目\\" + "其他项目【通用】.qtsx"; DataTable t1 = CFiles.Deserialize(fs1) as DataTable; //FilePath = fs1; return(t1); } }
/// <summary> /// 若读取配置文件失败返回新的配置文件 /// </summary> /// <returns></returns> public static _HistoryCache CreateInstance(DirectoryInfo p_CacheFolder) { //若读取文件成功则直接返回否则返回空对象 try { string filename = p_CacheFolder.FullName + "\\" + _HistoryCache.FileName; _HistoryCache info = CFiles.Deserialize(filename) as _HistoryCache; if (info == null) { info = new _HistoryCache(); } info.SaveName = filename; return(info); } catch { _HistoryCache info = new _HistoryCache(); info.SaveName = p_CacheFolder.FullName + "\\" + _HistoryCache.FileName; return(info); } }