Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- VIEWMODELS
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using Empresa_adm.Models;
- namespace Empresa_adm.ViewModels
- {
- public class AgregarEmpleadoViewModel
- {
- public Empleado empleado { get; set; }
- public List<Categoria> categorias { get; set; }
- public List<EstadoCivil> estadosCiviles { get; set; }
- }
- }
- EDITARWIESMODELS
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using Empresa_adm.Models;
- namespace Empresa_adm.ViewModels
- {
- public class EditarSolicitudLicenciaViewModel
- {
- public SolicitudLicencia solicitudLicencia { get; set; }
- public List<TipoLicencia> tiposLicencias { get; set; }
- public List<Empleado> empleados { get; set; }
- }
- }
- AGREGAR
- @using Empresa_adm.ViewModels;
- @using Empresa_adm.Models;
- @model AgregarEmpleadoViewModel
- @{
- ViewBag.Title = "Agregar";
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>Agregar empleado</title>
- <link href="~/Content/empresa_adm_estilos.css" rel="stylesheet" />
- </head>
- <body>
- <h2>Agregar empleado</h2>
- <table>
- @Html.ValidationSummary()
- @using (Html.BeginForm())
- {
- <tr><td>Nombre</td><td>@Html.TextBoxFor(a => a.empleado.Nombre)</td></tr>
- <tr><td rowspan=2>Sexo </td><td>@Html.RadioButtonFor(a => a.empleado.Sexo, true) Masculino </td></tr>
- <tr> <td>@Html.RadioButtonFor(a => a.empleado.Sexo, false) Femenino <td></tr>
- <tr>
- <td>@Html.LabelFor(a => a.empleado.IdCategoria)</td>
- <td>
- @Html.DropDownListFor(a => a.empleado.IdCategoria,
- new SelectList(@Model.categorias, "idCategoria", "nombreCategoria"))
- </td>
- </tr>
- <tr>
- <td>@Html.LabelFor(a => a.empleado.IdEstadoCivil)</td>
- <td>
- @Html.DropDownListFor(a => a.empleado.IdEstadoCivil,
- new SelectList(@Model.estadosCiviles, "idEstadoCivil", "nombreEstadoCivil"))
- </td>
- </tr>
- <tr><td>Cantidad de hijos</td><td>@Html.TextBoxFor(a => a.empleado.CantidadHijos)</td></tr>
- <tr><td>Sueldo diario promedio</td><td>@Html.TextBoxFor(a => a.empleado.SueldoDiarioPromedio)</td></tr>
- <tr><td></td><td><input type="submit" value="Agregar" /></td></tr>
- }
- </table>
- <br />
- <a href="/Empleados/AdministracionEmpleados">Volver</a>
- <br />
- </body>
- </html>
- CONSULTAR
- @model Empresa_adm.Models.Empleado
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>Consultar empleado</title>
- <link href="~/Content/empresa_adm_estilos.css" rel="stylesheet" />
- </head>
- <body>
- @if (Model != null)
- {
- <h1>Consulta de empleado (codigo=@Model.IdLegajo)</h1>
- <table>
- <tr><td>Legajo</td><td>@Model.IdLegajo</td></tr>
- <tr><td>Nombre</td><td>@Model.Nombre</td></tr>
- <tr><td>Sexo</td><td>@Model.sexoToString()</td></tr>
- <tr><td>Categoria</td><td>@Model.categoriaToString()</td></tr>
- <tr><td>Estado civil</td><td>@Model.estadoCivilToString()</td></tr>
- <tr><td>Cantidad de hijos</td><td>@Model.CantidadHijos</td></tr>
- <tr><td>Sueldo diario promedio</td> <td>@Model.SueldoDiarioPromedio</td></tr>
- </table>
- }
- else
- {
- <h1>El empleado no existe</h1>
- }
- <br />
- <a href="/Empleados/AdministracionEmpleados">Volver</a>
- <br />
- </body>
- </html>
- EDITAR
- @using Empresa_adm.ViewModels;
- @using Empresa_adm.Models;
- @model EditarEmpleadoViewModel
- @{
- ViewBag.Title = "Editar";
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>Editar empleado</title>
- <link href="~/Content/empresa_adm_estilos.css" rel="stylesheet" />
- </head>
- <body>
- <h2>Editar empleado</h2>
- <table>
- @Html.ValidationSummary()
- @using (Html.BeginForm())
- {
- <tr><td>Legajo</td><td>@Html.TextBoxFor(modelo => modelo.empleado.IdLegajo, new { @readonly = true }) </td></tr>
- <tr><td>Nombre</td><td>@Html.TextBoxFor(m => m.empleado.Nombre)</td></tr>
- <tr><td rowspan=2>Sexo </td><td>@Html.RadioButtonFor(m => m.empleado.Sexo, true) Masculino </td></tr>
- <tr> <td>@Html.RadioButtonFor(m => m.empleado.Sexo, false) Femenino <td></tr>
- <tr>
- <td>@Html.LabelFor(m => m.empleado.IdCategoria)</td>
- <td>
- @Html.DropDownListFor(m => m.empleado.IdCategoria,
- new SelectList(@Model.categorias, "IdCategoria", "nombreCategoria"))
- </td>
- </tr>
- <tr>
- <td>@Html.LabelFor(m => m.empleado.IdEstadoCivil)</td>
- <td>
- @Html.DropDownListFor(m => m.empleado.IdEstadoCivil,
- new SelectList(@Model.estadosCiviles, "IdEstadoCivil", "nombreEstadoCivil"))
- </td>
- </tr>
- <tr><td>Cantidad de hijos</td><td>@Html.TextBoxFor(m => m.empleado.CantidadHijos)</td></tr>
- <tr><td>Sueldo diario promedio</td><td>@Html.TextBoxFor(m => m.empleado.SueldoDiarioPromedio)</td></tr>
- <tr><td></td><td><input type="submit" value="Modificar" /></td></tr>
- }
- </table>
- <br />
- <a href="/Empleados/AdministracionEmpleados">Volver</a>
- <br />
- </body>
- </html>
- LISTAR
- @using Empresa_adm.Models;
- @model List<Empleado>
- @{
- ViewBag.Title = "Listar";
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>Listado de empleados</title>
- <link href="~/Content/empresa_adm_estilos.css" rel="stylesheet" />
- </head>
- <body>
- <h1>Listado completo de empleados </h1>
- <table>
- <tr><th colspan="10">Listado de empleados</th></tr>
- <tr>
- <td>Legajo</td>
- <td>Empleado</td>
- <td>Sexo</td>
- <td>Categoría</td>
- <td>Estado civil</td>
- <td>Cantidad de hijos</td>
- <td>Sueldo diario promedio</td>
- <td>Consultar empleado</td>
- <td>Editar empleado</td>
- <td>Eliminar empleado</td>
- </tr>
- @foreach (Empleado e in Model)
- {
- <tr>
- <td>@e.IdLegajo</td>
- <td>@e.Nombre</td>
- <td>@e.sexoToString()</td>
- <td>@e.categoriaToString()</td>
- <td>@e.estadoCivilToString()</td>
- <td>@e.CantidadHijos</td>
- <td>@e.SueldoDiarioPromedio</td>
- <td><a href="/Empleados/Consultar/@e.IdLegajo">Consultar</a></td>
- <td><a href="/Empleados/Editar/@e.IdLegajo">Editar</a></td>
- <td><a href="/Empleados/Eliminar/@e.IdLegajo">Eliminar</a></td>
- </tr>
- }
- </table>
- <br />
- <a href="/Empleados/Agregar">Agregar Empleado</a>
- <br />
- <br />
- <a href="/Empleados/AdministracionEmpleados">Volver</a>
- <br />
- </body>
- </html>
- INDEX
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>Index</title>
- </head>
- <body>
- <h1>Menú de personas</h1>
- <div>
- <a href="/Personas/Listar">Listado de personas</a>
- <a href="/Personas/ReporteMayores">Listado de mayores de edad</a>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement