Exemple #1
0
        public ActionResult Index()
        {
            IPostRepo      repo      = new PostRepo();
            List <Post>    postList  = repo.GetAll();
            IApplyInfoRepo ApplyRepo = new ApplyInfoRepo();

            TempData["count"] = ApplyRepo.CountApplies();
            return(View(postList));
        }
Exemple #2
0
 public ActionResult Apply(int id)
 {
     if (Session["tutor"] == "True")
     {
         ApplyInfo info = new ApplyInfo();
         info.PostId     = id;
         info.TutorEmail = Session["UserEmail"].ToString();
         IApplyInfoRepo repo = new ApplyInfoRepo();
         repo.Insert(info);
         TempData["Apply"] = "You succesfully Applied for this post !";
         IPostRepo   Prepo    = new PostRepo();
         List <Post> postList = Prepo.GetAll();
         return(View(postList));
     }
     else
     {
         TempData["Welcome"] = "You need to be looged in to Apply!";
         return(RedirectToAction("Index", "Login"));
     }
 }
Exemple #3
0
        public ActionResult Index()
        {
            List <String>    email     = new List <String>();
            List <Tutor>     tutorList = new List <Tutor>();
            IApplyInfoRepo   repo      = new ApplyInfoRepo();
            List <ApplyInfo> info      = repo.GetAll();

            foreach (var item in info)
            {
                email.Add(item.TutorEmail);
            }
            ITutorRepo tutorRepo = new TutorRepo();

            foreach (var mailId in email)
            {
                tutorList.Add(tutorRepo.Get(mailId));
            }

            return(View(tutorList));
        }