public void CargarDoctores() { List <Doctor> list = new List <Doctor>(); WSDoctor wsdoctor = new WSDoctor(); list = wsdoctor.ListDoctor(); this.doctor.DataSource = list; this.doctor.DataValueField = "idDoctor"; this.doctor.DataTextField = "name"; this.doctor.DataBind(); this.doctor.Items.Insert(0, new ListItem("-- SELECCIONE UN DOCTOR --")); }
public List<Doctor> ListDoctors() { List<Doctor> list; try { // ACCEDIENDO AL WEB SERVICE WSDoctor wsdoctor = new WSDoctor(); list = wsdoctor.ListDoctor(); } catch (Exception e) { throw e; } return list; }
protected void BtnInsert_Click(object sender, EventArgs e) { // OBTENIENDO LOS DATOS DEL DOCTOR Doctor objDoctor = GetValues(); // ACCEDIENDO AL WEB SERVICE WSDoctor wsdoctor = new WSDoctor(); bool response = wsdoctor.InsertDoctor(objDoctor); if (response) { this.divSuccess.Visible = true; this.TextSuccess.Text = "¡Doctor creado con éxito!"; this.txtNumColegiado.Text = string.Empty; this.txtName.Text = string.Empty; this.txtAddress.Text = string.Empty; this.txtTelephone.Text = string.Empty; this.service.Items.Clear(); CargarServicios(); } else { this.divError.Visible = true; this.TextError.Text = "¡El doctor no fue creado!"; } }