コード例 #1
0
        public CategoryController()
        {
            var categoryRepository = RepositoryFactory.GetCategoryRepository();
            var propertyRepository = RepositoryFactory.GetPropertyRepository();
            var transactionRepository = RepositoryFactory.GetTransactionRepository();

            _categoryApp = new CategoryApp(categoryRepository, propertyRepository, transactionRepository);
        }
コード例 #2
0
ファイル: SyncController.cs プロジェクト: essgineer/Finance
        public ActionResult SaveCategory(CategoryDto categoryDto)
        {
            var login = Request.Headers["login"];
            var token = Request.Headers["token"];
            var propertyId = Convert.ToInt32(Request.Headers["propertyId"]);

            if (!ValidatePost(login, token, propertyId))
                return Json("usuário inválido", JsonRequestBehavior.AllowGet);

            var categoryApp = new CategoryApp(_categoryRepository, _propertyRepository, _transactionRepository);
            categoryApp.Save(propertyId, categoryDto);

            return Json("OK");
        }