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"); } }
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(); }
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(); }
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(); }
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)"); }
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(); }
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); } }
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(); }
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 = ""; } }