예제 #1
0
        public void Login(Seller seller, IObserver loginSeller)
        {
            Seller dbSeller = _sellerRepository.GetAll().FirstOrDefault(s => seller.Name == s.Name && seller.Password == s.Password);

            if (dbSeller == null)
            {
                throw new Exception("Authentication failed.");
            }
            loggedSellers.Add(loginSeller);
        }
예제 #2
0
        private int GetMaxSellerId()
        {
            ISellerRepository repository = new SellerRepository();
            var sellers = repository.GetAll();

            if (sellers.Count == 0)
            {
                return(1);
            }
            else
            {
                int maxNumber = 0;
                foreach (var item in sellers)
                {
                    if (item.Id > maxNumber)
                    {
                        maxNumber = item.Id;
                    }
                }

                return(maxNumber + 1);
            }
        }
예제 #3
0
 public IEnumerable <Seller> GetAll()
 {
     return(_repository.GetAll());
 }
 public ActionResult SellerList()
 {
     return(View(sellerRepo.GetAll()));
 }
예제 #5
0
        public List <Seller> GetAll()
        {
            ISellerRepository repository = new SellerRepository();

            return(repository.GetAll());
        }
예제 #6
0
        public IEnumerable <Seller> GetSellers()
        {
            var repo = new SellerRepository();

            return(repo.GetAll());
        }