예제 #1
0
        public void CargarPacientes()
        {
            List <Pacient> listPacientes = new List <Pacient>();
            WSPaciente     wspaciente    = new WSPaciente();

            listPacientes                = wspaciente.ListPaciente();
            this.paciente.DataSource     = listPacientes;
            this.paciente.DataValueField = "idPacient";
            this.paciente.DataTextField  = "name";
            this.paciente.DataBind();
            this.paciente.Items.Insert(0, new ListItem("-- SELECCIONE EL PACIENTE --"));
        }
예제 #2
0
        protected void BtnInsert_Click(object sender, EventArgs e)
        {
            // REGISTRANDO PACIENTE
            Pacient objPatient = GetValues();
            // ACCEDIENDO AL WEB SERVICE
            WSPaciente wspaciente = new WSPaciente();
            bool       response   = wspaciente.InsertPaciente(objPatient);

            if (response)
            {
                this.divSuccess.Visible = true;
                this.TextSuccess.Text   = "¡Paciente creado con éxito!";
                this.txtName.Text       = string.Empty;
                this.txtNumSocial.Text  = string.Empty;
                this.txtAddress.Text    = string.Empty;
                this.txtBirth.Text      = string.Empty;
                this.gender.Items.Clear();
            }
            else
            {
                this.divError.Visible = true;
                this.TextError.Text   = "¡El paciente no fue creado!";
            }
        }