protected void btnaceptar1_Click(object sender, EventArgs e) { string idplan; DataTable aux1 = new DataTable(); TheGym k = new TheGym { Nombreplanins = tbnombre.Text, duracionplanins = ListBox1.SelectedValue, precioplanins = tbprecio.Text }; k.AddNewPlan(); aux1 = k.GetLastPlan(); DataRow fila = aux1.Rows[0]; idplan = fila[0].ToString(); int aux = Tabla.Rows.Count; for (int i = aux; i > 0; i--) { k.FK_plan = idplan; fila = TablaID.Rows[i - 1]; k.FK_actividad = fila[0].ToString(); fila = Tabla.Rows[i - 1]; k.Dias_semanas = fila["Dias por Semana"].ToString(); k.AddDetallePlan(); Tabla.Rows.RemoveAt(i - 1); TablaID.Rows.RemoveAt(i - 1); } tbnombre.Text = string.Empty; tbprecio.Text = string.Empty; gvactividadesincluidasenplan.Dispose(); }
protected void btnEditar_Click(object sender, EventArgs e) { TheGym k = new TheGym { DNIEditar = DNIEdit, NombreEmpleadoEdit = TbNombre.Text, ApellidoEmpleadoEdit = TbApellido.Text, DNIEmpleadoEdit = TbDNI.Text, FechaNacEmpleadoEdit = TbFechaNac.Text, EmailEmpleadoEdit = TbEmail.Text, TelefonoEmpleadoEdit = TbTelefono.Text, DomicilioEmpleadoEdit = TbDomicilio.Text, TituloEmpleadoEdit = TbTitulo.Text, ExperienciaEmpleadoEdit = TbExperiencia.Text, CargoEmpleadoEdit = ddlCargo.SelectedValue }; k.UpdateEmpleado(); TbNombre.Text = string.Empty; TbApellido.Text = string.Empty; TbDNI.Text = string.Empty; TbFechaNac.Text = string.Empty; TbEmail.Text = string.Empty; TbTelefono.Text = string.Empty; TbDomicilio.Text = string.Empty; TbTitulo.Text = string.Empty; TbExperiencia.Text = string.Empty; ddlCargo.ClearSelection(); ddlCargo.Enabled = false; TbNombre.ReadOnly = true; TbApellido.ReadOnly = true; TbDNI.ReadOnly = true; TbFechaNac.ReadOnly = true; TbEmail.ReadOnly = true; TbTelefono.ReadOnly = true; TbDomicilio.ReadOnly = true; TbTitulo.ReadOnly = true; TbExperiencia.ReadOnly = true; DataTable aux = new DataTable(); GridView1.DataSource = aux; GridView1.DataBind(); GridView1.Dispose(); }
protected void btnregistrar_Click(object sender, EventArgs e) { SaveClienteFoto(); //Configuracion para registrar cliente en la base de datos //Creo el objeto k TheGym k = new TheGym { NombreCliente = tbnombre.Text, ApellidoCliente = tbapellido.Text, EmailCliente = tbemail.Text, FechaCliente = tbfechadenacimiento.Text, TelefonoCliente = tbtelefono.Text, CalleCliente = tbcalle.Text, NumeroCliente = tbnumerocasa.Text, BarrioCliente = tbbarrio.Text, FKLocalidadCliente = ddllocalidad.SelectedValue, DNICliente = tbnumerodocumento.Text, FotoCliente = "~/ImagenesSistema/" + tbnumerodocumento.Text + extention, FKTipoDocumento = ddltipodedocumento.SelectedValue, }; try { k.AddNewCliente(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "$('#modal-default').modal('show');", true); } catch (Exception ex) { lblerror.Text = ex.Message.ToString(); } tbnombre.Text = string.Empty; tbapellido.Text = string.Empty; tbfechadenacimiento.Text = string.Empty; tbemail.Text = string.Empty; tbcalle.Text = string.Empty; tbnumerocasa.Text = string.Empty; tbbarrio.Text = string.Empty; tbcontraseña.Text = string.Empty; ddllocalidad.ClearSelection(); ddltipodedocumento.ClearSelection(); tbtelefono.Text = string.Empty; tbnumerodocumento.Text = string.Empty; tbusuario.Text = string.Empty; //daltan algunos }
protected void btnregistrar_Click(object sender, EventArgs e) { try { string idrutina; DataTable aux1 = new DataTable(); TheGym k = new TheGym { NombreRutina = tbnombre.Text, IDEmpleado = Label5.Text, IDCliete = idcliente }; aux1 = k.AddRutina(); idrutina = aux1.Rows[0][0].ToString(); for (int i = 0; i < gridejerciciosrutina.Rows.Count; i++) { TheGym q = new TheGym { IDRutina = idrutina, IDEjercicio = gridejerciciosrutina.Rows[i].Cells[2].Text, Serie = gridejerciciosrutina.Rows[i].Cells[3].Text, Repeticion = gridejerciciosrutina.Rows[i].Cells[4].Text, Dia = gridejerciciosrutina.Rows[i].Cells[5].Text }; q.AddDetalleRutina(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "$('#modal-default').modal('show');", true); } } catch (Exception ex) { lblerror.Text = ex.Message.ToString(); } }
protected void gridactividades_RowDeleting(object sender, GridViewDeleteEventArgs e) { TheGym k = new TheGym { IDActBuscar = gridactividades.Rows[e.RowIndex].Cells[0].Text }; k.InhabilitarActividad(); DataTable aux = new DataTable(); gridactividades.DataSource = aux; gridactividades.DataBind(); gridactividades.Visible = false; lblerror.Text = "Actividad inhabilitado"; lblerror.Visible = true; tbnombre.Text = ""; }
protected void gridclientes_RowDeleting(object sender, GridViewDeleteEventArgs e) { //idcliente search TheGym k = new TheGym { IdClienteSearch = gridclientes.Rows[e.RowIndex].Cells[0].Text }; k.InhabilitarCliente(); DataTable aux = new DataTable(); gridclientes.DataSource = aux; gridclientes.DataBind(); gridclientes.Visible = false; lblerror.Text = "Cliente inhabilitado"; lblerror.Visible = true; tbnombre.Text = ""; }
protected void BTNRegistrarPP1_Click(object sender, EventArgs e) { TheGym k = new TheGym { NombreActividad = TbNombre.Text, ProfesorActividad = ddlprofesor.SelectedValue, SucursalActividad = DlistSucursal.SelectedValue, CuposActividad = DdlCupos.SelectedValue, HorarioInicioActividad = DplistInicio.SelectedValue, HorarioFinActividad = DplistFin.SelectedValue, DescripcionActividad = TbDescripcion.Text }; k.AddNewActividad(); TbNombre.Text = string.Empty; TbDescripcion.Text = string.Empty; }
protected void Button2_Click(object sender, EventArgs e) { TheGym k = new TheGym { NombreRutina = tbnombre.Text, }; DataTable dt = new DataTable(); dt = k.GetRutinaNombre(); if (dt.Rows.Count > 0) { Verificar.Text = "Ya Existe una rutina con este nombre, elija un nuevo nombre"; } else { Verificar.Text = "Puede usar este nombre"; } }
protected void btnconsultarproveedorgrid_Click(object sender, EventArgs e) { //este es el boton consultar proveedor del modal de proveedores try { if (tbnombreproveedor.Text != string.Empty) { TheGym k2 = new TheGym { NombreProveedorBusc = tbnombreproveedor.Text }; DataTable dt2 = new DataTable(); dt2 = k2.GetProveedorNom(); if (dt2.Rows.Count > 0) { lblerrorbuscarmodalproveedor.Text = string.Empty; lblerrorbuscarmodalproveedor.Visible = false; gvproveedoresmodal.DataSource = dt2; gvproveedoresmodal.DataBind(); gvproveedoresmodal.Visible = true; lblerrorbuscarmodalproveedor.Visible = true; } else { DataTable dt1 = new DataTable(); gvproveedoresmodal.DataSource = dt1; gvproveedoresmodal.DataBind(); gvproveedoresmodal.Visible = false; lblerrorbuscarmodalproveedor.Text = "No se encontro proveedor"; lblerrorbuscarmodalproveedor.Visible = true; } } else { lblerrorbuscarmodalproveedor.Text = "Ingrese un valor"; lblerrorbuscarmodalproveedor.Visible = true; } } catch { lblerrorbuscarmodalproveedor.Text = "Error general"; lblerrorbuscarmodalproveedor.Visible = true; } }
protected void botonconsultarproductos_Click(object sender, EventArgs e) { if (tbnombreproductos.Text != string.Empty) { lblerrorproductosmodal.Visible = false; try { TheGym k = new TheGym { NombreProdBusc = tbnombreproductos.Text, SucBuscProd = suc }; DataTable dt = new DataTable(); dt = k.GetProductoVenta(); if (dt.Rows.Count > 0) { gvproductos.DataSource = dt; gvproductos.DataBind(); gvproductos.Visible = true; } else { lblerrorproductosmodal.Visible = true; lblerrorproductosmodal.Text = "No se encontro el producto"; gvproductos.DataSource = dt; gvproductos.DataBind(); gvproductos.Visible = false; } } catch (Exception ex) { lblerrorproductosmodal.Visible = true; lblerrorproductosmodal.Text = ex.Message.ToString(); } } else { lblerrorproductosmodal.Visible = true; lblerrorproductosmodal.Text = "Ingrese el nombre de un producto"; } }
protected void btnconsultar_Click(object sender, EventArgs e) { TheGym k = new TheGym { NombreEjercicio = TextBox1.Text }; DataTable dt = k.GetEjercicio(); TablaEjercicio = dt; if (dt.Rows.Count > 0) { gridejercicios.DataSource = dt; gridejercicios.DataBind(); } else { lblerror.Text = "No se encontro el Ejercicio"; } }
protected void Button1_Click(object sender, EventArgs e) { try { TheGym k = new TheGym { IDEmpleadoIngreso = tbid.Text, EstadoIngresoEmpleado = estado, }; k.AddIngresoEmpleado(); lblerror.Text = "Se efectuó el registro"; Label1.Text = ""; Button1.Visible = false; } catch (Exception ex) { lblerror.Text = ex.Message.ToString(); } }
private void GetAllPlan() { TheGym k = new TheGym(); DataTable dt = new DataTable(); dt = k.GetAllPlans(); if (dt.Rows.Count > 0) { //DdlPlan.Items.Add("Seleccione..."); //DdlPlan.DataSource = dt; DdlPlan.DataTextField = "Nombre"; DdlPlan.DataValueField = "Id_plan"; DdlPlan.DataSource = dt; DdlPlan.DataBind(); // DdlPlan.Items.Add("Seleccione..."); DdlPlan.Items.Insert(0, "Seleccione..."); } }
protected void btneditarRutina_Click1(object sender, EventArgs e) { try { string idrutina; idrutina = gridfichaderutina.SelectedRow.Cells[0].Text; TheGym n = new TheGym { IDRutina = idrutina }; n.BorrarDetalle(); for (int i = 0; i < gridejerciciosrutina.Rows.Count; i++) { TheGym q = new TheGym { IDRutina = idrutina, IDEjercicio = gridejerciciosrutina.Rows[i].Cells[2].Text, Serie = gridejerciciosrutina.Rows[i].Cells[3].Text, Repeticion = gridejerciciosrutina.Rows[i].Cells[4].Text, Dia = gridejerciciosrutina.Rows[i].Cells[5].Text }; q.AddDetalleRutina(); } Label2.Text = "Se Edito correctamente la rutina"; Label2.Focus(); ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "$('#modal-default').modal('show');", true); } catch (Exception ex) { lblerror.Text = ex.Message.ToString(); } ScriptManager.RegisterStartupScript(this, this.GetType(), "Pop", "$('#modal-default').modal('show');", true); }
protected void gvplanes_SelectedIndexChanged(object sender, EventArgs e) { //cuando seleccionamos una fila del grid try { TextBox1.Text = gvplanes.SelectedRow.Cells[1].Text; TextBox2.Text = gvplanes.SelectedRow.Cells[2].Text; //mostrar un panel y ocultar otro panelconsulta.Visible = false; paneledicion.Visible = true; paneledicion.Focus(); tbCantidad.Enabled = false; lbduración0.Enabled = false; tbCantidad.Text = gvplanes.SelectedRow.Cells[3].Text; //codigo para cargar los valores de la fila en los textbox del panel de edicion idplan = gvplanes.SelectedRow.Cells[0].Text; TheGym k = new TheGym { IdPlanBuscar = idplan }; DataTable dt = new DataTable(); dt = k.GetDetPlans(); if (dt.Rows.Count > 0) { aux = dt; gridactividades0.DataSource = dt; gridactividades0.DataBind(); gridactividades0.Visible = true; } else { gridactividades0.Visible = false; DataTable dt1 = new DataTable(); gridactividades0.DataSource = dt1; gridactividades0.DataBind(); } } catch (Exception ex) { lblerror.Text = ex.Message.ToString(); } }
protected void btneditar_Click(object sender, EventArgs e) { if (btneditar.Text == "Editar") { btnAdd.Enabled = true; TextBox1.Enabled = true; TextBox2.Enabled = true; ddlactividad.Enabled = true; tbCantidad.Enabled = true; lbduración0.Enabled = true; btneditar.Text = "Guardar"; } else { try { TheGym k = new TheGym() { IdPlanBuscar = idplan, Nombreplanins = TextBox1.Text, precioplanins = TextBox2.Text, duracionplanins = tbCantidad.Text }; k.UpdatePlan(); k.DeleteDetPlan(); for (int j = 0; j < gridactividades0.Rows.Count; j++) { k.FK_plan = idplan; k.FK_actividad = ddlactividad.SelectedValue; k.Dias_semanas = lbduración0.SelectedItem.Text; k.UpdateDetallePlan(); } lblerror.Text = "Actualizado exitosamente"; } catch { lblerror.Text = "Problema al actualizar"; } } }
protected void gridproveedor_SelectedIndexChanged(object sender, EventArgs e) { try { lblerrorgridprov.Visible = false; LblOrden.Visible = true; TheGym k = new TheGym { idproveedor = gridproveedor.SelectedRow.Cells[0].Text }; DataTable dt = new DataTable(); dt = k.GetOrdenIDprov(); TablaORden = dt; if (dt.Rows.Count > 0) { lblProveedor.Visible = false; LblOrden.Visible = true; gridproveedor.Visible = false; gridorden.DataSource = dt; gridorden.DataBind(); gridorden.Visible = true; panelconsulta.Visible = false; panelordencompra.Visible = true; } else { gridorden.DataSource = dt; gridorden.DataBind(); gridorden.Visible = false; lblerrorgridprov.Visible = true; LblOrden.Visible = false; gridproveedor.Visible = false; lblProveedor.Visible = false; lblerrorgridprov.Text = "No se encontraron ordenes de compra"; } } catch { lblerrorgridprov.Visible = true; lblerrorgridprov.Text = "Error General"; } }
protected void CargarProveedores() { lblerror.Visible = false; TheGym k = new TheGym(); DataTable dt = new DataTable(); dt = k.GetProveedores(); if (dt.Rows.Count > 0) { ddlProveedor.DataTextField = "Nombre"; ddlProveedor.DataValueField = "Id_proveedor"; ddlProveedor.DataSource = dt; ddlProveedor.DataBind(); } else { lblerror.Visible = true; lblerror.Text = "No se encontraron servicios"; } }
protected string EncontrarIdSuc1(string aux) { string nombre; TheGym k = new TheGym { emailbusadm = aux }; DataTable dt = new DataTable(); dt = k.GetSucEmailEmpleado(); if (dt.Rows.Count > 0) { nombre = dt.Rows[0][0].ToString(); return(nombre); } else { return("1"); } }
protected string EncontrarIdEmpleado(string aux) { string id; TheGym k = new TheGym { emailbusadm = aux }; DataTable dt = new DataTable(); dt = k.GetIDemp(); if (dt.Rows.Count > 0) { id = dt.Rows[0][0].ToString(); return(id); } else { return("1"); } }
protected void btnconsultar_Click(object sender, EventArgs e) { TheGym k = new TheGym { NombreProducto = TextBox1.Text }; DataTable dt = k.GetProducto(); TablaProductos = dt; if (dt.Rows.Count > 0) { gvproductos.DataSource = dt; gvproductos.DataBind(); } else { lblerror.Text = "No se encontro el Producto"; } }
public void CargarLocalidades() { try { TheGym k = new TheGym(); DataTable dt = new DataTable(); dt = k.GetAllLocalidades(); if (dt.Rows.Count > 0) { ddllocalidad.DataTextField = "Nombre"; ddllocalidad.DataValueField = "CodigoPostal"; ddllocalidad.DataSource = dt; ddllocalidad.DataBind(); } } catch (Exception ex) { lblerror.Text = ex.Message.ToString() + "carga ddl"; } }
protected void btnconsultarodenmodel_Click(object sender, EventArgs e) { griddetalleordenmodal.Visible = false; lblerrorordenmodal.Visible = false; if (ddlProveedor.SelectedItem.Text != "--Seleccione--") { TheGym k = new TheGym { FacturaIDProv = ddlProveedor.SelectedValue }; DataTable dt = new DataTable(); dt = k.GetOrdenDeProv(); if (dt.Rows.Count > 0) { gridordenmodal.DataSource = dt; gridordenmodal.DataBind(); gridordenmodal.Visible = true; } else { lblerrorordenmodal.Visible = true; lblerrorordenmodal.Text = "Sin ordenes de compra para ese proveedor"; DataTable dt1 = new DataTable(); gridordenmodal.DataSource = dt1; gridordenmodal.DataBind(); gridordenmodal.Dispose(); gridordenmodal.Visible = false; } } else { lblerrorordenmodal.Visible = true; lblerrorordenmodal.Text = "Seleccione un proveedor"; DataTable dt1 = new DataTable(); gridordenmodal.DataSource = dt1; gridordenmodal.DataBind(); gridordenmodal.Dispose(); gridordenmodal.Visible = false; } }
protected void btnaceptar0_Click(object sender, EventArgs e) { try { SaveClienteFoto(); //Configuracion para registrar cliente en la base de datos //Creo el objeto k TheGym k = new TheGym { NombreCliente = tbnombre0.Text, ApellidoCliente = tbapellido0.Text, EmailCliente = tbemail1.Text, FechaCliente = tbfechanacimiento1.Text, TelefonoCliente = tbtelefono1.Text, DomicilioCliente = tbdomicilio.Text, DNICliente = tbdni0.Text, FotoCliente = "~/ImagenesSistema/" + fuImage.FileName }; try { k.AddNewCliente(); LblReg.Text = ("Cliente registrado con éxito."); } catch { } tbnombre0.Text = string.Empty; tbapellido0.Text = string.Empty; tbfechanacimiento1.Text = string.Empty; tbemail1.Text = string.Empty; tbtelefono1.Text = string.Empty; tbdomicilio.Text = string.Empty; tbdni0.Text = string.Empty; } catch (Exception ex) { LblReg.Text = ex.Message.ToString(); } }
//protected void gridreportes_PageIndexChanging1(object sender, GridViewPageEventArgs e) //{ // gridreportes.PageIndex = e.NewPageIndex; // gridreportes.DataSource = detalle; // gridreportes.DataBind(); //} protected void ddlcapital_SelectedIndexChanged(object sender, EventArgs e) { if (ddlcapital.Text == "Ingreso") { tbingreso.Visible = true; tbegreso.Visible = false; tbtotal.Visible = true; } else { if (ddlcapital.Text == "Egreso") { tbegreso.Visible = true; tbingreso.Visible = false; tbtotal.Visible = true; } else { tbingreso.Visible = true; tbegreso.Visible = true; tbtotal.Visible = true; } } TheGym k = new TheGym { Estado = ddlcapital.Text }; DataTable dt = new DataTable(); dt = k.GetConceptos(); DataRow fila = dt.NewRow(); fila[0] = "Total"; dt.Rows.Add(fila); ddlconcepto.DataSource = dt; //ddlplan.DataValueField = "Id_concepto"; ddlconcepto.DataTextField = "Concepto"; ddlconcepto.DataBind(); paneldetalle.Visible = false; }
protected void btnconsultar_Click(object sender, EventArgs e) { TheGym k = new TheGym(); k.NombreEmpleadoBusc = tbnombre.Text; //k.NombreEmpleadoBusc = ""; DataTable dt1 = new DataTable(); dt1 = k.GetEmpleadoNom(); TablaEmpleado = dt1; if (dt1.Rows.Count > 0) { gridempleados.DataSource = dt1; gridempleados.DataBind(); gridempleados.Visible = true; } else { lblerror.Text = "No se encontraron elementos que coincidan con la busqueda"; } //TextBox1.Text = dt1.Rows[0][0].ToString(); //tbapellido.Text = dt1.Rows[0][1].ToString(); //tbnumerodocumento.Text = dt1.Rows[0][2].ToString(); //tbcalle.Text = dt1.Rows[0][3].ToString(); //tbnumerocasa.Text = dt1.Rows[0][4].ToString(); //tbbarrio.Text = dt1.Rows[0][5].ToString(); //tbemail.Text = dt1.Rows[0][6].ToString(); //tbfechacontratacion.Text = dt1.Rows[0][7].ToString(); //tbtelefono.Text = dt1.Rows[0][8].ToString(); //tbfechadenacimiento.Text = dt1.Rows[0][9].ToString(); //tbtitulo.Text = dt1.Rows[0][10].ToString(); //ddlcargo.SelectedValue = dt1.Rows[0][11].ToString(); //ddltipodedocumento.SelectedValue = dt1.Rows[0][12].ToString(); //ddllocalidad.SelectedValue = dt1.Rows[0][13].ToString(); //tbusuario.Text = tbemail.Text; //tbcontraseña.Text = tbnumerodocumento.Text; //EditDni = tbnumerodocumento.Text; }
protected void gridplanes_SelectedIndexChanged(object sender, EventArgs e) { //cuando seleccionamos una fila del grid try { //mostrar un panel y ocultar otro panelconsulta.Visible = false; paneledicion.Visible = true; paneledicion.Focus(); //codigo para cargar los valores de la fila en los textbox del panel de edicion TheGym k = new TheGym { IdSucursalCarga = gridplanes.SelectedRow.Cells[0].Text }; DataTable dt1 = new DataTable(); dt1 = k.GetOneSucursalID(); ID1 = dt1.Rows[0][0].ToString(); TextBox1.Text = dt1.Rows[0][1].ToString(); tbtelefono.Text = dt1.Rows[0][2].ToString(); tbcalle.Text = dt1.Rows[0][3].ToString(); tbbarrio.Text = dt1.Rows[0][4].ToString(); tbnumerocasa.Text = dt1.Rows[0][5].ToString(); ddllocalidad.SelectedValue = dt1.Rows[0][6].ToString(); TextBox1.Enabled = false; tbtelefono.Enabled = false; tbcalle.Enabled = false; tbbarrio.Enabled = false; tbnumerocasa.Enabled = false; ddllocalidad.Enabled = false; } catch (Exception ex) { lblerror.Text = ex.Message.ToString(); } }
protected void btnaceptar0_Click(object sender, EventArgs e) { try { SaveEmpeladoFoto(); TheGym k = new TheGym { NombreEmpladoIns = tbnombre0.Text, ApellidoEmpleadoIns = tbapellido0.Text, FechaNacEmpleadoIns = Convert.ToDateTime(tbfechanacimiento2.Text), EmailEmpleadoIns = tbemail1.Text, FotoEmpleadoIns = "~/ImagenesSistema/" + fuImage.FileName, TelefEmpleadoIns = Convert.ToInt64(tbtelefono1.Text), DomicilioEmpleadoIns = tbdireccion.Text, DNIEmpleadoIns = Convert.ToInt32(tbdni0.Text), FechaContEmpleadoIns = Convert.ToDateTime(tbfechacontratacion0.Text), TitulEmpleadoIns = tbtitulo.Text, ExperEmpleadoIns = tbexperiencia.Text, CargoEmpleadoIns = Convert.ToInt32(ddlcargo.SelectedItem.Value), }; k.AddNewEmpleado(); tbnombre0.Text = string.Empty; tbapellido0.Text = string.Empty; tbdireccion.Text = string.Empty; tbdni0.Text = string.Empty; tbemail1.Text = string.Empty; tbexperiencia.Text = string.Empty; tbfechacontratacion0.Text = string.Empty; tbfechanacimiento2.Text = string.Empty; tbtelefono1.Text = string.Empty; tbtitulo.Text = string.Empty; LblReg.Text = ("Empleado registrado con éxito."); } catch (Exception ex) { LblReg.Text = ex.Message.ToString(); } }
protected void btnconsultar_Click(object sender, EventArgs e) { //aqui se debe buscar sobre el gridview de propiedas por productos gridsucursales.Visible = true; TheGym k = new TheGym(); k.NomSucBuscar = tbnombre.Text; DataTable dt = k.GetOneSucursal(); TablaDeposito = dt; if (dt.Rows.Count > 0) { gridsucursales.DataSource = dt; gridsucursales.DataBind(); gridsucursales.Focus(); } }
protected void CargarServicios() { lblerror.Visible = false; TheGym k = new TheGym(); DataTable dt = new DataTable(); dt = k.GetServicios(); if (dt.Rows.Count > 0) { ddlservicio.DataTextField = "Nombre"; ddlservicio.DataValueField = "Id_servicio"; ddlservicio.DataSource = dt; ddlservicio.DataBind(); ddlservicio.Items.Insert(0, "--Seleccione--"); } else { lblerror.Visible = true; lblerror.Text = "No se encontraron servicios"; } }