Esempio n. 1
0
        private void Frm_Conexiones_Load(object sender, EventArgs e)
        {
            CargarIconos();
            MSRegistro RegOut = new MSRegistro();
            Crypto     DesencriptarTexto = new Crypto();
            string     valServer, valDB, valLogin, valPass;

            try
            {
                valServer = DesencriptarTexto.Desencriptar(RegOut.GetSetting("ConexionSQL", "Server"));
                valDB     = DesencriptarTexto.Desencriptar(RegOut.GetSetting("ConexionSQL", "DBase"));
                valLogin  = DesencriptarTexto.Desencriptar(RegOut.GetSetting("ConexionSQL", "User"));
                valPass   = DesencriptarTexto.Desencriptar(RegOut.GetSetting("ConexionSQL", "Password"));
            }
            catch
            {
                valServer = string.Empty;
                valDB     = string.Empty;
                valLogin  = string.Empty;
                valPass   = string.Empty;
            }



            if (valServer != null && valDB != null && valLogin != null & valPass != null)
            {
                txtServer.Text   = valServer;
                txtDB.Text       = valDB;
                txtLogin.Text    = valLogin;
                txtPassword.Text = valPass;
                using (SqlConnection conn = new SqlConnection(String.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3}", txtServer.Text, txtDB.Text, txtLogin.Text, txtPassword.Text)))
                {
                    try
                    {
                        conn.Open();
                    }
                    catch
                    {
                        XtraMessageBox.Show("No se Han Configurado datos Correctos para la conexion a la base de datos Local");
                    }
                }
            }
            else
            {
                txtServer.Text   = string.Empty;
                txtDB.Text       = string.Empty;
                txtLogin.Text    = string.Empty;
                txtPassword.Text = string.Empty;
            }
        }
Esempio n. 2
0
        private void Frm_Login_Shown(object sender, EventArgs e)
        {
            txtUser.Focus();
            MSRegistro RegOut = new MSRegistro();

            SkinForm.LookAndFeel.SetSkinStyle(RegOut.GetSetting("ConexionSQL", "Sking"));
        }
Esempio n. 3
0
        private void Frm_Login_Load(object sender, EventArgs e)
        {
            txtUser.Focus();
            MSRegistro RegOut = new MSRegistro();

            SkinForm.LookAndFeel.SetSkinStyle(RegOut.GetSetting("ConexionSQL", "Sking"));

            CLS_Version v = new CLS_Version();

            v.MtdSeleccionarVersion();
            if (v.Exito)
            {
                if (barStaticItem1.Caption.Trim().Equals(v.Datos.Rows[0][0].ToString()))
                {
                }
                else
                {
                    XtraMessageBox.Show("La version del programa no es la mas actual, se requiere la version " + v.Datos.Rows[0][0].ToString() + Environment.NewLine + "Favor de comunicarse con el administrador del sistema");
                    btnAcceso.Enabled = false;
                }
            }
            else
            {
                XtraMessageBox.Show(v.Mensaje);
            }
        }