Ejemplo n.º 1
0
        public virtual ActionResult DeleteDispatch(List <int> items)
        {
            try
            {
                string resultado = string.Empty;

                using (TransactionScope trs = new TransactionScope(TransactionScopeOption.Required))
                {
                    foreach (var item in items)
                    {
                        DispatchTable entidad = new DispatchTable();
                        entidad.DispatchID = item;
                        resultado          = Dispatch.DeleteDispatch(entidad);
                        if (resultado.Trim().Length > 0)
                        {
                            trs.Dispose();
                            return(Json(new { result = false, message = resultado }));
                        }
                    }
                    trs.Complete();
                }
                return(Json(new { result = true, message = "" }));
            }
            catch (Exception ex)
            {
                var exception = EntityExceptionHelper.GetAndLogNetStepsException(ex, NetSteps.Data.Entities.Constants.NetStepsExceptionType.NetStepsApplicationException);
                return(JsonError(exception.PublicMessage));
            }
        }