public ActionResult SendAppl(string letter)
        {
            if (letter.Length == 0)
            {
                TempData["Error"] = "To save, Cover Letter must be given";
                return View("Apply");
            }

            // Update Application and User
            Application app = new Application();
            var user = repo.FindUserById(User.Identity.GetUserId());
            if (user.CVurl != null)
            {
            app.uId = user.Id;
            app.CoverLetter = letter;
            int test;
            int.TryParse(TempData["AppId"].ToString(), out test);
            app.vId = test;

                db.application.Add(app);
                db.SaveChanges();
                letter = "";
                TempData["Error"] = "Your application has been submitted.";
            aRepo.Save(app);
            //return RedirectToAction("Index");
        }
            else
            {
                TempData["Error"] = "You have to load up your CV! Click Welcome in the header.";
            }

            return View("Apply");
        }
        public ActionResult Apply(string letter)
        {
            if (letter.Length == 0)
            {
                TempData["Error"] = "To save, Cover Letter must be given";
                return RedirectToAction("Index");
            }
 
            // Update Application and User
            Application app = new Application();
            var user = repo.FindUserById(User.Identity.GetUserId());
            app.uId = user.Id;
            app.CoverLetter = letter;
            int test;
            int.TryParse(TempData["AppId"].ToString(), out test);
            app.vId = test;

            aRepo.Save(app);
            return View("Index");
        }