Beispiel #1
0
        private void btRegistrar_Click(object sender, EventArgs e)
        {
            Datos2 d = new Datos2();

            d.fecha1     = txtMes.Text;
            d.fecha2     = txtAño.Text;
            d.montoTotal = Convert.ToInt32(txtMontoTotal.Text);

            FuncionesProcesos fp = new FuncionesProcesos();

            fp.RegistrarNomina(d);
            CargarDatos();
        }
Beispiel #2
0
        private void btRegistrar_Click(object sender, EventArgs e)
        {
            Datos2 d = new Datos2();

            d.codigoEmpleado = Convert.ToInt32(txtCodigoEmpleado.Text);
            d.fecha1         = txtInicioFecha.Text;
            d.fecha2         = txtFinFecha.Text;
            d.año            = txtAño.Text;
            d.comentario     = txtComentario.Text;

            FuncionesProcesos fp = new FuncionesProcesos();

            fp.RegistrarPermisos(d);
            CargarDatos();
        }
 public void RegistrarNomina(Datos2 de)
 {
     try
     {
         using (SqlConnection conn = Conexion.Conectar())
         {
             SqlCommand registrar = new SqlCommand(string.Format("Insert into Nominas" +
                                                                 "(Mes, " +
                                                                 "Año, " +
                                                                 "Monto_Total) " +
                                                                 "values ('{0}', '{1}', '{2}')" +
                                                                 "", de.fecha1, de.fecha2, de.montoTotal), conn);
             registrar.ExecuteNonQuery();
             conn.Close();
         }
     }
     catch (Exception s)
     {
         MessageBox.Show("Ha ocurrido un error", "Error " + s.Message);
     }
 }
 public void RegistrarPermisos(Datos2 de)
 {
     try
     {
         using (SqlConnection conn = Conexion.Conectar())
         {
             SqlCommand registrar = new SqlCommand(string.Format("Insert into Permiso" +
                                                                 "(Codigo_Empleado, " +
                                                                 "Inicio_Fecha," +
                                                                 "Fin_Fecha," +
                                                                 "Año, " +
                                                                 "Comentario) " +
                                                                 "values ('{0}', '{1}', '{2}', '{3}', '{4}')" +
                                                                 "", de.codigoEmpleado, de.fecha1, de.fecha2, de.año, de.comentario), conn);
             registrar.ExecuteNonQuery();
             conn.Close();
         }
     }
     catch (Exception s)
     {
         MessageBox.Show("Ha ocurrido un error", "Error " + s.Message);
     }
 }