public BankAccountTypeDTO updateBankAccountType(BankAccountTypeDTO bankAccountType)
        {
            var selectedBankAccountType = uow.GetRepository <BankAccountType>().Get(z => z.Id == bankAccountType.Id);

            selectedBankAccountType = MapperFactory.CurrentMapper.Map(bankAccountType, selectedBankAccountType);
            uow.GetRepository <BankAccountType>().Update(selectedBankAccountType);
            uow.SaveChanges();
            return(MapperFactory.CurrentMapper.Map <BankAccountTypeDTO>(selectedBankAccountType));
        }
        public HttpResponseMessage Get(int Id)
        {
            BankAccountTypeDTO selectedTitle = service.getBankAccountType(Id);

            if (selectedTitle == null)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, Id + sysLanguage.CompanyTitlesControllerStrings.id_title));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, selectedTitle));
        }
        public HttpResponseMessage Put(BankAccountTypeDTO bankAccountTypeDTO)
        {
            BankAccountTypeDTO dto = service.updateBankAccountType(bankAccountTypeDTO);

            if (dto != null)
            {
                return(Request.CreateResponse(HttpStatusCode.OK, dto));
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.SeeOther, sysLanguage.CompanyTitlesControllerStrings.update_title));
            }
        }
 public BankAccountTypeDTO newBankAccountType(BankAccountTypeDTO bankAccountType)
 {
     if (!uow.GetRepository <BankAccountType>().GetAll().Any(z => z.Id == bankAccountType.Id))
     {
         var adedBankAccountType = MapperFactory.CurrentMapper.Map <BankAccountType>(bankAccountType);
         adedBankAccountType = uow.GetRepository <BankAccountType>().Add(adedBankAccountType);
         uow.SaveChanges();
         return(MapperFactory.CurrentMapper.Map <BankAccountTypeDTO>(adedBankAccountType));
     }
     else
     {
         return(null);
     }
 }
        public HttpResponseMessage Post(BankAccountTypeDTO bankAccountTypeDTO)
        {
            BankAccountTypeDTO dto = service.newBankAccountType(bankAccountTypeDTO);

            if (dto != null)
            {
                HttpResponseMessage message = Request.CreateResponse(HttpStatusCode.Created, dto);
                message.Headers.Location = new Uri(Request.RequestUri + "/" + dto.Id);
                return(message);
            }
            else
            {
                return(Request.CreateErrorResponse(HttpStatusCode.SeeOther, sysLanguage.CompanyTitlesControllerStrings.add_title));
            }
        }