public void CargarFarmacos() { List <Farmaco> list = new List <Farmaco>(); WSFarmaco wsfarmaco = new WSFarmaco(); list = wsfarmaco.ListFarmaco(); this.farmaco.DataSource = list; this.farmaco.DataValueField = "idVademecum"; this.farmaco.DataTextField = "nombre_comercial"; this.farmaco.DataBind(); this.farmaco.Items.Insert(0, new ListItem("-- Seleccione un fármaco")); }
public void CargarFarmacos() { List <Farmaco> list = new List <Farmaco>(); // ACCEDIENDO AL WEB SERVICE WSFarmaco wsfarmaco = new WSFarmaco(); list = wsfarmaco.ListFarmaco(); this.farmaco.DataSource = list; this.farmaco.DataValueField = "idVademecum"; this.farmaco.DataTextField = "nombre_comercial"; this.farmaco.DataBind(); this.farmaco.Items.Insert(0, new ListItem("-- SELECCIONE EL FÁRMACO --")); }
public List <Farmaco> ListVademecum() { List <Farmaco> list; try { WSFarmaco wsfarmaco = new WSFarmaco(); list = wsfarmaco.ListFarmaco(); } catch (Exception e) { throw e; } return(list); }
protected void BtnInsert_Click(object sender, EventArgs e) { // REGISTRO DE VADEMECUM Farmaco objFarmaco = GetValues(); WSFarmaco wsfarmaco = new WSFarmaco(); bool response = wsfarmaco.InsertFarmaco(objFarmaco); if (response) { this.divSuccess.Visible = true; this.TextSuccess.Text = "¡Fármaco creado con éxito!"; } else { this.divError.Visible = true; this.TextError.Text = "¡El fármaco no fue creado!"; } }