// GET: Availability public ActionResult Index() { string name = User.Identity.Name; string ADocFK = gu.RetournerByCondition(x => x.UserName == name).First().Id; var Liste = Ga.RetournerByCondition(x => x.DocFK == ADocFK); return(View(Liste)); }
// GET: Appointment public ActionResult Index() { string name = User.Identity.Name; string ADocFK = gu.RetournerByCondition(x => x.UserName == name).First().Id; var Liste = Ga.RetournerByCondition(x => x.DocFK == ADocFK, x => x.statut == 2); var lista = from d in Liste where d.statut == 1 select d; ViewBag.events = lista; return(View(lista)); }
public ActionResult Chatt() { GestionUser gu = new GestionUser(); ViewBag.Message = "Your contact page."; ViewBag.hdnCurrentUserName = User.Identity.Name; ViewBag.hdnCurrentUserID = gu.RetournerByCondition(x => x.UserName == User.Identity.Name).First().Id; return(View()); }
public ActionResult Register(RegisterViewModel model) { if (ModelState.IsValid) { GestionUser gu = new GestionUser(); var result1 = gu.RetournerByCondition(x => (x.UserName == model.UserName)); var result2 = gu.RetournerByCondition(x => (x.Email == model.Email)); if (result1.Count() == 0) { if (result2.Count() != 0) { ModelState.AddModelError("", "Email is already taken."); return(View(model)); } User user = new User { UserName = model.UserName, Email = model.Email, FirstName = model.FirstName, LastName = model.LastName, Ville = model.ville }; Session["user"] = user; Session["username"] = model.UserName; Session["passowrd"] = model.Password; if (model.Role == "patient") { return(RedirectToAction("Register3", "Account")); } else { return(RedirectToAction("Register2", "Account")); } } else { ModelState.AddModelError("", "UserName is already taken."); } return(View(model)); } // If we got this far, something failed, redisplay form return(View(model)); }