public IResult Add(Findex findex)
        {
            var result = CalculateFindexScore(findex).Data;

            _findexDal.Add(result);
            return(new SuccessResult("Findex Skoru Eklendi"));
        }
        public IResult Update(Findex findex)
        {
            var result = CalculateFindexScore(findex).Data;

            _findexDal.Update(result);

            return(new SuccessResult(Messages.SuccessUpdated));
        }
Exemple #3
0
        public IActionResult Delete(Findex findexDto)
        {
            var result = _findexService.Delete(findexDto);

            if (result.Success == true)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
        public IActionResult Update(Findex findex)
        {
            var result = _findexService.Update(findex);

            if (result.Success)
            {
                return(Ok(result));
            }
            return(BadRequest(result));
        }
Exemple #5
0
        public IResult UpdateUserDetails(UserDetailForUpdateDto userDetailForUpdateDto)
        {
            var user = GetByMail(userDetailForUpdateDto.Email).Data;

            byte[] passwordHash, passwordSalt;
            if (!HashingHelper.VerifyPasswordHash(userDetailForUpdateDto.CurrentPassword,
                                                  user.PasswordHash, user.PasswordSalt))
            {
                return(new ErrorResult("Hatalı parola"));
            }

            user.FirstName = userDetailForUpdateDto.FirstName;
            user.LastName  = userDetailForUpdateDto.LastName;
            HashingHelper.CreatePasswordHash(userDetailForUpdateDto.NewPassword, out passwordHash, out passwordSalt);
            user.PasswordHash = passwordHash;
            user.PasswordSalt = passwordSalt;
            _userDal.Update(user);
            var customer = _customerService.GetById(userDetailForUpdateDto.CustomerId).Data;

            customer.CompanyName = userDetailForUpdateDto.CompanyName;
            _customerService.Update(customer);

            var findex = _findexService.GetByCustomerId(userDetailForUpdateDto.CustomerId).Data;

            if (findex == null)
            {
                var newFindex = new Findex
                {
                    CustomerId = userDetailForUpdateDto.CustomerId
                };
                _findexService.Add(newFindex);
            }
            else
            {
                _findexService.Update(findex);
            }


            return(new SuccessResult(Messages.SuccessUpdated));
        }
 public IResult Update(Findex findex)
 {
     Console.WriteLine("Update");
     return(new SuccessResult());
 }
 public IResult Delete(Findex findex)
 {
     Console.WriteLine("Deleted");
     return(new SuccessResult());
 }
 public IResult Add(Findex findex)
 {
     Console.WriteLine("Added");
     return(new SuccessResult());
 }
 public IDataResult <Findex> GetUserFindeks(Findex findex)
 {
     throw new NotImplementedException();
 }
 public IResult Delete(Findex findex)
 {
     _findexDal.Delete(findex);
     return(new SuccessResult(Messages.FindexDeleted));
 }
 public IResult Add(Findex findex)
 {
     _findexDal.Add(findex);
     return(new SuccessResult());
 }
 public IResult Update(Findex Tentity)
 {
     _findexDal.Update(Tentity);
     return(new SuccessResult(Messages.FindexUpdated));
 }
 public IResult Delete(Findex Tentity)
 {
     _findexDal.Delete(Tentity);
     return(new SuccessResult(Messages.FindexDeleted));
 }
 public IResult Add(Findex Tentity)
 {
     _findexDal.Add(Tentity);
     return(new SuccessResult(Messages.FindexAdded));;
 }
 public IDataResult <Findex> CalculateFindexScore(Findex findex)
 {
     findex.Score = (short)new Random().Next(0, 1901);
     return(new SuccessDataResult <Findex>(findex));
 }
 public IResult Add(Findex findex)
 {
     _findexDal.Add(findex);
     return(new SuccessResult(Messages.FindexAdded));;
 }
 public IResult Delete(Findex findex)
 {
     _findexDal.Delete(findex);
     return(new SuccessResult());
 }
 public IResult Update(Findex findex)
 {
     _findexDal.Update(findex);
     return(new SuccessResult(Messages.FindexUpdated));
 }
 public IResult Update(Findex findex)
 {
     _findexDal.Update(findex);
     return(new SuccessResult());
 }