private void capturar_huella_button_Click(object sender, EventArgs e)
 {
     if (id_instructor != 0)
     {
         Leer_Huella frm = new Leer_Huella(id_instructor, false);
         //Stop();
         frm.ShowDialog();
     }
     else
     {
         MessageBox.Show("Registre o busque cliente", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }
Beispiel #2
0
 private void capturar_huella_button_Click(object sender, EventArgs e)
 {
     try
     {
         if (id_cliente != 0)
         {
             Leer_Huella frm = new Leer_Huella(id_cliente, true);
             //Stop();
             frm.ShowDialog();
         }
         else
         {
             MessageBox.Show("Registre o busque cliente", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
     }
     catch (Exception ex)
     {
         (new ObjectBase()).LogError(ex.Message + ex.StackTrace);
     }
 }
Beispiel #3
0
        private void registrar_button_Click(object sender, EventArgs e)
        {
            if (VerificarCamposVacios(listCampos) || sexo_comboBox.Text == "Seleccione el sexo" || myimage == null || telefono_celular_textBox.MaskFull == false)
            {
                MessageBox.Show("Quedan campos vacios", "Information", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                MemoryStream IO = new MemoryStream();
                myimage.Save(IO, ImageFormat.Jpeg);

                if (id_cliente == 0)
                {
                    Catalogo_Clientes cataClie = new Catalogo_Clientes();

                    cataClie.apellido_paterno = apellido_paterno_textBox.Text;
                    cataClie.apellido_materno = apellido_materno_textBox.Text;
                    cataClie.nombre           = nombre_textBox.Text;
                    cataClie.fecha_nacimiento = Convert.ToDateTime(fecha_nacimiento_dateTimePicker.Text);
                    cataClie.sexo             = sexo_comboBox.Text;
                    cataClie.edad             = calcular_edad();
                    cataClie.calle            = calle_textBox.Text;
                    cataClie.numero           = numero_textBox.Text;
                    cataClie.colonia          = colonia_textBox.Text;
                    cataClie.correo           = correo_textBox.Text;
                    //cataClie.telefono = telefono_fijo_textBox.Text;
                    cataClie.celular       = telefono_celular_textBox.Text;
                    cataClie.fecha_ingreso = DateTime.Now;
                    cataClie.estatus       = false;
                    cataClie.foto          = IO.ToArray();
                    cataClie.tipo_sangre   = tipo_sangre_textBox.Text;
                    cataClie.id_grupo      = 0;

                    cataClie.alergias = alergias_comboBox.Text;

                    contexto.Catalogo_Clientes.Add(cataClie);

                    contexto.SaveChanges();

                    id_cliente = cataClie.id_cliente;

                    encabezado_label.Text = "EDITAR INFORMACION CLIENTE";
                    registrar_button.Text = "Actualizar";

                    MessageBox.Show("Cliente registrado ", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);

                    Leer_Huella frm = new Leer_Huella(id_cliente, true);
                    //Stop();
                    frm.ShowDialog();
                }
                else if (id_cliente != 0)
                {
                    var estatus = contexto.sp_Buscar_Clientes_Id(id_cliente).ToList();

                    contexto.sp_Actualizar_Cliente(id_cliente, nombre_textBox.Text, apellido_paterno_textBox.Text, apellido_materno_textBox.Text, Convert.ToDateTime(fecha_nacimiento_dateTimePicker.Text), sexo_comboBox.Text,
                                                   calcular_edad(), calle_textBox.Text, numero_textBox.Text, colonia_textBox.Text, correo_textBox.Text, telefono_celular_textBox.Text, IO.ToArray(), estatus[0].estatus);

                    MessageBox.Show("Informacion Actualizada", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
        }