Пример #1
0
        private void Frm_Login_Shown(object sender, EventArgs e)
        {
            txtUser.Focus();
            MSRegistro RegOut = new MSRegistro();

            SkinForm.LookAndFeel.SetSkinStyle(RegOut.GetSetting("ConexionSQL", "Sking"));
        }
Пример #2
0
        private void Frm_Login_Load(object sender, EventArgs e)
        {
            txtUser.Focus();
            MSRegistro RegOut = new MSRegistro();

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


            /* 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;
             * }*/
        }
Пример #3
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);
            }
        }
Пример #4
0
        private int CargarComboSucursales()
        {
            MSRegistro RegOut            = new MSRegistro();
            Crypto     DesencriptarTexto = new Crypto();

            try
            {
                if (RegOut.GetSetting("ConexionSQL", "Sucursal").ToString().Length == 0)
                {
                    XtraMessageBox.Show("Falta especificar la sucursal en la conexión");
                    return(-1);
                }
                else
                {
                    return(Convert.ToInt32(DesencriptarTexto.Desencriptar(RegOut.GetSetting("ConexionSQL", "Sucursal"))));
                }
            }
            catch (Exception e)
            {
                XtraMessageBox.Show("Falta especificar la sucursal en la conexión");
                return(-1);
            }
        }
Пример #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;
            }
        }
Пример #6
0
        private void Frm_Existencias_Load(object sender, EventArgs e)
        {
            MSRegistro RegOut = new MSRegistro();
            Crypto     DesencriptarTexto = new Crypto();
            string     valServer, valDB, valLogin, valPass, v_Sucursal, v_Caja;

            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)
            {
                using (SqlConnection conn = new SqlConnection(String.Format("Data Source={0};Initial Catalog={1};Persist Security Info=True;User ID={2};Password={3}", valServer, valDB, valLogin, valPass)))
                {
                    try
                    {
                        conn.Open();

                        conn.Close();

                        v_Sucursal = RegOut.GetSetting("ConexionSQL", "Sucursal");
                        v_Caja     = RegOut.GetSetting("ConexionSQL", "Caja");

                        if (v_Sucursal != null && v_Caja != null)
                        {
                        }
                        else
                        {
                            XtraMessageBox.Show("No se Han especificado la sucursal");
                            Frm_Conexiones conectar = new Frm_Conexiones();
                            conectar.ShowDialog();
                        }
                    }
                    catch
                    {
                        XtraMessageBox.Show("No se Han Configurado datos Correctos para la conexion a la base de datos Local");
                        Frm_Conexiones conectar = new Frm_Conexiones();
                        conectar.ShowDialog();
                    }
                }
                CargarConexionesSucursalesExistencias();
            }
            else
            {
                XtraMessageBox.Show("No se Han encontrado datos de conexion local");
                Frm_Conexiones conectar = new Frm_Conexiones();
                conectar.ShowDialog();
            }



            //gridView1.OptionsBehavior.Editable = false;
            //gridView1.OptionsSelection.EnableAppearanceFocusedCell = false;
            //gridView1.FocusRectStyle = DevExpress.XtraGrid.Views.Grid.DrawFocusRectStyle.RowFocus;
            //CargarSucursales(null);
        }