Esempio n. 1
0
        async Task <Int32> IDataInjector.CreateSalon(Ekilibrate.Model.Entity.Administrador.clsSalonBase Data)
        {
            using (var scope = Ekilibrate.Data.Access.Common.ContainerConfig.ProxyContainer.BeginLifetimeScope("a"))
            {
                try
                {
                    var objController = new Ekilibrate.BL.Controller.clsSalon(scope);
                    var result        = await objController.Create(Data);

                    var DBContext = scope.Resolve <DBTrnContext>();
                    DBContext.CommitTransaction();
                    return(result);
                }
                catch (FaultException ex)
                {
                    throw ex;
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }
        }
Esempio n. 2
0
        async Task IDataInjector.UpdateSalon(Ekilibrate.Model.Entity.Administrador.clsSalonBase Data)
        {
            using (var scope = Ekilibrate.Data.Access.Common.ContainerConfig.ProxyContainer.BeginLifetimeScope("a"))
            {
                try
                {
                    var objController = new Ekilibrate.BL.Controller.clsSalon(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 empresa.");
                }
            }
        }
Esempio n. 3
0
 public async Task <ActionResult> Delete([DataSourceRequest] DataSourceRequest request, Ekilibrate.Model.Entity.Administrador.clsSalonBase model)
 {
     try
     {
         if (model != null && ModelState.IsValid)
         {
             using (var scope = EkilibrateUI.Autofac.ContainerConfig.ProxyContainer.BeginLifetimeScope())
             {
                 var middleTier = scope.Resolve <Ekilibrate.Model.Services.Administrador.IDataInjector>();
                 await middleTier.DeleteSalon(model.Id);
             }
         }
     }
     catch (Exception ex)
     {
         ModelState.AddModelError(ex.Message, ex);
     }
     return(Json(new[] { model }.ToDataSourceResult(request, ModelState)));
 }