Ejemplo 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());
 }
Ejemplo 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"));
        }
Ejemplo 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);
        }
Ejemplo 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);
            }
        }
Ejemplo 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());
            }
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo 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);
        }
Ejemplo n.º 9
0
 // GET: Product
 public ActionResult Index()
 {
     return(View(productRepository.All()));
 }
Ejemplo n.º 10
0
 // GET: Customer
 public ActionResult Index()
 {
     return(View(customerRepository.All()));
 }
Ejemplo n.º 11
0
 public List <User> GetUsers(int id)
 {
     return(_userRepo.All().ToList());
 }
Ejemplo n.º 12
0
 public ActionResult Index()
 {
     return(View(invoiceRepository.All()));
 }