Beispiel #1
0
        public IResponse CheckCurrencyCode(Transaction transaction)
        {
            string senderCurrencyCode   = _accountDal.Get(a => a.Id == transaction.SenderAccountNumber).CurrencyCode;
            var    receiverCurrencyCode = _accountDal.Get(b => b.Id == transaction.ReceiverAccountNumber).CurrencyCode;

            if (senderCurrencyCode == receiverCurrencyCode)
            {
                return(new ResponseModel(transaction.Id, false));
            }
            return(new ResponseModel(transaction.Id, true, Messages.CurrencyCodeError));
        }
Beispiel #2
0
 public Account Get(string username)
 {
     if (string.IsNullOrEmpty(username))
     {
         return(null);
     }
     return(accountDal.Get(x => x.Username == username));
 }
Beispiel #3
0
        public bool Login(string username, string password)
        {
            Account account = accountDal.Get(x => x.Username == username);

            if (account == null)
            {
                return(false);
            }

            if (account.Password == password)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Beispiel #4
0
        public bool Add(string username, Product product)
        {
            Account account = accountDal.Get(x => x.Username == username);

            if (product.CategoryId == 0 || product.Price == null || string.IsNullOrEmpty(product.Name) || string.IsNullOrEmpty(product.ImagePath) || product.LongLat == null || product.PublishDate == null)
            {
                return(false);
            }

            product.AccountId = account.Id;
            productDal.Add(product);
            return(true);
        }
Beispiel #5
0
        Kullanici IAccountService.Login(Login login)
        {
            QueryParam[] parametreler = new QueryParam[]
            {
                new QueryParam {
                    ParamName = "UserName", ParamValue = login.UserName
                },
                new QueryParam {
                    ParamName = "Password", ParamValue = login.Password
                }
            };
            var result = _accountDal.Get(NorthwindApp.StoredProcedures.Account.Login, parametreler);

            NorthwindApp.Entities.DTO.Kullanici kullaniciDTO = new Kullanici();
            if (result != null)
            {
                SimpleMapper.PropertyMap(result, kullaniciDTO);
                kullaniciDTO.KullaniciId = Encryptor.Encrypt(kullaniciDTO.KullaniciId);
            }

            return(kullaniciDTO);
        }
Beispiel #6
0
 public Account GetByUserNameAndPassword(string userName, string password)
 {
     return(_accountDal.Get(x => x.UserName == userName & x.Password == password));
 }
Beispiel #7
0
 Account IAccountService.GetAccountByNumber(string accountNumber)
 {
     return(_accountDal.Get(x => x.AccountNumber == accountNumber));
 }
Beispiel #8
0
 public Account Get(int accountId)
 {
     return(_accountDal.Get(accountId));
 }
 public IDataResult <Account> GetById(int id)
 {
     return(new SuccessDataResult <Account>(_accountDal.Get(a => a.AccountId == id), Messages.AccountListed));
 }
        public ResponseDataModel <Account> Get(int id)
        {
            var result = _accountDal.Get(b => b.Id == id);

            return(new ResponseDataModel <Account>(result, false));
        }
Beispiel #11
0
 public Account Get(Account entity)
 {
     return(_accountDal.Get(p => p.Id == entity.Id));
 }
Beispiel #12
0
 public Account GetWithHgsNo(string HGS)
 {
     return(accountDal.Get(x => x.HgsNo == HGS));
 }
Beispiel #13
0
 public Account GetAccount(int id)
 {
     return(_accountDal.Get(x => x.AccountID == id));
 }
 /// <summary>
 /// Gets the first item that fufills the filter.
 /// </summary>
 /// <param name="filter">The filter.</param>
 /// <returns></returns>
 public IAccountDataModel Get(Func <IAccountDataModel, bool> filter, IModelContext context = null)
 {
     return(dal.Get(filter, context));
 }