protected void btnGuardar_Click(object sender, EventArgs e) { menu_C = new Menu_C(); menu_M = new Menu_M(); func = new FuncionesVarias(); dt = new DataTable(); string key = "b14ca5898a4e4133bbce2ea2315a1916"; // string encryp = func.EncryptString(key, txtContrasenia.Text); .Rows[0]["mensaje"].ToString() if (validarControles() == true) { menu_M.usuario = txtUsuario.Text; menu_M.contrasenia = func.EncryptString(key, txtContrasenia.Text); menu_M.idEmpledo = int.Parse(ddlEmpleados.SelectedValue); try { dt = menu_C.ingresoUsuario(menu_M); if (dt.Rows.Count > 0) { lblSuccess.Visible = true; lblSuccess.Text = "Ingreso Exitosamente" + dt.Rows[0]["mensaje"].ToString(); //limpiar(); } else { lblError.Visible = true; lblError.Text = "Error al ingresar"; } }catch (Exception ex) { lblError.Visible = true; lblError.Text = "Error.." + ex.ToString(); } } }
public void llenarEmpleados(GridView grid) { grid.DataSource = null; menu_C = new Menu_C(); grid.DataSource = menu_C.listadoUsaurioDT(); grid.DataBind(); }
protected void btnInicioSession_Click(object sender, EventArgs e) { menu_m = new Menu_M(); menu_c = new Menu_C(); func = new FuncionesVarias(); string key = "b14ca5898a4e4133bbce2ea2315a1916"; menu_m.usuario = txtUser.Text; menu_m.contrasenia = func.EncryptString(key, txtPassword.Text); string resultado = menu_c.inicioSesion(menu_m); if (resultado != "false") { if (resultado == txtUser.Text) { Session["usuario"] = txtUser.Text; Response.Redirect("~/WebForm1.aspx"); } else { lblError.Visible = true; lblError.Text = "Usuario/Contraseña no coinciden"; txtPassword.Text = string.Empty; } } else { lblError.Visible = true; lblError.Text = "Algo ocurrio mal.."; } }
public DataTable GetData(int id) { menu_c = new Menu_C(); dt = new DataTable(); dt = menu_c.llenarMenu(id); return(dt); }
public void llenarEmpleadoDDl(DropDownList drop) { dt = new DataTable(); menu_C = new Menu_C(); dt = menu_C.llenarEmpleadoDDL(); drop.ClearSelection(); drop.Items.Clear(); drop.AppendDataBoundItems = true; drop.Items.Add("Elija un valor"); drop.Items[0].Value = "0"; drop.DataSource = menu_C.llenarEmpleadoDDL(); drop.DataTextField = "nombre"; drop.DataValueField = "e_idEmpleado"; drop.DataBind(); }