private void btnBuscar_Click(object sender, EventArgs e)
 {
     frmBuscaPacientes frm = new frmBuscaPacientes();
     frm.ShowDialog();
     pac = frm.u;
     if (pac != null)
     {
         txtPaciente.Text = pac.Paciente;
     }
 }
Esempio n. 2
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaPacientes frm = new frmBuscaPacientes();
         frm.ShowDialog();
         Pacientes u = frm.u;
         if (u != null)
         {
             txtPaciente.Text = u.Paciente;
             txtTelefono.Text = u.Telefono + " " + u.Celular;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Esempio n. 3
0
 private void btnBuscar_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaPacientes frm = new frmBuscaPacientes();
         frm.ShowDialog();
         pac = frm.u;
         if (pac != null)
         {
             Acceso_BD oac = new Acceso_BD();
             DataTable dt = oac.leerDatos("select ifnull(sum(case when tipocomp = 1 then importe else importe * (-1) end),0) as saldo from ctacte where idpacientes = '" + pac.Idpacientes + "'");
             decimal saldo = 0;
             foreach (DataRow dr in dt.Rows)
             {
                 saldo = Convert.ToDecimal(dr["saldo"]);
             }
             if (saldo != 0)
             {
                 label11.Text = "SALDO: $" + saldo;
             }
             else
             {
                 label11.Text = "SALDO: $0.00";
             }
             txtPaciente.Text = pac.Paciente;
             txtPaciente.Enabled = false;
             txtDocumento.Text = pac.Documento;
             txtDocumento.Enabled = false;
             txtDomicilio.Text = pac.Domicilio;
             txtDomicilio.Enabled = false;
             button1.Focus();
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 4
0
 private void btnCliente_Click(object sender, EventArgs e)
 {
     try
     {
         if (Convert.ToDateTime(txtFecha.Text).Date == DateTime.Now.Date && prof != null && esp != null)
         {
             frmBuscaPacientes frm = new frmBuscaPacientes();
             frm.ShowDialog();
             Pacientes p = frm.u;
             if (p != null)
             {
                 frmBuscaServicio frm1 = new frmBuscaServicio(p.Idpacientes.ToString(), "0");
                 frm1.ShowDialog();
                 Servicios s = frm1.u;
                 if (s != null)
                 {
                     DialogResult dialogResult = MessageBox.Show("Esta seguro de confirmar la asistencia al curso del Cliente: "+p.Paciente, "Eliminar Producto", MessageBoxButtons.YesNo);
                     if (dialogResult == DialogResult.Yes)
                     {
                         Acceso_BD oacceso = new Acceso_BD();
                         oacceso.ActualizarBD("begin; update servicios set usadas = usadas + 1 where idservicios = '" + s.Idservicios + "'; insert into cursos (idprofesionales, idservicios, idpacientes, sesion, fecha) values ('" + prof.Idprofesionales + "','" + s.Idservicios + "','" + p.Idpacientes + "','" + (s.Usadas + 1) + "/" + s.Sesiones + "','" + DateTime.Now.ToString("yyyy-MM-dd") + "'); commit;");
                         MessageBox.Show("Cliente y servicio cargado exitosamente");
                         prof = null;
                         esp = null;
                         btnCliente.Enabled = false;
                         cmbEspecialidades.SelectedValue = 0;
                         dataGridView1.DataSource = null;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 5
0
 private void button1_Click(object sender, EventArgs e)
 {
     try
     {
         frmBuscaPacientes frm = new frmBuscaPacientes();
         frm.ShowDialog();
         p = frm.u;
         if (p != null)
         {
             textBox1.Text = p.Paciente;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
 private void frmHistorialCliente_Load(object sender, EventArgs e)
 {
     dataGridView1.ColumnCount = 4;
     dataGridView1.Columns[0].Name = "Fecha";
     dataGridView1.Columns[1].Name = "Profesional";
     dataGridView1.Columns[2].Name = "Servicio";
     dataGridView1.Columns[3].Name = "Regalo de";
     frmBuscaPacientes frm = new frmBuscaPacientes();
     frm.ShowDialog();
     pac = frm.u;
     if (pac != null)
     {
         txtPaciente.Text = pac.Paciente;
     }
     else
     {
         this.Close();
     }
 }
Esempio n. 7
0
 private void btnAgregarServ_Click(object sender, EventArgs e)
 {
     try
     {
         if (!chkRegalo.Checked)
         {
             if (txtProducto.Text == "")
             {
                 frmBuscaServicio frm = new frmBuscaServicio(t.Paciente,"0");
                 frm.ShowDialog();
                 serv = frm.u;
                 string ses = frm.sesion;
                 if (serv != null)
                 {
                     txtProducto.Text = serv.Detalle;
                     DialogResult dialogResult = MessageBox.Show("Esta seguro de Agregar el Servicio del turno?", "Agregar Servicio del Turno", MessageBoxButtons.YesNo);
                     if (dialogResult == DialogResult.Yes)
                     {
                         DataTable dt = oacceso.leerDatos("start transaction; insert into serviciosturnos (idprofesionales, idservicios, fecha, hora, idpacientes, sesion) values ('" + t.Profesionales.Idprofesionales + "','" + serv.Idservicios + "','" + fechaa.ToString("yyyy-MM-dd") + "','" + t.Hora + "','" + t.Paciente + "','" + ses + "'); update servicios set usadas = usadas + 1 where idservicios = '" + serv.Idservicios + "'; select max(idserviciosturnos) as idservt from serviciosturnos; commit;");
                         oacceso.ActualizarBD("insert into seguimientos (idprofesionales, dia, hora, detalle, idturnos, fechareal, idusuarios) values ( '" + t.Profesionales.Idprofesionales + "','" + fechaa.ToString("yyyy-MM-dd") + "','" + t.Hora + "','Agrego servicio: " + serv.Detalle + "','0','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','0')");
                         foreach (DataRow dr in dt.Rows)
                         {
                             idserviciosturnos = Convert.ToInt32(dr["idservt"]);
                         }
                         MessageBox.Show("Servicio agregado correctamente");
                         idservicios = serv.Idservicios;
                         if (fechaa == DateTime.Now.Date)
                         {
                             btnGuardar.Visible = true;
                         }
                         btnEliminarServ.Enabled = true;
                         btnAgregarServ.Enabled = false;
                         btnBuscarPac.Enabled = false;
                     }
                 }
             }
         }
         else
         {
             if (txtProducto.Text == "")
             {
                 frmBuscaPacientes frm1 = new frmBuscaPacientes();
                 frm1.ShowDialog();
                 Pacientes p1 = frm1.u;
                 if (p1 != null)
                 {
                     frmBuscaServicio frm = new frmBuscaServicio(p1.Idpacientes.ToString(),"1");
                     frm.ShowDialog();
                     serv = frm.u;
                     string ses = frm.sesion;
                     if (serv != null)
                     {
                         txtProducto.Text = serv.Detalle;
                         DialogResult dialogResult = MessageBox.Show("Esta seguro de Agregar el Servicio del turno?", "Agregar Servicio del Turno", MessageBoxButtons.YesNo);
                         if (dialogResult == DialogResult.Yes)
                         {
                             DataTable dt = oacceso.leerDatos("start transaction; insert into serviciosturnos (idprofesionales, idservicios, fecha, hora, idpacientes, sesion) values ('" + t.Profesionales.Idprofesionales + "','" + serv.Idservicios + "','" + fechaa.ToString("yyyy-MM-dd") + "','" + t.Hora + "','" + t.Paciente + "','" + ses + "'); update servicios set usadas = usadas + 1 where idservicios = '" + serv.Idservicios + "'; select max(idserviciosturnos) as idservt from serviciosturnos; commit;");
                             oacceso.ActualizarBD("insert into seguimientos (idprofesionales, dia, hora, detalle, idturnos, fechareal, idusuarios) values ( '" + t.Profesionales.Idprofesionales + "','" + fechaa.ToString("yyyy-MM-dd") + "','" + t.Hora + "','Agrego servicio: " + serv.Detalle + "','0','" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss") + "','0')");
                             foreach (DataRow dr in dt.Rows)
                             {
                                 idserviciosturnos = Convert.ToInt32(dr["idservt"]);
                             }
                             MessageBox.Show("Servicio agregado correctamente");
                             idservicios = serv.Idservicios;
                             if (fechaa == DateTime.Now.Date)
                             {
                                 btnGuardar.Visible = true;
                             }
                             btnEliminarServ.Enabled = true;
                             btnAgregarServ.Enabled = false;
                         }
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 8
0
 private void btnBuscarPac_Click(object sender, EventArgs e)
 {
     try
     {
         Pacientes p = null;
         frmBuscaPacientes frm = new frmBuscaPacientes();
         frm.ShowDialog();
         p = frm.u;
         if (p != null)
         {
             t.Paciente = p.Idpacientes.ToString();
             pac = p.Paciente;
             oacceso.ActualizarBD("update turnos set idpacientes = '" + p.Idpacientes + "' where idturnos = '" + idt + "'");
             frmDatosTurno_Load(sender, e);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
 }
Esempio n. 9
0
 private void button2_Click(object sender, EventArgs e)
 {
     try
     {
         deshabilitar();
         limpiar();
         frmBuscaPacientes frm = new frmBuscaPacientes();
         frm.ShowDialog();
         Pacientes u = frm.u;
         if (u != null)
         {
             lblId.Text = Convert.ToString(u.Idpacientes);
             txtPaciente.Text = u.Paciente;
             txtDocumento.Text = u.Documento;
             txtDomicilio.Text = u.Domicilio;
             txtTelefono.Text = u.Telefono;
             txtCelular.Text = u.Celular;
             txtComentarios.Text = u.Comentarios;
             txtMail.Text = u.Mail;
             cmbTipoDoc.Text = u.Tipod.Detalle;
             if (u.Activo == 0)
             {
                 chkActivo.Checked = false;
                 //tabPageCargaEmpleados.BackColor = Color.LightCoral;
             }
             else if (u.Activo == 1)
             {
                 chkActivo.Checked = true;
                 //tabPageCargaEmpleados.BackColor = SystemColors.Info;
             }
             pbFotoUser.ImageLocation = u.Foto;
             lbl_foto.Text = u.Foto;
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error: " + ex.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }