Ejemplo n.º 1
0
        private void CargarSucursales()
        {
            MSRegistro RegOut            = new MSRegistro();
            Crypto     DesencriptarTexto = new Crypto();
            string     v_Sucursal        = RegOut.GetSetting("ConexionSQL", "Sucursal");

            if (v_Sucursal != null)
            {
                v_Sucursalnum = Convert.ToInt32(DesencriptarTexto.Desencriptar(RegOut.GetSetting("ConexionSQL", "Sucursal")));
                CargarSucursales(v_Sucursalnum);
            }
        }
Ejemplo 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"));
        }
Ejemplo n.º 3
0
        private void Form1_ConfigureDataConnection(object sender, ConfigureDataConnectionEventArgs e)
        {
            MSRegistro RegOut            = new MSRegistro();
            Crypto     DesencriptarTexto = new Crypto();

            string valServer = RegOut.GetSetting("ConexionSQL", "Server");
            string valDB     = RegOut.GetSetting("ConexionSQL", "DBase");
            string valLogin  = RegOut.GetSetting("ConexionSQL", "User");
            string valPass   = RegOut.GetSetting("ConexionSQL", "Password");

            if (valServer != string.Empty && valDB != string.Empty && valLogin != string.Empty && valPass != string.Empty)
            {
                valServer = DesencriptarTexto.Desencriptar(valServer);
                valDB     = DesencriptarTexto.Desencriptar(valDB);
                valLogin  = DesencriptarTexto.Desencriptar(valLogin);
                valPass   = DesencriptarTexto.Desencriptar(valPass);
                e.ConnectionParameters = new MsSqlConnectionParameters(valServer, valDB, valLogin, valPass, MsSqlAuthorizationType.SqlServer);
            }
        }
Ejemplo n.º 4
0
        private void CargarComboSucursales()
        {
            MSRegistro RegOut            = new MSRegistro();
            Crypto     DesencriptarTexto = new Crypto();

            if (v_Sucursal != null)
            {
                int v_Sucursalnum = Convert.ToInt32(DesencriptarTexto.Desencriptar(RegOut.GetSetting("ConexionSQL", "Sucursal")));
                CargarSucursales(v_Sucursalnum);
                if (v_Caja != null)
                {
                    int v_Cajanum = Convert.ToInt32(DesencriptarTexto.Desencriptar(RegOut.GetSetting("ConexionSQL", "Caja")));
                    cboCajas.Properties.DataSource = null;
                    CargarCajas(v_Cajanum, v_Sucursalnum);
                }
            }
            else
            {
                CargarSucursales(null);
            }
        }
Ejemplo n.º 5
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();
                        v_Sucursal = RegOut.GetSetting("ConexionSQL", "Sucursal");
                        v_Caja     = RegOut.GetSetting("ConexionSQL", "Caja");
                        CargarComboSucursales();
                    }
                    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;
            }
        }
Ejemplo n.º 6
0
        private void Frm_Principal_Load(object sender, EventArgs e)
        {
            MSRegistro RegOut = new MSRegistro();

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