Exemple #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));
        }
Exemple #2
0
 public Account Get(string username)
 {
     if (string.IsNullOrEmpty(username))
     {
         return(null);
     }
     return(accountDal.Get(x => x.Username == username));
 }
Exemple #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);
            }
        }
Exemple #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);
        }
Exemple #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);
        }
Exemple #6
0
 public Account GetByUserNameAndPassword(string userName, string password)
 {
     return(_accountDal.Get(x => x.UserName == userName & x.Password == password));
 }
Exemple #7
0
 Account IAccountService.GetAccountByNumber(string accountNumber)
 {
     return(_accountDal.Get(x => x.AccountNumber == accountNumber));
 }
Exemple #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));
        }
Exemple #11
0
 public Account Get(Account entity)
 {
     return(_accountDal.Get(p => p.Id == entity.Id));
 }
Exemple #12
0
 public Account GetWithHgsNo(string HGS)
 {
     return(accountDal.Get(x => x.HgsNo == HGS));
 }
Exemple #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));
 }