コード例 #1
0
 private void btn_Cerrar_Click(object sender, EventArgs e)
 {
     if (txt_direccion.Text != "" && txt_nombre.Text != "" && mtx_apertura.Text != "" && mtx_cierre.Text != "" && mtx_Telefono.Text != "" && mtx_Cajones.Text != "")
     {
         Sucursal_BO sucursal = new Sucursal_BO();
         sucursal.Nombre            = txt_nombre.Text;
         sucursal.Direccion         = txt_direccion.Text;
         sucursal.Horario_apaertura = mtx_apertura.Text;
         sucursal.Horario_cierre    = mtx_cierre.Text;
         sucursal.Numerotelefonico  = mtx_Telefono.Text;
         sucursal.Cantidad_Cajones  = int.Parse(mtx_Cajones.Text);
         Sucursal_DAO sucursal_nube = new Sucursal_DAO();
         int          respuesta     = sucursal_nube.Guardar_Datos(sucursal);
         if (respuesta == 0)
         {
             frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("Intente de nuevo en un momento");
             ERROR.ShowDialog();
         }
         else
         {
             frm_pruebaDialog EXITO = new frm_pruebaDialog();
             EXITO.ShowDialog();
         }
     }
     else
     {
         frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("Verifique llenar los campos");
         ERROR.ShowDialog();
     }
 }
コード例 #2
0
 private void btn_actualizar_Click(object sender, EventArgs e)
 {
     if (mtx_Sueldo.Text != "" && txt_apellido1.Text != "" && txt_apellido2.Text != "" && txt_nombre.Text != "" && cbx_Cargo.Text != "Seleccione" && txt_correo.Text != "" && txt_contraseña.Text != "")
     {
         Empleado_DAO crear     = new Empleado_DAO();
         Sucursal_DAO verificar = new Sucursal_DAO();
         Empleado_BO  nuevo     = new Empleado_BO();
         nuevo.Nombre       = txt_nombre.Text;
         nuevo.Apellido_11  = txt_apellido1.Text;
         nuevo.Apellido_21  = txt_apellido2.Text;
         nuevo.Salario_Base = int.Parse(mtx_Sueldo.Text);
         nuevo.Id_Empleado  = id_empleado;
         nuevo.Id_sucursal  = idsucu;
         try
         {
             byte[] imgbytes = Convertir_Imagen_Bytes(user);
             nuevo.Imagen = Convert.ToBase64String(imgbytes);
         }
         catch
         {
         }
         if (rbx_Matutino.Checked)
         {
             nuevo.Horario_Trabajo1 = rbx_Matutino.Text;
         }
         else
         {
             nuevo.Horario_Trabajo1 = rbx_Vespertino.Text;
         }
         nuevo.Correo_Electronico1 = txt_correo.Text;
         nuevo.Clave_Sesion1       = txt_contraseña.Text;
         try
         {
             nuevo.Puesto = verificar.Asignar_Puesto(cbx_Cargo.Text);
         }
         catch (Exception ex)
         {
             frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("Intente nuevamente");
             ERROR.ShowDialog();
         }
         int guardar = crear.Actualizar_Datos(nuevo);
         if (guardar == 0)
         {
             frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("Intente nuevamente");
             ERROR.ShowDialog();
         }
         else
         {
             frm_pruebaDialog exito = new frm_pruebaDialog();
             exito.ShowDialog();
             Limpiar_campos();
             dgv_Empleados.DataSource = ejecutar.tabla_empleado();
         }
     }
     else
     {
         frm_ERROR_DIALOG ERROR = new frm_ERROR_DIALOG("llene todos los campos");
         ERROR.ShowDialog();
     }
 }
コード例 #3
0
        private void frm_AdminRecibos_Load(object sender, EventArgs e)
        {
            ArrayList  tipos  = new ArrayList();
            Recibo_DAO recibo = new Recibo_DAO();

            try
            {
                tipos = recibo.lista_tiposRecivo();
                for (int x = 0; x < tipos.Count; x++)
                {
                    cmb_tipo.Items.Add(tipos[x].ToString());
                }
                if (id_sucu < 1)
                {
                    Sucursal_DAO sucu = new Sucursal_DAO();
                    tipos = sucu.lista_Sucursales();
                    for (int y = 0; y < tipos.Count; y++)
                    {
                        cmb_sucursales.Items.Add(tipos[y].ToString());
                    }
                }
            }
            catch
            {
                frm_ERROR_DIALOG error = new frm_ERROR_DIALOG("inicie el programa de nuevo");
                error.ShowDialog();
            }
        }