public JsonResult Create(EventoJSON e) { try { if (e.tipo.Equals("Ob")) { SAREM.Shared.Entities.EventoObligatorio eOb = new SAREM.Shared.Entities.EventoObligatorio(); eOb.nombre = e.nombre; if (e.sexo.Equals("A")) { eOb.sexo = Shared.enums.Sexo.AMBOS.ToString(); } else if (e.sexo.Equals("F")) { eOb.sexo = Shared.enums.Sexo.FEMENINO.ToString(); } else { eOb.sexo = Shared.enums.Sexo.MASCULINO.ToString(); } eOb.mensaje = e.mensaje; eOb.fechanotificacion = ConsultaController.ParseDate(e.fechaNot).ToUniversalTime(); fabrica.inotificaciones.crearEvento(eOb); } else if (e.tipo.Equals("Op")) { SAREM.Shared.Entities.EventoOpcional eOp = new SAREM.Shared.Entities.EventoOpcional(); eOp.nombre = e.nombre; if (e.sexo.Equals("A")) { eOp.sexo = Shared.enums.Sexo.AMBOS.ToString(); } else if (e.sexo.Equals("F")) { eOp.sexo = Shared.enums.Sexo.FEMENINO.ToString(); } else { eOp.sexo = Shared.enums.Sexo.MASCULINO.ToString(); } eOp.mensaje = e.mensaje; eOp.edadesarray = string.Join(",", e.edades.ToArray()); ; fabrica.inotificaciones.crearEvento(eOp); } return Json(new { success = true }); } catch { return Json(new { success = false }); } }
public Evento(EventoJSON eventoJSON) { Id = eventoJSON.Id; Nome = eventoJSON.Nome; DataInicio = Convert.ToDateTime(eventoJSON.DataInicio).ToString("dd-MM-yyyy"); HoraInicio = Convert.ToDateTime(eventoJSON.HoraInicio).ToString("hh:mm"); DataFim = Convert.ToDateTime(eventoJSON.DataFim).ToString("dd-MM-yyyy"); HoraFim = Convert.ToDateTime(eventoJSON.HoraFim).ToString("hh:mm"); ValorIngresso = Convert.ToDouble(eventoJSON.ValorIngresso); ValorIngressoFormat = "R$ " + ValorIngresso; URL = eventoJSON.URL; //IngressosDisponiveis = Convert.ToInt32(eventoJSON.IngressosDisponiveis); Descrição = eventoJSON.Descrição; Local = new LocalService().Get(eventoJSON.LocalId); }
public JsonResult GetEventosOpcionales() { var eventosOp = fabrica.inotificaciones.listarEventosOpcionales(); List<EventoJSON> lista = new List<EventoJSON>(); foreach (EventoOpcional e in eventosOp) { EventoJSON ejs = new EventoJSON(); ejs.nombre = e.nombre; ejs.sexo = e.sexo.ToString(); ejs.mensaje = e.mensaje; ejs.EventoID = e.EventoID.ToString(); lista.Add(ejs); } return Json(lista, JsonRequestBehavior.AllowGet); }
public JsonResult GetEventosObligatorios() { var eventosOb = fabrica.inotificaciones.listarEventosObligatorios(); List<EventoJSON> lista = new List<EventoJSON>(); foreach (EventoObligatorio e in eventosOb) { EventoJSON ejs = new EventoJSON(); ejs.nombre = e.nombre; ejs.sexo = e.sexo.ToString(); ejs.mensaje = e.mensaje; String format = "dd/MM/yyyy HH:mm"; DateTime runtimeKnowsThisIsUtc = DateTime.SpecifyKind( e.fechanotificacion, DateTimeKind.Utc); DateTime localVersionFIni = runtimeKnowsThisIsUtc.ToLocalTime(); ejs.fechaNot = localVersionFIni.ToString(format); ejs.EventoID = e.EventoID.ToString(); lista.Add(ejs); } return Json(lista, JsonRequestBehavior.AllowGet); }