Exemplo n.º 1
0
        async Task IDataInjector.DeleteEnfermera(Ekilibrate.Model.Entity.Administrador.clsEnfermeraBase Data)
        {
            using (var scope = Ekilibrate.Data.Access.Common.ContainerConfig.ProxyContainer.BeginLifetimeScope("a"))
            {
                try
                {
                    var objController = new Ekilibrate.BL.Controller.clsEnfermera(scope);
                    await objController.Delete(Data);

                    var DBContext = scope.Resolve <DBTrnContext>();
                    DBContext.CommitTransaction();
                }
                catch (FaultException ex)
                {
                    throw ex;
                }
                catch (Exception)
                {
                    throw new FaultException("Error al registrar los datos del enfermero.");
                }
            }
        }
Exemplo n.º 2
0
 public async Task <ActionResult> Enfermera_Create([DataSourceRequest] DataSourceRequest request, Ekilibrate.Model.Entity.Administrador.clsEnfermeraBase model, int pIdProyecto)
 {
     try
     {
         model.ProyectoId = pIdProyecto;
         if (model != null && ModelState.IsValid)
         {
             using (var scope = EkilibrateUI.Autofac.ContainerConfig.ProxyContainer.BeginLifetimeScope())
             {
                 var middleTier = scope.Resolve <Ekilibrate.Model.Services.Administrador.IDataInjector>();
                 await middleTier.CreateEnfermera(model);
             }
         }
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(string.Empty, ex.Message);
     }
     return(Json(new[] { model }.ToDataSourceResult(request, ModelState)));
 }