Esempio n. 1
0
 public async Task <IEnumerable <GetBrand> > FindAll(int page, int size)
 {
     return(await _brandRepository.All().Page(page, size).Select(brand => new GetBrand
     {
         Id = brand.Id,
         Name = brand.Name
     }).ToListAsync());
 }
Esempio n. 2
0
        public ActionResult Save(UserViewModel model)
        {
            var user = userRepository.All().SingleOrDefault(x => x.Id == model.Id);

            user.Email    = model.Email;
            user.FullName = model.FullName;
            userRepository.Update(user);
            return(RedirectToAction("Index", "Home"));
        }
Esempio n. 3
0
        public override bool ValidateUser(string username, string password)
        {
            int user = _userRepository.All().Count(x => x.Email == username && x.Password == password);

            if (user != 0)
            {
                return(true);
            }
            return(false);
        }
Esempio n. 4
0
        public override bool ValidateUser(string username, string password)
        {
            int user = _userRepository.All().Count(x => x.ID_PENGGUNA == username && x.KAD_PENGENALAN == password);

            if (user != 0)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Esempio n. 5
0
        public ActionResult Index()
        {
            int count = companyRepository.All().Count();

            if (count > 0)
            {
                var company = companyRepository.All().FirstOrDefault();
                return(View(company));
            }
            else
            {
                return(View());
            }
        }
Esempio n. 6
0
        public async Task <IEnumerable <RoundServiceViewModel> > RetrieveAllRounds()
        {
            try
            {
                var rounds = await _roundRepository.All();

                return(DataMapper.Map(rounds));
            }
            catch (Exception ex)
            {
                Logger.WriteLogToFile(ex.Message, "RoundService", "RetrieveAllRounds");
            }
            return(null);
        }
Esempio n. 7
0
        public async Task <IEnumerable <PlayerServiceViewModel> > RetrieveAllPlayers()
        {
            try
            {
                var players = await _playerRepository.All();

                return(DataMapper.Map(players));
            }
            catch (Exception ex)
            {
                Logger.WriteLogToFile(ex.Message, "PlayerService");
            }
            return(null);
        }
Esempio n. 8
0
        public async Task <IEnumerable <GameServiceViewModel> > RetrieveAllGames()
        {
            try
            {
                var games = await _gameRepository.All();

                return(DataMapper.Map(games));
            }
            catch (Exception ex)
            {
                Logger.WriteLogToFile(ex.Message, "GameService", "RetrieveAllGames");
            }
            return(null);
        }
Esempio n. 9
0
 // GET: Product
 public ActionResult Index()
 {
     return(View(productRepository.All()));
 }
Esempio n. 10
0
 // GET: Customer
 public ActionResult Index()
 {
     return(View(customerRepository.All()));
 }
Esempio n. 11
0
 public List <User> GetUsers(int id)
 {
     return(_userRepo.All().ToList());
 }
Esempio n. 12
0
 public ActionResult Index()
 {
     return(View(invoiceRepository.All()));
 }