Beispiel #1
0
        /// <summary>
        /// Create html page
        /// </summary>
        /// <param name="clientInfo">Information of client</param>
        /// <param name="pageName">Name of page</param>
        /// <param name="aspxContent">Content of aspx</param>
        /// <param name="code">Code</param>
        /// <param name="reportContent">Content of report</param>
        /// <param name="websitePath">Path of website</param>
        /// <returns>path of page</returns>
        public string CreateHtmlPage(ClientInfo clientInfo, string pageName, string aspxContent, string code, string reportContent, string websitePath)
        {
            if (clientInfo == null)
            {
                throw new ArgumentNullException("clientInfo");
            }
            if (string.IsNullOrEmpty(pageName))
            {
                throw new ArgumentNullException("pageName");
            }

            User.CheckUserLogoned(clientInfo);
            var timeStart = DateTime.Now;
            var provider = new EEPAdapter.SDModuleProvider();
            provider.ClientInfo = clientInfo;
            Log.SystemLogBegin(clientInfo, timeStart, "CreateHtmlPage");
            try
            {
                var path = EEPAdapter.SDModuleProvider.CreateHtmlPage(pageName, aspxContent, code, reportContent, clientInfo, websitePath);
                var timeEnd = DateTime.Now;
                Log.SystemLogEnd(clientInfo, timeStart, "CreateHtmlPage", timeEnd - timeStart);
                return path;
            }
            catch (Exception e)
            {
                var message = Log.SystemLogError(clientInfo, timeStart, "CreateHtmlPage", e);
                throw new Exception(message, e);
            }
        }
Beispiel #2
0
        /// <summary>
        /// Creates sd entity reference assembly
        /// </summary>
        /// <param name="clientInfo">Information of client</param>
        /// <param name="assemblyName">Name of assembly</param>
        /// <param name="commandName">Name of command</param>
        /// <param name="commmandText">Command Text</param>
        public Stream CreateSDEntityReferenceAssembly(ClientInfo clientInfo, string assemblyName, string commandName, string commmandText)
        {
            if (clientInfo == null)
            {
                throw new ArgumentNullException("clientInfo");
            }
            if (string.IsNullOrEmpty(assemblyName))
            {
                throw new ArgumentNullException("assemblyName");
            }

            User.CheckUserLogoned(clientInfo);
            var timeStart = DateTime.Now;
            var provider = new EEPAdapter.SDModuleProvider();
            provider.ClientInfo = clientInfo;
            Log.SystemLogBegin(clientInfo, timeStart, "CreateSDEntityReferenceAssembly");
            try
            {
                var dataSets = new List<DataSet>();
                if (assemblyName == "SYS_REFVAL")
                {
                    var dataSet = provider.GetSysRefVals();
                    for (int i = 0; i < dataSet.Tables[0].Rows.Count; i++)
                    {
                        var refvalID = (string)dataSet.Tables[0].Rows[i]["REFVAL_NO"];
                        var commandText = (string)dataSet.Tables[0].Rows[i]["SELECT_COMMAND"];
                        try
                        {
                            dataSets.Add(Database.ExecuteDataSet(clientInfo.Database, clientInfo.SDDeveloperID, commandText, refvalID));
                        }
                        catch { }
                    }
                }
                else
                {
                    if (!string.IsNullOrEmpty(commmandText))
                    {
                        dataSets.Add(Database.ExecuteDataSet(clientInfo.Database, clientInfo.SDDeveloperID, commmandText, commandName));
                    }
                    else
                    {
                        var commandNames = provider.GetCommandNames(assemblyName);
                        foreach (var command in commandNames)
                        {
                            try
                            {
                                dataSets.Add(provider.GetDataSet(assemblyName, command
                                    , new PacketInfo() { OnlySchema = true, OrderParameters = new List<OrderParameter>(), WhereParameters = new List<WhereParameter>() }));
                            }
                            catch { }
                        }
                    }
                }
                var stream = EEPAdapter.SDModuleProvider.CreateEntityReferenceAssembly(dataSets, assemblyName, clientInfo);
                var timeEnd = DateTime.Now;
                Log.SystemLogEnd(clientInfo, timeStart, "CreateSDEntityReferenceAssembly", timeEnd - timeStart);
                return stream;
            }
            catch (Exception e)
            {
                var message = Log.SystemLogError(clientInfo, timeStart, "CreateSDEntityReferenceAssembly", e);
                throw new Exception(message, e);
            }
        }
Beispiel #3
0
 private IModuleProvider GetModuleProvider(ClientInfo clientInfo)
 {
     IModuleProvider provider = null;
     if (clientInfo.UseDataSet)
     {
         if (clientInfo.IsSDModule)
         {
             provider = new EEPAdapter.SDModuleProvider();
         }
         else
         {
             provider = new EEPAdapter.DataModuleProvider();
         }
     }
     else
     {
         provider = new EntityModuleProvider();
     }
     provider.ClientInfo = clientInfo;
     return provider;
 }