public JsonDataController()
        {
            var uow = Helper.GetUnitOfWorkByCurrentUser();
            transactionService = new TransactionService(uow);

            var uow2 = new TransactionCSVUnitOfWork();
            transactionServiceOnlyTransaction = new TransactionService(uow2);
        }
        public ActionResult Index(PageTransactionModel model)
        {
            ViewBag.Message = "Minhas transações";

            if (ModelState.IsValid)
            {
                if (model.Filter == null)
                {
                    model.Filter = new TransactionFilterModel();
                    model.Filter.DateStart = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 01);
                    model.Filter.DateEnd = DateTime.Now.Date;
                    model.Filter.TransactionType = TransactionType.None;
                    model.Filter.OrderBy = TransactionOrder.Date; //model.Filter.OrderBy;
                    model.Filter.OrderByClassification = OrderClassification.Desc; //model.Filter.OrderByClassification;
                    model.Filter.ValueEnd = null;
                    model.Filter.ValueStart = null;
                }

                var filter = new TransactionFilter();
                filter.DateEnd = model.Filter.DateEnd;
                filter.DateStart = model.Filter.DateStart;
                filter.OrderBy = TransactionOrder.Date; //model.Filter.OrderBy;
                filter.OrderByClassification = OrderClassification.Desc; //model.Filter.OrderByClassification;
                filter.ValueEnd = model.Filter.ValueEnd;
                filter.ValueStart = model.Filter.ValueStart;
                filter.TransactionType = model.Filter.TransactionType;

                if (!string.IsNullOrWhiteSpace(model.Filter.Categories))
                {
                    filter.Categories = new List<string>();
                    filter.Categories = model.Filter.Categories.Split(',').Select(s => s.Trim()).ToList();
                }

                if (!string.IsNullOrWhiteSpace(model.Filter.SubCategories))
                {
                    filter.SubCategories = new List<string>();
                    filter.SubCategories = model.Filter.SubCategories.Split(',').Select(s => s.Trim()).ToList();
                }

                if (!string.IsNullOrWhiteSpace(model.Filter.TransactionNames))
                {
                    filter.Names = new List<string>();
                    filter.Names = model.Filter.TransactionNames.Split(',').Select(s => s.Trim()).ToList();
                }

                var transactionService = new TransactionService(new TransactionCSVUnitOfWork());
                model.Transactions = (from transaction in transactionService.GetTransactionsFiltrated(filter)
                                     select new TransactionModel
                                     {
                                         Id = transaction.Id,
                                         Name = transaction.Name,
                                         Date = transaction.Date,
                                         Value = transaction.Value,
                                         Category = transaction.Category,
                                         SubCategory = transaction.SubCategory,
                                     }).ToList();
            }
            else
            {
                model.Errors = this.ModelState.Values;
            }

            if (Request.IsAjaxRequest())
                return Json(model, JsonRequestBehavior.AllowGet);
            else
                return View(model);
        }