Пример #1
0
        internal static void Dispatcher_Create(fwk_ServiceDispatcher disp)
        {
            using(Fwk.ConfigData.FwkDatacontext dc = new Fwk.ConfigData.FwkDatacontext   ())
            {

                dc.fwk_ServiceDispatchers.InsertOnSubmit(disp);
                dc.SubmitChanges();
            }
        
        }
Пример #2
0
        internal static void Dispatcher_Update(fwk_ServiceDispatcher disp)
        {

            using (Fwk.ConfigData.FwkDatacontext dc = new Fwk.ConfigData.FwkDatacontext())
            {
                var disp_db = dc.fwk_ServiceDispatchers.Where(p => p.InstanseName.Equals(disp.InstanseId)).FirstOrDefault();

                disp_db.AuditMode = disp.AuditMode;
                disp_db.CompanyName = disp.CompanyName;
                disp_db.HostIp = disp.HostIp;
                disp_db.HostName = disp.HostName;
                disp_db.InstanseName = disp.InstanseName;
                disp_db.Logo = disp.Logo;
                disp_db.Port = disp.Port;
                disp_db.Url_URI = disp.Url_URI;

                dc.SubmitChanges();
            }
        }
Пример #3
0
        /// <summary>
        /// Permite volver a cargar la configuracion si es que en el inicio estatico no lo hiso correctamente
        /// </summary>
        internal static void ReloadConfig(out String stringMessage)
        {
            stringMessage = string.Empty;



            //ConnectionString donde proviene la configuracion del Service Dispatcher
            ConfigurationsHelper.ServiceDispatcherConnection = System.Configuration.ConfigurationManager.AppSettings["ServiceDispatcherConnection"];
            string serviceDispatcherName = System.Configuration.ConfigurationManager.AppSettings["ServiceDispatcherName"];

            if (!String.IsNullOrEmpty(ConfigurationsHelper.ServiceDispatcherConnection) || !String.IsNullOrEmpty(serviceDispatcherName))
            {
                #region Check cnn string if exist
                if (System.Configuration.ConfigurationManager.ConnectionStrings[ConfigurationsHelper.ServiceDispatcherConnection] == null)
                {
                    TechnicalException te = new TechnicalException(string.Concat("No se puede encontrar la cadena de conexión : ", ConfigurationsHelper.ServiceDispatcherConnection));
                    ExceptionHelper.SetTechnicalException<DatabaseConfigManager>(te);
                    te.ErrorId = "8200";
                    stringMessage = Audit.LogDispatcherErrorConfig(te).Message;
                    DefaultSettings = true;
                }
                #endregion

                if (DefaultSettings == false)
                {
                    #region Try coinnect tod serivice dispatcher database
                    try
                    {
                        using (FwkDatacontext context = new FwkDatacontext(System.Configuration.ConfigurationManager.ConnectionStrings[ConfigurationsHelper.ServiceDispatcherConnection].ConnectionString))
                        {
                            ServiceDispatcherConfig = context.fwk_ServiceDispatchers.Where(s => s.InstanseName.Equals(serviceDispatcherName.Trim())).FirstOrDefault();

                            if (ServiceDispatcherConfig == null)
                            {
                                TechnicalException te = new TechnicalException(string.Concat("No se puede encontrar la configuracion del despachador de servicio en la base de datos\r\nCadena de conexión : ", ConfigurationsHelper.ServiceDispatcherConnection));
                                ExceptionHelper.SetTechnicalException<DatabaseConfigManager>(te);
                                te.ErrorId = "7009";
                                stringMessage = Audit.LogDispatcherErrorConfig(te).Message;
                            }
                        }

                        ConfigurationsHelper.HostApplicationName = ServiceDispatcherConfig.InstanseName;
                    }
                    catch (Exception ex)
                    {

                        DefaultSettings = true;
                        stringMessage = Audit.LogDispatcherErrorConfig(ex).Message;
                    }
                    #endregion
                }

            }
            else
            { DefaultSettings = true; }

            if (DefaultSettings)
            {
                ServiceDispatcherConfig = new fwk_ServiceDispatcher();
                ServiceDispatcherConfig.AuditMode = (int)AuditMode.None;
                ServiceDispatcherConfig.HostIp = "127.0.0.1";
                ServiceDispatcherConfig.InstanseName = "Fwk Dispatcher (default name)";
                stringMessage = Audit.LogDispatcherErrorConfig(null).Message;
            }


        }
Пример #4
0
 partial void Deletefwk_ServiceDispatcher(fwk_ServiceDispatcher instance);
Пример #5
0
 partial void Updatefwk_ServiceDispatcher(fwk_ServiceDispatcher instance);
Пример #6
0
 partial void Insertfwk_ServiceDispatcher(fwk_ServiceDispatcher instance);
Пример #7
0
 partial void Deletefwk_ServiceDispatcher(fwk_ServiceDispatcher instance);
Пример #8
0
 partial void Updatefwk_ServiceDispatcher(fwk_ServiceDispatcher instance);
Пример #9
0
 partial void Insertfwk_ServiceDispatcher(fwk_ServiceDispatcher instance);