protected void guardar_Click(object sender, EventArgs e) { BSNLYR.bsnssEmployee emp = new BSNLYR.bsnssEmployee(); emp.guardarEmpleado(int.Parse(lbCod.Text), txtNombre.Text, txtApellido.Text, txtCedula.Text, txtExtension.Text, txtFlota.Text, txtDept.SelectedIndex + 1); Response.Redirect("Mantenimiento.aspx"); }
protected void Button2_Click(object sender, EventArgs e) { int parametro = 8; DataTable dtTable = new DataTable(); BSNLYR.bsnssEmployee emp = new BSNLYR.bsnssEmployee(); dtTable = emp.ConsultarCliente(txtDept.SelectedValue, parametro); GridView1.DataSource = dtTable; GridView1.DataBind(); }
protected void Button1_Click(object sender, EventArgs e) { int parametro = 0; if (DropDownList1.SelectedItem.Text == "Nombre") { parametro = 1; } if (DropDownList1.SelectedItem.Text == "Apellido") { parametro = 2; } if (DropDownList1.SelectedItem.Text == "Cedula") { parametro = 3; } if (DropDownList1.SelectedItem.Text == "Codigo Departamento") { parametro = 4; } if (DropDownList1.SelectedItem.Text == "Extension") { parametro = 5; } if (DropDownList1.SelectedItem.Text == "Flota") { parametro = 6; } if (DropDownList1.SelectedItem.Text == "General") { parametro = 8; } DataTable dtTable = new DataTable(); BSNLYR.bsnssEmployee emp = new BSNLYR.bsnssEmployee(); dtTable = emp.ConsultarCliente(TextBox1.Text, parametro); GridView1.DataSource = dtTable; GridView1.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { DataTable dtTable = new DataTable(); BSNLYR.bsnssDept emp2 = new BSNLYR.bsnssDept(); dtTable = emp2.consultarDept(); txtDept.DataSource = dtTable; txtDept.DataTextField = "Departamentos"; txtDept.DataValueField = "Departamentos"; txtDept.DataBind(); BSNLYR.bsnssEmployee emp = new BSNLYR.bsnssEmployee(); emp.selectEmployee(Request["id"], 7); txtNombre.Text = emp.emp_nombre; txtApellido.Text = emp.emp_apellido; txtCedula.Text = emp.emp_cedula; txtExtension.Text = emp.emp_ext; txtFlota.Text = emp.emp_flota; txtDept.SelectedValue = emp.dept_id; lbCod.Text = int.Parse(emp.emp_id).ToString(); } }
protected void eliminar_Click(object sender, EventArgs e) { BSNLYR.bsnssEmployee emp = new BSNLYR.bsnssEmployee(); emp.eliminarEmpleado(int.Parse(lbCod.Text)); Response.Redirect("Mantenimiento.aspx"); }