Ejemplo n.º 1
0
        public void cargarcombos()
        {
            AcesoDatos ac = new AcesoDatos();

            GridView1.DataSource = ac.Regresaunatabla("Select indice,  usuario, rol from vendedores where ifnull(status,0) != 0 ");
            GridView1.DataBind();

            GridView2.DataSource = ac.Regresaunatabla("Select * from menu ");
            GridView2.DataBind();

            GridView3.DataSource = ac.Regresaunatabla("Select * from submenu");
            GridView3.DataBind();

            GridView4.DataSource = ac.Regresaunatabla("Select * from roles");
            GridView4.DataBind();

            GridView5.DataSource = ac.Regresaunatabla("Select * from roldetalle");
            GridView5.DataBind();

            this.cboUsuario.DataSource = ac.Regresaunatabla("Select usuario, indice from vendedores where ifnull(status,0) != 0 ");
            cboUsuario.DataTextField   = "usuario";
            cboUsuario.DataValueField  = "indice";
            this.cboUsuario.DataBind();


            this.cboRol.DataSource = ac.Regresaunatabla("Select rolnombre, indice from roles");
            cboRol.DataTextField   = "rolnombre";
            cboRol.DataValueField  = "indice";
            this.cboRol.DataBind();

            this.cbMenu.DataSource = ac.Regresaunatabla("Select nombre, indice from menu");
            cbMenu.DataTextField   = "nombre";
            cbMenu.DataValueField  = "indice";
            this.cbMenu.DataBind();

            this.cbSubMenu.DataSource = ac.Regresaunatabla("Select nombre, indice from submenu");
            cbSubMenu.DataTextField   = "nombre";
            cbSubMenu.DataValueField  = "indice";
            this.cbSubMenu.DataBind();

            this.cbMenu2.DataSource = ac.Regresaunatabla("Select nombre, indice from menu");
            cbMenu2.DataTextField   = "nombre";
            cbMenu2.DataValueField  = "indice";
            this.cbMenu2.DataBind();

            this.cdRol2.DataSource = ac.Regresaunatabla("Select rolnombre, indice from roles");
            cdRol2.DataTextField   = "rolnombre";
            cdRol2.DataValueField  = "indice";
            this.cdRol2.DataBind();

            this.cmbSuMenus.DataSource = ac.Regresaunatabla("Select nombre, indice from submenu");
            cmbSuMenus.DataTextField   = "nombre";
            cmbSuMenus.DataValueField  = "indice";
            this.cmbSuMenus.DataBind();

            this.cmbRolParaSubMenu.DataSource = ac.Regresaunatabla("Select rolnombre, indice from roles");
            cmbRolParaSubMenu.DataTextField   = "rolnombre";
            cmbRolParaSubMenu.DataValueField  = "indice";
            this.cmbRolParaSubMenu.DataBind();
        }
Ejemplo n.º 2
0
        protected void ASPxButton1_Click(object sender, EventArgs e)
        {
            string PrimaA    = this.HiddenField1.Value;
            string PrimaM    = this.HiddenField2.Value;
            string Codigo    = this.HiddenField3.Value;
            string Nom       = this.HiddenField4.Value;
            string Telefono  = this.HiddenField5.Value;
            string Direccion = this.HiddenField6.Value;
            string Email     = this.HiddenField7.Value;

            AcesoDatos ac = new AcesoDatos();

            if (Codigo == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Codigo";
                return;
            }

            if (Nom == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de nombre";
                return;
            }

            if (Telefono == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Télefono";
                return;
            }

            if (Direccion == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Direccion";
                return;
            }

            if (Email == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de E-mail";
                return;
            }
            else
            {
                ac.Ejecutar("uptade into clientes(nombre,email,direccion,telefono) values('" + Nom + "','" + Email + "','" + Direccion + "','" + Telefono + "' )");

                this.HiddenField1.Value = "";
                this.HiddenField2.Value = "";
                this.HiddenField3.Value = "";
                this.HiddenField4.Value = "";
                this.HiddenField5.Value = "";
                this.HiddenField6.Value = "";
                this.HiddenField7.Value = "";



                Response.Redirect("~/Cotizacion/Pagar.aspx");
            }
        }
Ejemplo n.º 3
0
        protected void Button8_Click(object sender, EventArgs e)
        {
            string     nom = ARol.Text;
            AcesoDatos a   = new AcesoDatos();

            a.Ejecutar("insert into roles (rolnombre) values('" + nom + "')");
            Rol2.Text = "Agregado con exito";
            cargarcombos();
        }
Ejemplo n.º 4
0
        protected void Button7_Click(object sender, EventArgs e)
        {
            string     borrar = this.cdRol2.SelectedItem.Value.ToString();
            AcesoDatos a      = new AcesoDatos();

            a.Ejecutar("Delete from roles where indice = '" + borrar + "'");
            Rol2.Text = "Borrado con exito";
            cargarcombos();
        }
Ejemplo n.º 5
0
        protected void Button2_Click(object sender, EventArgs e)
        {
            string     nom = NomM.Text;
            AcesoDatos a   = new AcesoDatos();

            a.Ejecutar("insert into menu (nombre) values('" + nom + "')");
            Menus.Text = "Agregado con exito";
            cargarcombos();
        }
Ejemplo n.º 6
0
        public static void AgregarV(string usuario, string contraseña, string correo)
        {
            usuario    = usuario.Replace("'", "").Replace("/", "").Replace(")", "").Replace("*", "").Replace("--", "");
            contraseña = contraseña.Replace("'", "").Replace("/", "").Replace(")", "").Replace("*", "").Replace("--", "");
            correo     = correo.Replace("'", "").Replace("/", "").Replace(")", "").Replace("*", "").Replace("--", "");

            AcesoDatos ac = new AcesoDatos();

            ac.Ejecutar("insert into vendedores (usuario,password,correo, status) values('" + usuario + "', '" + contraseña + "', '" + correo + "', 1)");
        }
Ejemplo n.º 7
0
        protected void Button4_Click(object sender, EventArgs e)
        {
            string nom = NomSub.Text;

            string indi = this.cbMenu2.SelectedItem.Value.ToString();
            string url  = Urlt.Text;

            AcesoDatos a = new AcesoDatos();

            a.Ejecutar("insert into submenu (nombre,idmenu,url) values('" + nom + "','" + indi + "','" + url + "')");
            SubMenu.Text = "Agregado con exito";
            cargarcombos();
        }
Ejemplo n.º 8
0
        public static bool ValidarUsuario(string user)
        {
            bool       respuesta = false;
            AcesoDatos ac        = new AcesoDatos();

            user = user.Replace("'", "").Replace("/", "").Replace(")", "").Replace("*", "").Replace("--", "");
            string valida = ac.Regresaunregistro("Select count(*) from vendedores where usuario ='" + user.Trim() + "'  and ifnull(status,0) = 1  ");

            if (valida != "0")
            {
                respuesta = true;
            }

            return(respuesta);
        }
Ejemplo n.º 9
0
        public Boolean Validar()
        {
            string validausuario  = "";
            string validapassword = "";

            AcesoDatos ac = new AcesoDatos();

            validausuario  = ac.Regresaunregistro("Select indice from vendedores where usuario = '" + UsuarioEjecutivo + "' and ifnull(status,0) = 1 ");
            validapassword = ac.Regresaunregistro("Select indice from vendedores where  usuario = '" + UsuarioEjecutivo + "' and password = '******'  and ifnull(status,0) = 1 ");
            if (validausuario == validapassword && validausuario != "")
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Ejemplo n.º 10
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {
                string _indice_usuario = this.cboUsuario.SelectedItem.Value.ToString();
                string rol             = this.cboRol.SelectedItem.Value.ToString();

                AcesoDatos a = new AcesoDatos();

                a.Ejecutar("update vendedores set rol = '" + rol + "' where indice = '" + _indice_usuario + "'  ");

                Rols.Text = "Rol agregado con exito";
                Rols.DataBind();
            }
            catch (Exception es)
            {
                Helper.RegistrarEvento("Asignando Roles. " + es.Message);
            }
        }
Ejemplo n.º 11
0
        protected void Button9_Click(object sender, EventArgs e)
        {
            string rol     = this.cmbRolParaSubMenu.SelectedItem.Value.ToString();
            string submenu = this.cmbSuMenus.SelectedItem.Value.ToString();
            string val     = "";

            AcesoDatos a = new AcesoDatos();

            val = a.Regresaunregistro("select count(*) from roldetalle where idrol ='" + rol + "' and idsubmenu ='" + submenu + "'  ");
            if (val == "0")
            {
                a.Ejecutar("insert roldetalle set idrol = '" + rol + "', idsubmenu = '" + submenu + "'  ");
                lblMensajeAsociarRoles.Text = "Rol agregado con exito";
            }
            else
            {
                lblMensajeAsociarRoles.Text = "Este submenu ya existe para este rol.";
            }

            lblMensajeAsociarRoles.DataBind();
            cargarcombos();
        }
Ejemplo n.º 12
0
        protected void ASPxButton2_Click(object sender, EventArgs e)
        {
            string CodPed = this.HiddenField2.Value;
            string Email  = this.HiddenField3.Value;
            string Nit    = this.HiddenField4.Value;
            string Nom    = this.HiddenField5.Value;
            string Apel   = this.HiddenField6.Value;
            string Direc  = this.HiddenField7.Value;
            string Nutj   = this.HiddenField8.Value;
            string Codtj  = this.HiddenField9.Value;
            string Fechv  = this.HiddenField10.Value;
            string Mon    = this.HiddenField11.Value;
            string Totalp = this.HiddenField12.Value;

            AcesoDatos a = new AcesoDatos();

            if (CodPed == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Codigo de Pedido";
                return;
            }

            if (Email == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Email";
                return;
            }

            if (Nit == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Nit";
                return;
            }

            if (Nom == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Nombre";
                return;
            }

            if (Apel == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Apellido";
                return;
            }
            if (Direc == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Dirección";
                return;
            }
            if (Nutj == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Número de Tarjeta";
                return;
            }
            if (Codtj == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Codigo de Tarjeta";
                return;
            }
            if (Fechv == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Fecha de Vencimiento";
                return;
            }
            if (Mon == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio de Moneda";
                return;
            }
            if (Totalp == "")
            {
                this.Msg.Text = "Ha dejado el campo vacio el Total";
                return;
            }
        }
Ejemplo n.º 13
0
        protected void Button1_Click(object sender, EventArgs e)
        {
            string nombre     = this.HiddenField1.Value;
            string apellido   = this.HiddenField2.Value;
            string direccion  = this.HiddenField3.Value;
            string telefono   = this.HiddenField4.Value;
            string nacimiento = this.HiddenField5.Value;
            string id         = this.HiddenField6.Value;
            string email      = this.HiddenField7.Value;

            AcesoDatos ac = new AcesoDatos();

            if (nombre == "")
            {
                this.Msg.Text = "No ha ingresado su nombre";
                return;
            }

            if (apellido == "")
            {
                this.Msg.Text = "No ha ingresado su apellido";
                return;
            }

            if (direccion == "")
            {
                this.Msg.Text = "No ha ingresado su dirección";
                return;
            }

            if (telefono == "")
            {
                this.Msg.Text = "No ha ingresado su télefono";
                return;
            }

            if (nacimiento == "")
            {
                this.Msg.Text = "No ha ingresado su fecha de nacimiento";
                return;
            }

            if (id == "")
            {
                this.Msg.Text = "No ha ingresado su id";
                return;
            }

            if (email == "")
            {
                this.Msg.Text = "No ha ingresado su E-mail";
                return;
            }
            else
            {
                ac.Ejecutar("insert into clientes(nombre,apellido,email,direccion,telefono,nacimiento,id) values('" + nombre + "','" + direccion + "','" + email + "','" + direccion + "','" + telefono + "','" + nacimiento + "','" + id + "')");
                Response.Redirect("ProcesoCotizacion.aspx");
                this.HiddenField1.Value = "";
                this.HiddenField2.Value = "";
                this.HiddenField3.Value = "";
                this.HiddenField4.Value = "";
                this.HiddenField5.Value = "";
                this.HiddenField6.Value = "";
                this.HiddenField7.Value = "";
            }
        }