using HealthchoiceMVC.Models; using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.Mvc; using Microsoft.AspNet.Identity; using HealthchoiceMVC.Services; using HealthchoiceMVC.NonDbModels; namespace HealthchoiceMVC.Controllers { public class HomeController : Controller { private ApplicationDbContext dbUser = new ApplicationDbContext(); //to access users private HCDBEntities db = new HCDBEntities(); //to access HCDB private HCLocalService service = new HCLocalService(); public ActionResult Index() { if (User.Identity.IsAuthenticated) { ApplicationUser currentuser = dbUser.Users.Find(User.Identity.GetUserId()); string PageMessage = "
"; ; ViewBag.EmailConfirmed = currentuser.EmailConfirmed; ViewBag.UserId = currentuser.Id; string userType = ""; if (currentuser.EmailConfirmed == false) { PageMessage = "
An email was sent to your captured email address for confirmation of the captured address. Please complete the registration process by clicking on the link provided in the email. If you have not received the email after a few minutes you can resend it by clicking on the button below"; } else if (currentuser.AccountType==4) //Provider { bool isConfirmed = false; foreach(var role in currentuser.Roles) { if (role.ToString() == "Provider") { isConfirmed = true; } } if(isConfirmed==false) PageMessage = "
You have completed the first part of your registration. The validation of your details is in progress and may take up to 48 hours at which point you’ll receive a contract document from us. Please complete this by initialling each page and signing the last page and then fax / email the completed document to (086) 730-3236 or contracts@healthchoice.co.za. If 48 hours has passed since you have registered and have not heard back from us yet, please alert us to this on 0860blablabla or to contracts@healthchoice.co.za.
"; } ViewBag.PageMessage = PageMessage; ViewBag.UserType = "