Exemple #1
0
        private void InsertPaciente()
        {
            try
            {
                cs_sapbo     sapo     = new cs_sapbo();
                cs_pacientes paciente = new cs_pacientes();

                paciente.CardCode      = "";
                paciente.CardName      = txt_nombre.Text + " " + txt_apellido_paterno.Text + " " + txt_apellido_materno.Text;
                paciente.FirstName     = txt_nombre.Text;
                paciente.FirstSurname  = txt_apellido_paterno.Text;
                paciente.SecondSurname = txt_apellido_materno.Text;
                if (txt_edad.Text != "")
                {
                    paciente.Age = int.Parse(txt_edad.Text);
                }
                else
                {
                    paciente.Age = 0;
                }
                paciente.Birthday = txt_fecha_naci.Value.Date;
                paciente.Sex      = txt_sexo.Text;
                paciente.Phone1   = txt_telefono.Text;
                paciente.Cellular = txt_celular.Text;
                paciente.E_Mail   = txt_correo.Text;

                paciente = null;
                sapo     = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemple #2
0
        private void InsertPaciente()
        {
            try
            {
                cs_sapbo     sapo     = new cs_sapbo();
                cs_pacientes paciente = new cs_pacientes();

                paciente.CardCode     = txt_id_paciente.Text;
                paciente.CardName     = txt_nombre.Text + " " + txt_apellido_paterno.Text + " " + txt_apellido_materno.Text;
                paciente.CardType     = "A";
                paciente.CmpPrivate   = "C";
                paciente.FirstName    = txt_nombre.Text;
                paciente.FirstSurname = txt_apellido_paterno.Text;
                if (txt_edad.Text != "")
                {
                    paciente.Age = int.Parse(txt_edad.Text);
                }
                else
                {
                    paciente.Age = 0;
                }
                paciente.Birthday = txt_fecha_naci.Value.Date;
                paciente.Sex      = txt_sexo.Text;
                paciente.Phone1   = txt_telefono.Text;
                paciente.Cellular = txt_celular.Text;
                paciente.E_Mail   = txt_correo.Text;

                if (sapo.INSERT_PACIENTES(paciente) == false)
                {
                    MessageBox.Show("No se registro el paciente. " + sapo.MessageError);
                }

                paciente = null;
                sapo     = null;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }