Ejemplo n.º 1
0
        public static void GetAllAwards()
        {
            var collection = awardLogic.GetAllAwards();

            foreach (var item in awardLogic.GetAllAwards())
            {
                Console.WriteLine(item);
            }
        }
Ejemplo n.º 2
0
 public static void GetAllAwards()
 {
     foreach (var item in awardLogic.GetAllAwards())
     {
         Console.WriteLine(item);
     }
 }
Ejemplo n.º 3
0
 private static void ShowAwards(IAwardLogic awardLogic)
 {
     Console.WriteLine("Id Title");
     foreach (Award award in awardLogic.GetAllAwards())
     {
         Console.WriteLine(award);
     }
 }
Ejemplo n.º 4
0
        public IEnumerable <DisplayUserVM> GetAllUsersWithAwards()
        {
            var awards = awardBll.GetAllAwards().ToArray();
            var users  = userBll.GetAllUsers().ToList();
            List <DisplayUserVM> usersVM = Mapper.Map <IEnumerable <DisplayUserVM> >(userBll.GetAllUsers()).ToList();

            for (int i = 0; i < usersVM.Count; i++)
            {
                usersVM[i].Awards = awardBll.GetAwardsForUser(usersVM[i].Id).ToList();
            }

            return(usersVM);
        }
Ejemplo n.º 5
0
        public ActionResult Index()
        {
            ViewBag.Message = "Award List";
            var listOfEntities             = awardLogic.GetAllAwards();
            List <AwardModel> listOfModels = new List <AwardModel>();

            foreach (var item in listOfEntities)
            {
                listOfModels.Add(new AwardModel
                {
                    ID    = item.ID,
                    Title = item.Title
                });
            }
            return(View(listOfModels));
        }
Ejemplo n.º 6
0
        public ActionResult ShowPotentialUserAwards(int id)
        {
            ViewBag.User = userLogic.GetUserByID(id);
            List <Award>      listOfEntities = (List <Award>)awardLogic.GetAllAwards();
            List <Award>      alreadyAwarded = (List <Award>)userAndAwardLogic.GetAwardsOfUserByID(id);
            List <AwardModel> listOfModels   = new List <AwardModel>();

            foreach (var item in listOfEntities)
            {
                if (alreadyAwarded.Find(x => x.ID == item.ID) == null)
                {
                    listOfModels.Add(new AwardModel
                    {
                        ID    = item.ID,
                        Title = item.Title
                    });
                }
            }
            return(View(listOfModels));
        }
Ejemplo n.º 7
0
 public IEnumerable <AwardDTO> GetAllAwards()
 {
     return(awardBll.GetAllAwards());
 }
Ejemplo n.º 8
0
        private static void ListAllAwards(IAwardLogic awardLogic)
        {
            try
            {
                foreach (var award in awardLogic.GetAllAwards())
                {
                    Console.WriteLine($"{award.Id}. Title: \"{award.Title}\"");
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }

            Console.WriteLine();
        }