public async Task <ActionResult> Add(NuevaGestionModelView gestion) { await _createGestionUserCase.Add(gestion.GestionNueva.Anio, gestion.GestionNueva.FechaInicio, gestion.GestionNueva.FechaFinal, gestion.GestionNueva.Vigente); var counts = await _createGestionUserCase.ImportFromPreviousGestion(gestion.AnioVigente, gestion.GestionNueva.Anio); return(Json(new { success = true, message = "Nueva gestión creada correctamente" }, JsonRequestBehavior.AllowGet)); }
public async Task <ActionResult> Add() { var anioSiguienteGestion = await _getGestionesUserCase.SiguienteGestion(); var gestionsVigente = await _getGestionesUserCase.GestionVigente(); var modelView = new NuevaGestionModelView { AnioVigente = gestionsVigente.Anio, GestionNueva = new GestionModel { Anio = anioSiguienteGestion, FechaInicio = new DateTime(anioSiguienteGestion, 1, 1), FechaFinal = new DateTime(anioSiguienteGestion, 12, 31), Vigente = false } }; return(PartialView(modelView)); }