public string GetFileSuffix(E_DataFile_Type type) { switch (type) { case E_DataFile_Type.xls: return("xls"); case E_DataFile_Type.binary: return("byte"); default: return("byte"); } }
public bool Save(string name, string folder, E_DataFile_Type type) { if (!string.IsNullOrEmpty(folder)) { folder = folder.Replace(@"\", @"/"); } if (folder != null) { return(SaveAs(name, folder + name + "." + TDFactory.Instance.GetFileSuffix(type))); } else { return(false); } }
//file name is table name. public bool Save(string name, E_DataFile_Type type) { //get path and change the suffix. string path = null; m_FileMap.TryGetValue(name, out path); if (path != null) { string[] sArr2 = path.Split(new char[] { '.' }); path = sArr2[0] + "." + TDFactory.Instance.GetFileSuffix(type); return(SaveAs(name, path)); } else { return(false); } }