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); }
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); } }
public IEnumerable <Seller> GetAll() { return(_repository.GetAll()); }
public ActionResult SellerList() { return(View(sellerRepo.GetAll())); }
public List <Seller> GetAll() { ISellerRepository repository = new SellerRepository(); return(repository.GetAll()); }
public IEnumerable <Seller> GetSellers() { var repo = new SellerRepository(); return(repo.GetAll()); }