async Task IDataInjector.UpdateComunicacion(Ekilibrate.Model.Entity.Participante.clsComunicacionBase Data) { using (var scope = Ekilibrate.Data.Access.Common.ContainerConfig.ProxyContainer.BeginLifetimeScope("a")) { try { var objController = new Ekilibrate.BL.Controller.Participante.clsComunicacion(scope); await objController.Update(Data); var DBContext = scope.Resolve <DBTrnContext>(); DBContext.CommitTransaction(); } catch (FaultException ex) { throw ex; } catch (Exception ex) { var objController = new Ekilibrate.BL.Common.clsLog(scope); objController.GuardarLog(ex); throw new FaultException("Error al actualizar datos de la comunicacion."); } } }
public async Task <ActionResult> Index(Ekilibrate.Model.Entity.Participante.clsComunicacionBase model) { try { using (var scope = EkilibrateUI.Autofac.ContainerConfig.ProxyContainer.BeginLifetimeScope()) { BarcoSoftUtilidades.Seguridad.Usuario user = this.HttpContext.GetActualUser(); if (user == null) { return(Redirect("~/SitioAdministrativo/Home/Login?ReturnUrl=%2fParticipante%2fComunicacion")); } Ekilibrate.Model.Entity.Participante.clsAsertivaFiltro objFiltro2 = new Ekilibrate.Model.Entity.Participante.clsAsertivaFiltro(); objFiltro2.ID_PARTICIPANTE = user.IdPersona; var middleTier2 = scope.Resolve <Ekilibrate.Model.Services.Participante.IDataRetriever>(); ViewBag.Comunicacion = await middleTier2.GetAsertivas(objFiltro2); return(View(model)); } } catch (Exception ex) { ModelState.AddModelError(string.Empty, ex.Message); } return(View(model)); }
//COMUNICACION async Task <Int32> IDataInjector.CreateComunicacion(Ekilibrate.Model.Entity.Participante.clsComunicacionBase Data) { using (var scope = Ekilibrate.Data.Access.Common.ContainerConfig.ProxyContainer.BeginLifetimeScope("a")) { try { var objController = new Ekilibrate.BL.Controller.Participante.clsComunicacion(scope); var result = await objController.Create(Data); var DBContext = scope.Resolve <DBTrnContext>(); DBContext.CommitTransaction(); return(result); } catch (FaultException ex) { throw ex; } catch (Exception) { throw new FaultException("Error al registrar los datos de la comunicacion."); } } }