protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { int id = (int)GridView1.SelectedValue; AgenciasViajesApi api = new AgenciasViajesApi(); Clientes cliente = api.SelectClienteById(id); GridView2.AutoGenerateColumns = true; GridView2.DataSource = cliente.Movimientos; GridView2.DataBind(); FormView1.ChangeMode(FormViewMode.Edit); FormView1.DataBind(); }
// GET api/clientes public HttpResponseMessage Get() { try { var body = new AgenciasViajesApi().SelectAllClientes(); if (body != null) { return(Request.CreateResponse(HttpStatusCode.OK, body)); } return(Request.CreateResponse(HttpStatusCode.NotFound)); } catch (Exception ex) { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(string.Format("Error: {0} -- Error Asociado{1}", ex.Message, ex.InnerException != null ? ex.InnerException.Message : "")) }; return(response); } }
public static IList <Clientes> SeleccionarClientes() { AgenciasViajesApi api = new AgenciasViajesApi(); return(api.SelectAllClientes()); }
protected void CustomValidatorCodigo_ServerValidate(object source, ServerValidateEventArgs args) { AgenciasViajesApi api = new AgenciasViajesApi(); args.IsValid = api.SelectAllVuelos().SingleOrDefault(p => p.Codigo == args.Value) == null; }