git-tfs-id: [http://192.168.1.10:8080/tfs/AyA]$/SINORT;C172
This commit is contained in:
parent
7a7179f83a
commit
22b0a507e9
13 changed files with 58 additions and 32 deletions
|
|
@ -8,6 +8,7 @@ using Microsoft.AspNet.Identity;
|
||||||
using Microsoft.AspNet.Identity.EntityFramework;
|
using Microsoft.AspNet.Identity.EntityFramework;
|
||||||
using AYA.SlnSinortModel.Sinort;
|
using AYA.SlnSinortModel.Sinort;
|
||||||
using AYA.SlnSinortModel.DAL.Sinort;
|
using AYA.SlnSinortModel.DAL.Sinort;
|
||||||
|
using System.Web.Routing;
|
||||||
|
|
||||||
namespace AYA.SlnSinort.Controllers
|
namespace AYA.SlnSinort.Controllers
|
||||||
{
|
{
|
||||||
|
|
@ -39,7 +40,17 @@ namespace AYA.SlnSinort.Controllers
|
||||||
{
|
{
|
||||||
public override void OnActionExecuting(ActionExecutingContext filterContext)
|
public override void OnActionExecuting(ActionExecutingContext filterContext)
|
||||||
{
|
{
|
||||||
|
bool inicioSesion = HttpContext.Current.Session["UserName"] != null;
|
||||||
|
|
||||||
|
if (!inicioSesion)
|
||||||
|
{
|
||||||
|
RouteValueDictionary redirectTargetDictionary = new RouteValueDictionary();
|
||||||
|
redirectTargetDictionary.Add("action", "Login");
|
||||||
|
redirectTargetDictionary.Add("controller", "Login");
|
||||||
|
|
||||||
|
filterContext.Result = new RedirectToRouteResult(redirectTargetDictionary);
|
||||||
|
}
|
||||||
|
|
||||||
base.OnActionExecuting(filterContext);
|
base.OnActionExecuting(filterContext);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using Atesa.Utilitarios;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Web;
|
using System.Web;
|
||||||
|
|
@ -15,5 +16,10 @@ namespace AYA.SlnSinort.Controllers.Login
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void InicioSesion(AtesaJSON model)
|
||||||
|
{
|
||||||
|
Session["UserName"] = model.AtesaUserName;
|
||||||
|
Session["FullName"] = model.AtesaUserFullName;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -81,7 +81,14 @@ this.IniciarSesion = function (data) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var uri = server + '/Login/InicioSesion'; //MODIFICAR ESTA LINEA
|
||||||
|
model = {
|
||||||
|
UserName: data.LoginUsuario,
|
||||||
|
FullName: null
|
||||||
|
};
|
||||||
|
|
||||||
|
AjaxPostData(uri, model, false, true, null, null, true);
|
||||||
|
|
||||||
|
//APLICAR REDIRECT A HOME CONTROLLER INDEX
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -1331,8 +1331,6 @@ this.ModalEvento = function (inicio,fin) {
|
||||||
this.Calendario = function (data) {
|
this.Calendario = function (data) {
|
||||||
|
|
||||||
$('#modalCalendario').modal('show');
|
$('#modalCalendario').modal('show');
|
||||||
$('#calendar').fullCalendar('destroy');
|
|
||||||
$('#calendar').fullCalendar('render');
|
|
||||||
$('#calendar').fullCalendar({
|
$('#calendar').fullCalendar({
|
||||||
selectable: true,
|
selectable: true,
|
||||||
eventLimit: true,
|
eventLimit: true,
|
||||||
|
|
@ -1342,4 +1340,10 @@ this.Calendario = function (data) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
$('#modalCalendario').on('loaded.bs.modal', function (e) {
|
||||||
|
$('#calendar').fullCalendar('render');
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -16,10 +16,10 @@
|
||||||
<link type="text/css" rel="stylesheet" href="~/Content/Customizacion.css" />
|
<link type="text/css" rel="stylesheet" href="~/Content/Customizacion.css" />
|
||||||
<link type="text/css" rel="stylesheet" href="~/Content/Principal.css" />
|
<link type="text/css" rel="stylesheet" href="~/Content/Principal.css" />
|
||||||
|
|
||||||
<script src="~/Scripts/modernizr-2.6.2.js"></script>
|
@*<script src="~/Scripts/modernizr-2.6.2.js"></script>
|
||||||
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
|
<script src="~/Scripts/jquery-3.3.1.min.js"></script>
|
||||||
<script src="~/Scripts/bootstrap.min.js"></script>
|
<script src="~/Scripts/bootstrap.min.js"></script>
|
||||||
@*<script src="~/Plugin/sweetalert/sweetalert.min.js"></script>*@
|
<script src="~/Plugin/sweetalert/sweetalert.min.js"></script>*@
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
|
|
@ -217,23 +217,20 @@
|
||||||
</footer>
|
</footer>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
@Styles.Render("~/Content/themes/base/css")
|
@Styles.Render("~/Content/themes/base/css")
|
||||||
@Styles.Render("~/Content/sinort-css")
|
@Styles.Render("~/Content/sinort-css")
|
||||||
|
@Scripts.Render("~/bundles/modernizr")
|
||||||
@Scripts.Render("~/bundles/modernizr")
|
@Scripts.Render("~/bundles/jquery")
|
||||||
@Scripts.Render("~/bundles/jquery")
|
@Scripts.Render("~/bundles/bootstrap")
|
||||||
@Scripts.Render("~/bundles/bootstrap")
|
@Scripts.Render("~/bundles/jqueryui")
|
||||||
@Scripts.Render("~/bundles/jqueryui")
|
@Scripts.Render("~/bundles/jqueryval")
|
||||||
@Scripts.Render("~/bundles/jqueryval")
|
@Scripts.Render("~/bundles/moment")
|
||||||
@Scripts.Render("~/bundles/moment")
|
@Scripts.Render("~/bundles/toastr")
|
||||||
@Scripts.Render("~/bundles/toastr")
|
|
||||||
@Scripts.Render("~/bundles/jquery-dataTables")
|
|
||||||
@Scripts.Render("~/bundles/jquery-fileupload")
|
|
||||||
@Scripts.Render("~/bundles/jquery-fullCalendar")
|
|
||||||
@Scripts.Render("~/Script-Global")
|
@Scripts.Render("~/Script-Global")
|
||||||
@Scripts.Render("~/Sinort-Scripts/Login.js")
|
@Scripts.Render("~/Sinort-Scripts/Login.js")
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -726,7 +726,7 @@
|
||||||
|
|
||||||
@*---------------------Calendario ---------------------------------------------------------*@
|
@*---------------------Calendario ---------------------------------------------------------*@
|
||||||
<div class="modal fade" id="modalCalendario" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;">
|
<div class="modal fade" id="modalCalendario" tabindex="-1" role="dialog" aria-hidden="true" data-backdrop="static" style="display: none;">
|
||||||
<div class="modal-dialog modal-lg" style="width:75%;">
|
<div class="modal-dialog modal-lg" style="width:75%; height: 75%;">
|
||||||
<div class="modal-content">
|
<div class="modal-content">
|
||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
|
@ -736,7 +736,7 @@
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|
||||||
<div class="col-md-12">
|
<div class="col-md-12">
|
||||||
<div id='calendar'></div>
|
<div id='calendar' style="height: 80%;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
{
|
{
|
||||||
int? Next_id = Conn.Calendario.Max(t => (int?)t.IdCalendario);
|
int? Next_id = Conn.Calendario.Max(t => (int?)t.IdCalendario);
|
||||||
model.Evento.IdCalendario = (Next_id == null) ? 1 : Next_id.Value + 1;
|
model.Evento.IdCalendario = (Next_id == null) ? 1 : Next_id.Value + 1;
|
||||||
model.Evento.UsuarioCreacion = model.AtesaUser;
|
model.Evento.UsuarioCreacion = model.AtesaUserName;
|
||||||
model.Evento.FechaCreacion = DateTime.Now;
|
model.Evento.FechaCreacion = DateTime.Now;
|
||||||
Conn.Calendario.Add(model.Evento);
|
Conn.Calendario.Add(model.Evento);
|
||||||
Conn.SaveChanges();
|
Conn.SaveChanges();
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
{
|
{
|
||||||
int? Next_id = Conn.ComentariosProyecto.Max(t => (int?)t.IdComentarioProyecto);
|
int? Next_id = Conn.ComentariosProyecto.Max(t => (int?)t.IdComentarioProyecto);
|
||||||
model.Comentario.IdComentarioProyecto = (Next_id == null) ? 1 : Next_id.Value + 1;
|
model.Comentario.IdComentarioProyecto = (Next_id == null) ? 1 : Next_id.Value + 1;
|
||||||
model.Comentario.UsuarioCreacion = model.AtesaUser;
|
model.Comentario.UsuarioCreacion = model.AtesaUserName;
|
||||||
model.Comentario.FechaCreacion = DateTime.Now;
|
model.Comentario.FechaCreacion = DateTime.Now;
|
||||||
Conn.ComentariosProyecto.Add(model.Comentario);
|
Conn.ComentariosProyecto.Add(model.Comentario);
|
||||||
Conn.SaveChanges();
|
Conn.SaveChanges();
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,13 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
if (Actual == null)
|
if (Actual == null)
|
||||||
{
|
{
|
||||||
model.Convocado.Participante = false;
|
model.Convocado.Participante = false;
|
||||||
model.Convocado.UsuarioCreacion = model.AtesaUser;
|
model.Convocado.UsuarioCreacion = model.AtesaUserName;
|
||||||
model.Convocado.FechaCreacion = DateTime.Now;
|
model.Convocado.FechaCreacion = DateTime.Now;
|
||||||
Conn.Convocatoria.Add(model.Convocado);
|
Conn.Convocatoria.Add(model.Convocado);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
model.Convocado.UsuarioModificacion = model.AtesaUser;
|
model.Convocado.UsuarioModificacion = model.AtesaUserName;
|
||||||
model.Convocado.FechaModificacion = DateTime.Now;
|
model.Convocado.FechaModificacion = DateTime.Now;
|
||||||
Conn.Entry(Actual).State = System.Data.Entity.EntityState.Detached;
|
Conn.Entry(Actual).State = System.Data.Entity.EntityState.Detached;
|
||||||
Conn.Convocatoria.Attach(model.Convocado);
|
Conn.Convocatoria.Attach(model.Convocado);
|
||||||
|
|
|
||||||
|
|
@ -29,13 +29,13 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
{
|
{
|
||||||
int? Next_id = Conn.ProyectoNormativo.Max(t => (int?)t.IdProyectoNormativo);
|
int? Next_id = Conn.ProyectoNormativo.Max(t => (int?)t.IdProyectoNormativo);
|
||||||
model.ProyectoNormativo.IdProyectoNormativo = (Next_id == null) ? 1 : Next_id.Value + 1;
|
model.ProyectoNormativo.IdProyectoNormativo = (Next_id == null) ? 1 : Next_id.Value + 1;
|
||||||
model.ProyectoNormativo.UsuarioCreacion = model.AtesaUser;
|
model.ProyectoNormativo.UsuarioCreacion = model.AtesaUserName;
|
||||||
model.ProyectoNormativo.FechaCreacion = DateTime.Now;
|
model.ProyectoNormativo.FechaCreacion = DateTime.Now;
|
||||||
Conn.ProyectoNormativo.Add(model.ProyectoNormativo);
|
Conn.ProyectoNormativo.Add(model.ProyectoNormativo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
model.ProyectoNormativo.UsuarioModificacion = model.AtesaUser;
|
model.ProyectoNormativo.UsuarioModificacion = model.AtesaUserName;
|
||||||
model.ProyectoNormativo.FechaModificacion = DateTime.Now;
|
model.ProyectoNormativo.FechaModificacion = DateTime.Now;
|
||||||
Conn.Entry(model.ProyectoNormativo).State = System.Data.Entity.EntityState.Detached;
|
Conn.Entry(model.ProyectoNormativo).State = System.Data.Entity.EntityState.Detached;
|
||||||
Conn.ProyectoNormativo.Attach(model.ProyectoNormativo);
|
Conn.ProyectoNormativo.Attach(model.ProyectoNormativo);
|
||||||
|
|
@ -106,7 +106,8 @@ namespace AYA.SlnSinortModel.DAL.Sinort
|
||||||
{
|
{
|
||||||
var json = new EventosJSON()
|
var json = new EventosJSON()
|
||||||
{
|
{
|
||||||
allDay = false,
|
id = evento.IdCalendario.ToString(),
|
||||||
|
allDay = evento.DiaCompleto.HasValue ? evento.DiaCompleto.Value : false,
|
||||||
start = evento.FechaInicio.HasValue ? evento.FechaInicio.Value.ToString() : string.Empty,
|
start = evento.FechaInicio.HasValue ? evento.FechaInicio.Value.ToString() : string.Empty,
|
||||||
end = evento.FechaFin.HasValue ? evento.FechaFin.Value.ToString() : string.Empty,
|
end = evento.FechaFin.HasValue ? evento.FechaFin.Value.ToString() : string.Empty,
|
||||||
title = evento.Titulo
|
title = evento.Titulo
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ namespace AYA.SlnSinortModel.Entidades
|
||||||
|
|
||||||
public class EventosJSON
|
public class EventosJSON
|
||||||
{
|
{
|
||||||
|
public string id { get; set; }
|
||||||
public string title { get; set; }
|
public string title { get; set; }
|
||||||
public string start { get; set; }
|
public string start { get; set; }
|
||||||
public string end { get; set; }
|
public string end { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,6 @@ namespace AYA.SlnSinortModel.Sinort
|
||||||
|
|
||||||
public partial class SinortContex : Contex
|
public partial class SinortContex : Contex
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
public virtual DbSet<Aplicacion> Aplicacion { get; set; }
|
public virtual DbSet<Aplicacion> Aplicacion { get; set; }
|
||||||
public virtual DbSet<Categoria> Categoria { get; set; }
|
public virtual DbSet<Categoria> Categoria { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -8,11 +8,11 @@ namespace Atesa.Utilitarios
|
||||||
{
|
{
|
||||||
public class AtesaJSON
|
public class AtesaJSON
|
||||||
{
|
{
|
||||||
public string AtesaUser { get; private set; }
|
public string AtesaUserName { get; set; }
|
||||||
|
public string AtesaUserFullName { get; set; }
|
||||||
public AtesaJSON()
|
public AtesaJSON()
|
||||||
{
|
{
|
||||||
AtesaUser = "atesa";
|
AtesaUserName = "atesa";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue