/// <summary> /// Permite anular una Inspección /// </summary> /// <param name="">Entidad Observacion Planeada</param> /// <returns>valor booleano con el resultado de la operacion</returns> public JsonResult EliminarObjetivoEstrategicoEmpresa(ObjetivoEstrategicoEmpresaRequest data) { data.CodigoIdioma = obtenerCodigoIdioma(); var response = ObjetivoEstrategicoEmpresaService.EliminarObjetivoEstrategicoEmpresa(data); return(Json(response)); }
public ProcessResult <object> ReactivarObjetivoEstrategicoEmpresa(ObjetivoEstrategicoEmpresaRequest data) { ProcessResult <object> resultado = new ProcessResult <object>(); resultado.Result = "-1"; try { ObjetivoEstrategicoEmpresaEntityRepository.Reactivar(data.CodigoObjetivoEstrategicoEmpresa); resultado.Result = ObjetivoEstrategicoEmpresaEntityRepository.GuardarCambios(); } catch (Exception e) { resultado.IsSuccess = false; resultado.Exception = new ApplicationLayerException <ObjetivoEstrategicoEmpresaService>(e.Message); } return(resultado); }
public ProcessResult <object> EliminarObjetivoEstrategicoEmpresa(ObjetivoEstrategicoEmpresaRequest data) { ProcessResult <object> resultado = new ProcessResult <object>(); resultado.Result = "-1"; try { ObjetivoEstrategicoEmpresaDetalleRequest oOEED = new ObjetivoEstrategicoEmpresaDetalleRequest(); oOEED.CodigoObjetivoEstrategicoEmpresa = data.CodigoObjetivoEstrategicoEmpresa; oOEED.CodigoIdioma = data.CodigoIdioma; var indicadoresAsociados = objetivoEspecificoDetalleService.BuscarObjetivoEstrategicoEmpresaDetalle(oOEED); if (indicadoresAsociados.Result.Count > 0) { for (int i = 0; i < indicadoresAsociados.Result.Count; i++) { if (indicadoresAsociados.Result[0].EstadoRegistro == DatosConstantes.EstadoRegistro.Activo) { resultado.IsSuccess = false; resultado.Exception = new ApplicationLayerException <ObjetivoEstrategicoEmpresaService>(MensajesSistemaResource.EtiquetaMsgValidacionConsistencia); break; } else { ObjetivoEstrategicoEmpresaEntityRepository.Eliminar(data.CodigoObjetivoEstrategicoEmpresa); resultado.Result = ObjetivoEstrategicoEmpresaEntityRepository.GuardarCambios(); } } } else { ObjetivoEstrategicoEmpresaEntityRepository.Eliminar(data.CodigoObjetivoEstrategicoEmpresa); resultado.Result = ObjetivoEstrategicoEmpresaEntityRepository.GuardarCambios(); } } catch (Exception e) { resultado.IsSuccess = false; resultado.Exception = new ApplicationLayerException <ObjetivoEstrategicoEmpresaService>(e.Message); } return(resultado); }
/// <summary> /// Bandeja de ObjetivoEstrategicoEmpresaes /// </summary> /// <param name="filtro"></param> /// <returns></returns> public ActionResult Index(ObjetivoEstrategicoEmpresaRequest filtro) { IngresoObjetivoEstrategicoEmpresaModel modelo = new IngresoObjetivoEstrategicoEmpresaModel(); filtro.CodigoIdioma = obtenerCodigoIdioma(); if (filtro.CodigoObjetivoEstrategicoEmpresa.HasValue) { modelo.ObjetivoEstrategicoEmpresa = ObjetivoEstrategicoEmpresaService.ObtenerObjetivoEstrategicoEmpresa(new ObjetivoEstrategicoEmpresaRequest() { CodigoObjetivoEstrategicoEmpresa = filtro.CodigoObjetivoEstrategicoEmpresa, CodigoIdioma = filtro.CodigoIdioma }).Result; } modelo.ListaModeloConceptual.Add(new SelectListItem { Value = string.Empty, Text = GenericoResource.EtiquetaSeleccionar }); modelo.ListaModeloConceptual.AddRange(parametroValorService.BuscarValorPorSeccionParametro(new ParametroValorRequest() { CodigoIdentificador = DatosConstantes.ParametrosGenerales.ModeloConceptual, CodigoEmpresa = DatosConstantes.Empresa.CodigoElectroPeru, CodigoSistema = DatosConstantes.Sistema.CodigoSGI, IndicadorEmpresa = true, CodigoIdioma = filtro.CodigoIdioma }).Result.Select(x => new SelectListItem() { Value = x.CodigoValorString, Text = x.Valor, Selected = false })); modelo.ListaIndicador.Add(new SelectListItem { Value = string.Empty, Text = GenericoResource.EtiquetaSeleccionar }); modelo.ListaIndicador.AddRange(indicadorService.BuscarIndicador(new BandejaIndicadorRequest() { CodigoIdioma = filtro.CodigoIdioma, EstadoRegistro = DatosConstantes.EstadoRegistro.Activo, }).Result.Select(x => new SelectListItem() { Value = x.CodigoIndicador.ToString(), Text = x.DescripcionIndicador, Selected = false })); modelo.ListaAccionEstrategicaInstitucional.Add(new SelectListItem { Value = string.Empty, Text = GenericoResource.EtiquetaSeleccionar }); modelo.ListaAccionEstrategicaInstitucional.AddRange(accionEstrategicaInstitucionalService.BuscarAccionEstrategicaInstitucional(new BandejaAccionEstrategicaInstitucionalRequest() { CodigoIdioma = filtro.CodigoIdioma, EstadoRegistro = DatosConstantes.EstadoRegistro.Activo, }).Result.Select(x => new SelectListItem() { Value = x.CodigoAccionEstrategicaInstitucional.ToString(), Text = x.DescripcionAccionEstrategicaInstitucional, Selected = false })); return(View(modelo)); }
public JsonResult ReactivarObjetivoEstrategicoEmpresa(ObjetivoEstrategicoEmpresaRequest data) { var response = ObjetivoEstrategicoEmpresaService.ReactivarObjetivoEstrategicoEmpresa(data); return(Json(response)); }
public ProcessResult <ObjetivoEstrategicoEmpresaResponse> RegistrarObjetivoEstrategicoEmpresa(ObjetivoEstrategicoEmpresaRequest data) { ProcessResult <ObjetivoEstrategicoEmpresaResponse> resultado = new ProcessResult <ObjetivoEstrategicoEmpresaResponse>(); resultado.Result = new ObjetivoEstrategicoEmpresaResponse(); try { using (TransactionScope ts = new TransactionScope()) { ObjetivoEstrategicoEmpresaEntity ObjetivoEstrategicoEmpresaSincronizar = ObjetivoEstrategicoEmpresaEntityRepository.GetById(data.CodigoObjetivoEstrategicoEmpresa); ObjetivoEstrategicoEmpresaEntity ObjetivoEstrategicoEmpresaGeneral = Mapper.Map <ObjetivoEstrategicoEmpresaRequest, ObjetivoEstrategicoEmpresaEntity>(data); if (ObjetivoEstrategicoEmpresaSincronizar != null) { Mapper.Map <ObjetivoEstrategicoEmpresaEntity, ObjetivoEstrategicoEmpresaEntity>(ObjetivoEstrategicoEmpresaGeneral, ObjetivoEstrategicoEmpresaSincronizar); ObjetivoEstrategicoEmpresaSincronizar.EstadoRegistro = DatosConstantes.EstadoRegistro.Activo; ObjetivoEstrategicoEmpresaEntityRepository.Editar(ObjetivoEstrategicoEmpresaSincronizar); resultado.Result.CodigoObjetivoEstrategicoEmpresa = data.CodigoObjetivoEstrategicoEmpresa; resultado.Result.NombreObjetivoEstrategicoEmpresa = data.NombreObjetivoEstrategicoEmpresa; resultado.Result.DescripcionObjetivoEstrategicoEmpresa = data.DescripcionObjetivoEstrategicoEmpresa; resultado.Result.CodigoModeloConceptual = data.CodigoModeloConceptual; resultado.Result.CodigoResponsable = data.CodigoResponsable; resultado.Result.EstadoRegistro = DatosConstantes.EstadoRegistro.Activo; } else { ObjetivoEstrategicoEmpresaEntityRepository.Insertar(ObjetivoEstrategicoEmpresaGeneral); bool registroExitoso = resultado.IsSuccess; if (!registroExitoso) { resultado.IsSuccess = false; resultado.Exception = new ApplicationLayerException <ObjetivoEstrategicoEmpresaService>(MensajesSistemaResource.EtiquetaError); } resultado.Result.CodigoObjetivoEstrategicoEmpresa = ObjetivoEstrategicoEmpresaGeneral.CodigoObjetivoEstrategicoEmpresa; } ObjetivoEstrategicoEmpresaEntityRepository.GuardarCambios(); ts.Complete(); } } catch (Exception ex) { resultado.IsSuccess = false; resultado.Exception = new ApplicationLayerException <ObjetivoEstrategicoEmpresaService>(ex.Message); } return(resultado); }
/// <summary> /// Permite obtener una Observacion Planeada Entity /// </summary> /// <param name="CodigoExpediente"></param> /// <returns>Entidad Observacion Planeada Response</returns> public ProcessResult <ObjetivoEstrategicoEmpresaResponse> ObtenerObjetivoEstrategicoEmpresa(ObjetivoEstrategicoEmpresaRequest data) { ProcessResult <ObjetivoEstrategicoEmpresaResponse> resultado = new ProcessResult <ObjetivoEstrategicoEmpresaResponse>(); resultado.Result = new ObjetivoEstrategicoEmpresaResponse(); try { if (data.CodigoObjetivoEstrategicoEmpresa.HasValue) { BandejaObjetivoEstrategicoEmpresaRequest modelo = new BandejaObjetivoEstrategicoEmpresaRequest(); modelo.CodigoObjetivoEstrategicoEmpresa = data.CodigoObjetivoEstrategicoEmpresa; modelo.CodigoIdioma = data.CodigoIdioma; ObjetivoEstrategicoEmpresaEntity ObjetivoEstrategicoEmpresaEntity = ObjetivoEstrategicoEmpresaEntityRepository.GetById(data.CodigoObjetivoEstrategicoEmpresa); if (ObjetivoEstrategicoEmpresaEntity != null) { ResponsableEntity responsableEntity = responsableEntityRepository.GetById(ObjetivoEstrategicoEmpresaEntity.CodigoResponsable); resultado.Result = Mapper.Map <ObjetivoEstrategicoEmpresaEntity, ObjetivoEstrategicoEmpresaResponse>(ObjetivoEstrategicoEmpresaEntity); resultado.Result.NombreCompletoResponsable = responsableEntity.Nombres + " " + responsableEntity.ApellidoPaterno + " " + responsableEntity.ApellidoMaterno; } } } catch (Exception ex) { resultado.IsSuccess = false; resultado.Exception = new ApplicationLayerException <ObjetivoEstrategicoEmpresaService>(ex.Message); } return(resultado); }