示例#1
0
        /// <summary>
        ///
        /// </summary>
        public void Start()
        {
            OnSussess("Iniciando llamada a web metodos ");
            double interval_SendContent = 0;
            double interval_CheckResult = 0;

            try
            {
                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_SendContent") != null)
                {
                    interval_SendContent = Convert.ToDouble(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_SendContent")) * 1000;
                }
                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_CheckResult") != null)
                {
                    interval_CheckResult = Convert.ToDouble(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_CheckResult")) * 1000;
                }
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Error al leer configuración Engine.ClockInterval", ex);
                te.ErrorId = "1";
                throw te;
            }
            _SendContentTimer          = new Timer(interval_SendContent);
            _SendContentTimer.Elapsed += new ElapsedEventHandler(_SendContentTimer_Elapsed);
            _SendContentTimer.Start();

            _CheckResultTimer          = new Timer(interval_CheckResult);
            _CheckResultTimer.Elapsed += new ElapsedEventHandler(_CheckResultTimer_Elapsed);
            _CheckResultTimer.Start();
        }
示例#2
0
        /// <summary>
        /// Inicializa:
        ///     IAuthorizationProvider cargandole las reglas por medio de un servicio.-
        ///     IndentityUserInfo (servicio)
        ///     Genera el Principal (local) <see>GetGenericPrincipal</see>
        /// </summary>
        /// <param name="msgError">Mensage de error en caso de que se produzca alguno</param>
        public static void InitAuthorizationFactory(out string pMsgError)
        {
            pMsgError = string.Empty;
            // Inicializo Fwk Authorization provider y catching security provider
            // ASP.NET Membership y Profile providers no se inicializan de esta manera.
            try
            {
                if (FormBase.RuleProvider == null)
                {
                    FwkAuthorizationRuleList wFwkAuthorizationRuleList = SecurityServiceCalls.SearchAllRules();
                    FormBase.RuleProvider = new FwkAuthorizationRuleProvider(wFwkAuthorizationRuleList);
                }
                FormBase.IdentityName = FormBase.IndentityUserInfo.UserName;

                if (FormBase.Principal == null)
                {
                    GenericIdentity genericIdentity = new GenericIdentity(FormBase.IdentityName, "Database");
                    FormBase.Principal = new GenericPrincipal(genericIdentity, FormBase.IndentityUserInfo.Roles);
                }

                #region Este codigo se usaba cuando la aplicacion obtenia RuleProvider e IndentityUserInfo de manera local y sin servicios de fwk
                //if (FRM_FormBase.RuleProvider == null)
                //    FRM_FormBase.RuleProvider = AuthorizationFactory.GetAuthorizationProvider("RuleProvider_Fwk");
                //if (FRM_FormBase.IndentityUserInfo == null)
                //    FRM_FormBase.IndentityUserInfo = GetUserInfo(FRM_FormBase.IdentityName);
                #endregion
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException wTechEx = new Fwk.Exceptions.TechnicalException("No se configuró correctamente el proveedor de autorización", ex);

                wTechEx.UserName = FormBase.IdentityName;
                throw wTechEx;
            }
        }
示例#3
0
        /// <summary>
        /// 
        /// </summary>
        public void Start()
        {
            OnSussess("Iniciando llamada a web metodos ");
            double interval_SendContent = 0;
            double interval_CheckResult = 0;
            try
            {
                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_SendContent") != null)
                    interval_SendContent = Convert.ToDouble(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_SendContent")) * 1000;
                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_CheckResult") != null)
                   interval_CheckResult = Convert.ToDouble(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_CheckResult")) * 1000;
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Error al leer configuración Engine.ClockInterval", ex);
                te.ErrorId = "1";
                throw te;

            }
            _SendContentTimer = new Timer(interval_SendContent);
            _SendContentTimer.Elapsed += new ElapsedEventHandler(_SendContentTimer_Elapsed);
            _SendContentTimer.Start();

            _CheckResultTimer = new Timer(interval_CheckResult);
            _CheckResultTimer.Elapsed += new ElapsedEventHandler(_CheckResultTimer_Elapsed);
            _CheckResultTimer.Start();

        }
示例#4
0
 /// <summary>
 /// Establece los valores basicos de error producido en el componente ADHelper
 /// </summary>
 /// <param name="te"></param>
 public static void SetTechnicalException(Fwk.Exceptions.TechnicalException te, Type T)
 {
     te.Namespace = T.Namespace;
     te.Assembly  = T.Assembly.FullName;
     te.Class     = T.GetType().Name;
     te.UserName  = Environment.UserName;
     te.Machine   = Environment.MachineName;
     te.Source    = ConfigurationsHelper.HostApplicationName;
 }
示例#5
0
        ///// <summary>
        ///// Busca la lista de dominios en una base de datos
        ///// </summary>
        ///// <param name="cnnStringName">Nombre de la cadena de coneccion configurada</param>
        ///// <returns>Lista de DomainsUrl</returns>
        //public static List<DomainUrlInfo> DomainsUrl_GetList(string cnnString)
        //{
        //    return DomainsUrl_GetList2(System.Configuration.ConfigurationManager.ConnectionStrings[cnnStringName].ConnectionString);
        //}
        ///// <summary>
        ///// Busca la lista de dominios en una base de datos.- A diferencia de DomainsUrl_GetList. Este metodo recive como parametro
        ///// la cadena de coneccion y no su nombre de App.config
        ///// </summary>
        ///// <param name="cnnString">Cadena de coneccion</param>
        ///// <returns>Lista de DomainsUrl</returns>
        //public static List<DomainUrlInfo> DomainsUrl_GetList2(string cnnString)
        //{

        //    List<DomainUrlInfo> wDomainUrlInfoList = new List<DomainUrlInfo>();
        //    try
        //    {
        //        using (SqlDomainURLDataContext dc = new SqlDomainURLDataContext(cnnString))
        //        {
        //            IEnumerable<DomainUrlInfo> liste = from s in dc.DomainsUrls
        //                                        select new DomainUrlInfo
        //                                            {
        //                                                DomainName = s.DomainName,
        //                                                LDAPPath = s.LDAPPath,
        //                                                Id = s.DomainID,
        //                                                SiteName = s.SiteName,
        //                                                DomainDN = s.DomainDN
        //                                            };

        //            return liste.ToList<DomainUrlInfo>();
        //        }
        //    }
        //    catch (Exception ex)
        //    {
        //        Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Error al intentar obtener la lista de dominios desde la base de datos: ", ex);
        //        LDAPHelper.SetError(te);
        //        te.ErrorId = "15004";
        //        throw te;
        //    }
        //}


        /// <summary>
        /// Retorna todos los DolmainUrl por medio de un sp usp_GetDomainsUrl_All que lee de bd encriptada
        /// </summary>
        /// <param name="cnnString">Nombre de la cadena de cnn</param>
        /// <returns></returns>
        public static List <DomainUrlInfo> DomainsUrl_Get_FromSp_all(string cnnString)
        {
            string wApplicationId = string.Empty;


            DomainUrlInfo        wDomainUrlInfo = null;
            List <DomainUrlInfo> list           = new List <DomainUrlInfo>();

            try
            {
                var connectionString = CommonHelpers.GetCnn(cnnString).ConnectionString;
                using (SqlConnection cnn = new SqlConnection(connectionString))
                    using (SqlCommand cmd = new SqlCommand("dbo.usp_GetDomainsUrl_All", cnn))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cnn.Open();


                        using (IDataReader dr = cmd.ExecuteReader())
                        {
                            while (dr.Read())
                            {
                                wDomainUrlInfo            = new DomainUrlInfo();
                                wDomainUrlInfo.DomainDN   = dr["DomainDN"].ToString();
                                wDomainUrlInfo.DomainName = dr["DomainName"].ToString();

                                wDomainUrlInfo.LDAPPath = dr["LDAPPath"].ToString();

                                wDomainUrlInfo.Pwd      = dr["Pwd"].ToString();
                                wDomainUrlInfo.SiteName = dr["SiteName"].ToString();
                                wDomainUrlInfo.Usr      = dr["Usr"].ToString();
                                list.Add(wDomainUrlInfo);
                            }
                        }

                        return(list);
                    }
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Error al intentar obtener los datos del dominio desde la base de datos: ", ex);

                te.ErrorId = "15004";
                throw te;
            }
        }
示例#6
0
        public string SendASK(string setId)
        {
            String result = string.Empty;

            try
            {
                result = KeepconSvc.SendASK(setId);
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException(String.Format("CheckResult : SendASK lote {0} fallo", setId), ex);
                te.ErrorId = "1";
                throw te;//Helper.Log(Helper.ServiceName, te, false);
            }
            if (result.Equals("OK"))
            {
                KeepconSvc.SaveResult_ACK(setId);
            }

            return(result);
        }
示例#7
0
        /// <summary>
        ///
        /// </summary>
        public void Start_CheckResult()
        {
            OnSussess("CheckResult: Start_CheckResult  ");
            double interval = 0;

            try
            {
                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_CheckResult") != null)
                {
                    interval = Convert.ToDouble(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_CheckResult")) * 1000;
                }
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("CheckResult : Error al leer configuración Engine.ClockInterval_CheckResult", ex);
                te.ErrorId = "1";
                Helper.Log(Helper.ServiceName, te, true);
                throw te;
            }

            _CheckResultTimer          = new Timer(interval);
            _CheckResultTimer.Elapsed += new ElapsedEventHandler(_CheckResultTimer_Elapsed);
            _CheckResultTimer.Start();
        }
示例#8
0
        /// <summary>
        ///
        /// </summary>
        public void Start_SendContent()
        {
            OnSussess("Start_SendContent");
            Helper.Log(Helper.ServiceName, "SendContent: Iniciando envia de post a keepcont", Fwk.Logging.EventType.Information, false);
            double interval = 0;

            try
            {
                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_SendContent") != null)
                {
                    interval = Convert.ToDouble(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_SendContent")) * 1000;
                }
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("SendContent: Error al leer configuración Engine.ClockInterval_SendContent", ex);
                te.ErrorId = "1";
                Helper.Log(Helper.ServiceName, te, true);
                throw te;
            }
            _SendContentTimer          = new Timer(interval);
            _SendContentTimer.Elapsed += new ElapsedEventHandler(_SendContentTimer_Elapsed);
            _SendContentTimer.Start();
        }
示例#9
0
        /// <summary>
        /// Inicializa: 
        ///     IAuthorizationProvider cargandole las reglas por medio de un servicio.-
        ///     IndentityUserInfo (servicio)
        ///     Genera el Principal (local) <see>GetGenericPrincipal</see>
        /// </summary>
        /// <param name="msgError">Mensage de error en caso de que se produzca alguno</param>
        public static void InitAuthorizationFactory(out string pMsgError)
        {
            pMsgError = string.Empty;
            // Inicializo Fwk Authorization provider y catching security provider
            // ASP.NET Membership y Profile providers no se inicializan de esta manera.
            try
            {
                if (FormBase.RuleProvider == null)
                {

                    FwkAuthorizationRuleList wFwkAuthorizationRuleList =SecurityServiceCalls.SearchAllRules();
                    FormBase.RuleProvider = new FwkAuthorizationRuleProvider(wFwkAuthorizationRuleList);
                }
                FormBase.IdentityName = FormBase.IndentityUserInfo.UserName;

                if (FormBase.Principal == null)
                {
                    GenericIdentity genericIdentity = new GenericIdentity(FormBase.IdentityName, "Database");
                    FormBase.Principal = new GenericPrincipal(genericIdentity, FormBase.IndentityUserInfo.Roles);
                }

                #region Este codigo se usaba cuando la aplicacion obtenia RuleProvider e IndentityUserInfo de manera local y sin servicios de fwk
                //if (FRM_FormBase.RuleProvider == null)
                //    FRM_FormBase.RuleProvider = AuthorizationFactory.GetAuthorizationProvider("RuleProvider_Fwk");
                //if (FRM_FormBase.IndentityUserInfo == null)
                //    FRM_FormBase.IndentityUserInfo = GetUserInfo(FRM_FormBase.IdentityName);
                #endregion

            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException wTechEx = new Fwk.Exceptions.TechnicalException("No se configuró correctamente el proveedor de autorización", ex);

                wTechEx.UserName = FormBase.IdentityName;
                throw wTechEx;
            }
        }
示例#10
0
        public static PortalErrorInfo CreateNew(String message)
        {
            Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException(message);

            return(new PortalErrorInfo(te, Helper.Controller(), Helper.Action()));
        }
示例#11
0
        static KeepconSvc()
        {
            bool result = true;

            //user = "******";
            //password = "******";

            try
            {
                if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_user")))
                {
                    throw new Exception("La propiedad Engine.kc_user no puede ser nula");
                }
                else
                {
                    user = Convert.ToString(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_user"));
                }

                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_password") != null)
                {
                    password = Convert.ToString(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_password"));
                }

                result = Int32.TryParse(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_batch"), out kc_batch);
                if (!result)
                {
                    throw new Exception("La propiedad Engine.kc_batch no es correcta");
                }


                if (Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Enabled") != null)
                {
                    if (Convert.ToBoolean(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Enabled")))
                    {
                        if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "UserName")))
                        {
                            throw new Exception("La propiedad Proxy.UserName no puede ser nula");
                        }

                        if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Password")))
                        {
                            throw new Exception("La propiedad Proxy.Password no puede ser nula");
                        }

                        int port;
                        result = Int32.TryParse(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Port"), out port);
                        if (!result)
                        {
                            throw new Exception("La propiedad Proxy.Port no es correcta");
                        }


                        if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Domain")))
                        {
                            throw new Exception("La propiedad Proxy.Domain no puede ser nula");
                        }

                        if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Host")))
                        {
                            throw new Exception("La propiedad Proxy.Host no puede ser nula");
                        }

                        Proxy = new WebProxy(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Host"), port);

                        Proxy.Credentials = new System.Net.NetworkCredential(
                            Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "UserName"),
                            Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Password"),
                            Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Domain"));
                    }
                }
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Error al leer configuración en Helper()", ex);
                te.ErrorId = "1";
                throw te;
            }
        }
示例#12
0
        static KeepconSvc()
        {
            bool result = true;
            //user = "******";
            //password = "******";

            try
            {


                if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_user")))
                    throw new Exception("La propiedad Engine.kc_user no puede ser nula");
                else
                    user = Convert.ToString(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_user"));

                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_password") != null)
                    password = Convert.ToString(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_password"));

                result = Int32.TryParse(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "kc_batch"), out kc_batch);
                if (!result)
                    throw new Exception("La propiedad Engine.kc_batch no es correcta");


                if (Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Enabled") != null)
                    if (Convert.ToBoolean(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Enabled")))
                    {

                        if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "UserName")))
                            throw new Exception("La propiedad Proxy.UserName no puede ser nula");

                        if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Password")))
                            throw new Exception("La propiedad Proxy.Password no puede ser nula");

                        int port;
                        result = Int32.TryParse(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Port"), out port);
                        if (!result)
                            throw new Exception("La propiedad Proxy.Port no es correcta");


                        if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Domain")))
                            throw new Exception("La propiedad Proxy.Domain no puede ser nula");

                        if (string.IsNullOrEmpty(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Host")))
                            throw new Exception("La propiedad Proxy.Host no puede ser nula");

                        Proxy = new WebProxy(Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Host"), port);

                        Proxy.Credentials = new System.Net.NetworkCredential(
                            Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "UserName"),
                            Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Password"),
                            Fwk.Configuration.ConfigurationManager.GetProperty("Proxy", "Domain"));
                    }

            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Error al leer configuración en Helper()", ex);
                te.ErrorId = "1";
                throw te;

            }

        }
示例#13
0
        public string SendASK(string setId)
        {
            String result = string.Empty;
            try
            {
                result = KeepconSvc.SendASK(setId);

               

            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException(String.Format("CheckResult : SendASK lote {0} fallo",setId ), ex);
                te.ErrorId = "1";
                throw te;//Helper.Log(Helper.ServiceName, te, false);
                
            }
            if(result.Equals("OK"))
                KeepconSvc.SaveResult_ACK(setId);

            return result;
        }
示例#14
0
        public static PortalErrorInfo CreateNew(String message)
        {
            Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException(message);
           
            return new PortalErrorInfo(te, Helper.Controller(), Helper.Action());

        }
示例#15
0
        /// <summary>
        /// 
        /// </summary>
        public void Start_SendContent()
        {
            OnSussess("Start_SendContent");
            Helper.Log(Helper.ServiceName, "SendContent: Iniciando envia de post a keepcont", Fwk.Logging.EventType.Information, false);
            double interval = 0;
            try
            {
                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_SendContent") != null)
                    interval = Convert.ToDouble(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_SendContent")) * 1000;
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("SendContent: Error al leer configuración Engine.ClockInterval_SendContent", ex);
                te.ErrorId = "1";
                Helper.Log(Helper.ServiceName, te, true);
                throw te;

            }
            _SendContentTimer = new Timer(interval);
            _SendContentTimer.Elapsed += new ElapsedEventHandler(_SendContentTimer_Elapsed);
            _SendContentTimer.Start();



        }
示例#16
0
        public static PatientList Patients_Get()
        {
            //DataSet ds;
            //MySqlDataAdapter da;
            PatientList wPatientList = new PatientList();
            Patient     wPatient;

            using (MySqlConnection conn = new MySqlConnection(cmsys_cnnstring))
            {
                try
                {
                    conn.Open();
                    MySqlCommand wCommand = new MySqlCommand("select * from patient", conn);
                    //da = new MySqlDataAdapter("select * from patients", conn);
                    //MySqlCommandBuilder cb = new MySqlCommandBuilder(da);
                    //ds = new DataSet();


                    //da.Fill(ds, "Patients");

                    MySqlDataReader myReader = wCommand.ExecuteReader();
                    while (myReader.Read())
                    {
                        wPatient = new Patient();
                        if (myReader["birth"] != DBNull.Value)
                        {
                            wPatient.birth = myReader.GetDateTime("birth");
                        }
                        if (myReader["business_addy"] != DBNull.Value)
                        {
                            wPatient.business_addy = myReader.GetString("business_addy");
                        }
                        if (myReader["business_city"] != DBNull.Value)
                        {
                            wPatient.business_city = myReader.GetString("business_city");
                        }

                        if (myReader["business_country_id"] != DBNull.Value)
                        {
                            wPatient.business_country_id = myReader.GetInt32("business_country_id");
                        }
                        if (myReader["business_email"] != DBNull.Value)
                        {
                            wPatient.business_email = myReader.GetString("business_email");
                        }
                        if (myReader["business_phone"] != DBNull.Value)
                        {
                            wPatient.business_phone = myReader.GetString("business_phone");
                        }

                        if (myReader["business_province_id"] != DBNull.Value)
                        {
                            wPatient.business_province_id = myReader.GetInt32("business_province_id");
                        }

                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_province_name = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_zip_code = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.business_zip_code = myReader.GetString("business_province_name");
                        }
                        if (myReader["business_province_name"] != DBNull.Value)
                        {
                            wPatient.cuil = myReader.GetString("business_province_name");
                        }

                        if (myReader["death"] != DBNull.Value)
                        {
                            wPatient.death = myReader.GetDateTime("death");
                        }

                        //wPatient.extra = myReader.GetString("extra");
                        if (myReader["first_name"] != DBNull.Value)
                        {
                            wPatient.first_name = myReader.GetString("first_name");
                        }
                        if (myReader["home_addy"] != DBNull.Value)
                        {
                            wPatient.home_addy = myReader.GetString("home_addy");
                        }
                        if (myReader["home_city"] != DBNull.Value)
                        {
                            wPatient.home_city = myReader.GetString("home_city");
                        }



                        if (myReader["home_country_id"] != DBNull.Value)
                        {
                            wPatient.home_country_id = myReader.GetInt32("home_country_id");
                        }

                        if (myReader["home_email"] != DBNull.Value)
                        {
                            wPatient.home_phone = myReader.GetString("home_email");
                        }

                        if (myReader["home_province_id"] != DBNull.Value)
                        {
                            wPatient.home_province_id = myReader.GetInt32("home_province_id");
                        }

                        if (myReader["home_province_name"] != DBNull.Value)
                        {
                            wPatient.home_province_name = myReader.GetString("home_province_name");
                        }
                        if (myReader["home_zip_code"] != DBNull.Value)
                        {
                            wPatient.home_zip_code = myReader.GetString("home_zip_code");
                        }

                        wPatient.id1 = myReader.GetInt32("id1");
                        wPatient.id2 = myReader.GetInt32("id2");

                        if (myReader["last_name"] != DBNull.Value)
                        {
                            wPatient.last_name = myReader.GetString("last_name");
                        }

                        if (myReader["marital_status"] != DBNull.Value)
                        {
                            wPatient.marital_status = myReader.GetInt32("marital_status");
                        }

                        if (myReader["notes"] != DBNull.Value)
                        {
                            wPatient.notes = myReader.GetString("notes");
                        }

                        if (myReader["occupation"] != DBNull.Value)
                        {
                            wPatient.occupation = myReader.GetString("occupation");
                        }

                        if (myReader["patient_medins_default_plan_id"] != DBNull.Value)
                        {
                            wPatient.patient_medins_default_plan_id = myReader.GetInt32("patient_medins_default_plan_id");
                        }

                        if (myReader["relative_addy"] != DBNull.Value)
                        {
                            wPatient.relative_addy = myReader.GetString("relative_addy");
                        }

                        if (myReader["relative_city"] != DBNull.Value)
                        {
                            wPatient.relative_city = myReader.GetString("relative_city");
                        }

                        if (myReader["relative_country_id"] != DBNull.Value)
                        {
                            wPatient.relative_country_id = myReader.GetInt32("relative_country_id");
                        }

                        wPatientList.Add(wPatient);
                    }
                    myReader.Close();
                }
                catch (MySql.Data.MySqlClient.MySqlException ex1)
                {
                    Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("Problemas de coneccion a base de adatos MySQL\r\ncomuniquese con su administrador", ex1);
                    te.ErrorId = "3001";
                    throw te;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
                return(wPatientList);
            }
        }
示例#17
0
        /// <summary>
        /// 
        /// </summary>
        public void Start_CheckResult()
        {
            OnSussess("CheckResult: Start_CheckResult  ");
            double interval = 0;
            try
            {
                if (Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_CheckResult") != null)
                    interval = Convert.ToDouble(Fwk.Configuration.ConfigurationManager.GetProperty("Engine", "ClockInterval_CheckResult")) * 1000;
            }
            catch (Exception ex)
            {
                Fwk.Exceptions.TechnicalException te = new Fwk.Exceptions.TechnicalException("CheckResult : Error al leer configuración Engine.ClockInterval_CheckResult", ex);
                te.ErrorId = "1";
                Helper.Log(Helper.ServiceName, te,true);
                throw te;

            }

            _CheckResultTimer = new Timer(interval);
            _CheckResultTimer.Elapsed += new ElapsedEventHandler(_CheckResultTimer_Elapsed);
            _CheckResultTimer.Start();

        }