public ActionResult Index(string fFile, string returnUrl) { ApplicationUser user = GetUser(); if (user == null) { return(RedirectToAction("Login", "Account")); } _filename = fFile; Guid userId = GetUserId(); Applicant applicant = applicantService.GetApplicant(userId); string emailAddress = GetUserEmail(); if (applicant == null) { //applicant = appService.CreateApplicant(userId, emailAddress); applicant = new Applicant { RegisterId = userId, InternalDatabaseID = Guid.NewGuid(), Email = emailAddress }; } else { applicant.Email = emailAddress; } if (fFile != null) { string daxUrl = WebConfigurationManager.AppSettings["daxtraurl"]; string daxAccountName = WebConfigurationManager.AppSettings["daxtrausername"]; string path = Path.Combine(Server.MapPath("~/resumes"), fFile); string hrxml_profile = ApplicantService.ParseResume(applicant, path); } if (returnUrl == null) { if (Session["url"] != null) { if (applicant.Id != 0) { returnUrl = Session["url"].ToString(); return(Redirect(returnUrl)); } } } IEnumerable <SelectListItem> states = AppHelper.GetStateList(); var db = new ApplicationDbContext(); StateLookup state; if (!string.IsNullOrWhiteSpace(applicant.State)) { state = db.StateLookups.Where(a => a.Abbreviation == applicant.State).FirstOrDefault(); ViewBag.StateList = new SelectList(states, "Value", "Text", state.Id); foreach (var item in states) { if (item.Text == state.State) { item.Selected = true; } } } else { ViewBag.StateList = new SelectList(states, "Value", "Text", null); } return(View(applicant)); }