Ejemplo n.º 1
0
        public void Update(SubCategoriaFinanceiraViewModel subCategoriaFinanceiraViewModel)
        {
            var subCategoria = Mapper.Map <SubCategoriaFinanceiraViewModel, SubCategoriaFinanceira>(subCategoriaFinanceiraViewModel);

            BeginTransaction();
            _subCategoriaFinanceiraService.Update(subCategoria);

            _logSistemaService.AddLog("CategoriaFinanceira", subCategoriaFinanceiraViewModel.SubCategoriaFinanceiraId, "Update", "SubCategoria: " + subCategoria.SubCategoria);
            Commit();
        }
        public HttpResponseMessage Put(SubCategoriaFinanceiraViewModel subCategoriaFinanceiraViewModel)
        {
            if (ModelState.IsValid)
            {
                _subCategoriaFinanceiraApp.Update(subCategoriaFinanceiraViewModel);

                return(Request.CreateResponse(HttpStatusCode.Created, "Cadastro efetuado com sucesso!"));
            }
            return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
        }
Ejemplo n.º 3
0
        public void Add(SubCategoriaFinanceiraViewModel subCategoriaFinanceiraViewModel)
        {
            var subCategoria = Mapper.Map <SubCategoriaFinanceiraViewModel, SubCategoriaFinanceira>(subCategoriaFinanceiraViewModel);

            BeginTransaction();
            _subCategoriaFinanceiraService.Add(subCategoria);

            _logSistemaService.AddLog("SubCategoriaFinanceira", subCategoriaFinanceiraViewModel.SubCategoriaFinanceiraId, "Cadastro", "");
            Commit();
        }
        public HttpResponseMessage Post(SubCategoriaFinanceiraViewModel subCategoriaFinanceiraViewModel)
        {
            if (ModelState.IsValid)
            {
                _subCategoriaFinanceiraApp.Add(subCategoriaFinanceiraViewModel);

                return(Request.CreateResponse(HttpStatusCode.Created, subCategoriaFinanceiraViewModel));
            }
            return(Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState));
        }