private void dataGridView1_CellContentClick(object sender, DataGridViewCellEventArgs e) { ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient(); id = Convert.ToInt32(textBox1.Text); DateTime fecha = dateTimePicker1.Value; fecha_res = fecha.ToShortDateString(); String nomPaciente = ws.GetNombrePaciente(id); MessageBox.Show("Reserva Seleccionada", "Mensaje"); //panel2.Visible = false; panel1.Visible = true; DataSet ds = ws.DatoMedico(idEspecialidad); String idmedico = ds.Tables["Medico"].Rows[0][0].ToString(); idm = Convert.ToInt32(idmedico); String nombreM = ds.Tables["Medico"].Rows[0][2].ToString() + " " + ds.Tables["Medico"].Rows[0][3].ToString(); textBox2.Text = nomPaciente; textBox3.Text = nombreM; textBox4.Text = fecha_res; }
private void Asignar_Medico_Click(object sender, EventArgs e) { ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient(); if (!string.IsNullOrEmpty(textBox1.Text)) { String especialidad = comboBox1.Text; if (especialidad.Equals("Traumatologia")) { idEspecialidad = 1; } else if (especialidad.Equals("Urologia")) { idEspecialidad = 2; } else if (especialidad.Equals("Cardiologia")) { idEspecialidad = 3; } else { idEspecialidad = 4; } this.dataGridView1.DataSource = ws.listaHorarios(idEspecialidad); this.dataGridView1.DataMember = "horarioAtencio"; //int res_In = ws.InsertarReserva(); //textBox2.Text = idEspecialidad.ToString(); panel2.Visible = true; } else { MessageBox.Show("COMPLETAR CORRECTAMENTE EL CAMPO", "Error"); } }
private void Registrar_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(textBox1.Text)) { int ci = Convert.ToInt32(textBox1.Text); String nom = textBox2.Text; String ape = textBox3.Text; DateTime fecha = dateTimePicker1.Value; String fecha_nac = fecha.ToShortDateString(); String sexo = comboBox1.Text; ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient(); int res = ws.InsertarPaciente(ci, nom, ape, fecha_nac, sexo); if (res == 0) { MessageBox.Show("REGISTRO CON EXITO", "MENSAJE"); } else { MessageBox.Show("OCURRIO UN ERROR", "Error"); } } else { MessageBox.Show("COMPLETAR CORRECTAMENTE EL CAMPO", "Error"); } }
private void MostarLista_Click(object sender, EventArgs e) { ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient(); this.dataGridView1.DataSource = ws.ListaReservas(); this.dataGridView1.DataMember = "Medico"; ///this.dataGridView1.DataSource = ws.listaPacientes(); //this.dataGridView1.DataMember = "Paciente"; }
private void Res_cita_Click(object sender, EventArgs e) { ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient(); if (!string.IsNullOrEmpty(textBox5.Text)) { int res = ws.InsertarReserva(id, idm, textBox5.Text, fecha_res); if (res == 0) { MessageBox.Show("REGISTRO CON EXITO", "mesaje"); } else { MessageBox.Show("OCURRIO UN ERROR", "mesaje"); } } else { MessageBox.Show("COMPLETAR CORRECTAMENTE EL CAMPO", "Error"); } }
private void ListaPaciente_Click(object sender, EventArgs e) { ServiceReference1.WebService1SoapClient ws = new ServiceReference1.WebService1SoapClient(); this.dataGridView1.DataSource = ws.listaPacientes(); this.dataGridView1.DataMember = "Paciente"; }