public static String CreateFile(ObjectExporter pEntity) { string _filePath = String.Format("{0}\\{1}_{2}.dlbas", pEntity.FullPath, pEntity.Entity, pEntity.index); System.IO.File.WriteAllText(_filePath, pEntity.JsonSerializable, Encoding.UTF8); if (pEntity.Encrypt) { string _fileEnrypt = String.Format("{0}\\{1}_{2}_e.dlabs", pEntity.CompletePath, pEntity.Entity, pEntity.index); new Common().EncryptFile(_filePath, _fileEnrypt, pEntity.KeyWord); System.IO.File.Delete(_filePath); } return(_filePath); }
public EntityCollection GetData(ObjectExporter pExport) { EntityCollection _entityCollection; if (string.IsNullOrEmpty(pExport.Fetch)) { QueryExpression _query = new QueryExpression(pExport.Entity); _entityCollection = pExport.ServiceClient.RetrieveMultiple(_query); } else { FetchXmlToQueryExpressionRequest _fetchXmlToQueryExpression = new FetchXmlToQueryExpressionRequest() { FetchXml = pExport.Fetch }; FetchXmlToQueryExpressionResponse _fetchXmlToQueryExpressionResponse = (FetchXmlToQueryExpressionResponse)pExport.ServiceClient.Execute(_fetchXmlToQueryExpression); _entityCollection = pExport.ServiceClient.RetrieveMultiple(_fetchXmlToQueryExpressionResponse.Query); } return(_entityCollection); }
public Export(ObjectExporter pExport) { _export = pExport; }
public static void Decompress(ObjectExporter pEntity) { GZipStream instream = new GZipStream(File.OpenRead(pEntity.FullPath), CompressionMode.Decompress); }