public ActionResult Register() { Registerviewmodel model = new Registerviewmodel(); model.UserType = 2; return(View(model)); }
public ActionResult unRegister_patient(int?id, string type) { hospital_managementEntities db = new hospital_managementEntities(); if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } if (type == "patient") { Register_patient p = db.Register_patient.Find(id); if (p == null) { return(HttpNotFound()); } else { Registerviewmodel R = new Registerviewmodel(); R.Email = p.email; R.Password = p.password; R.patient_id = p.id; R.Question = p.question; R.register_status = p.status; R.type = p.type; R.Answer = p.answer; return(View(R)); } } else if (type == "Doctor") { Register_doctor p = db.Register_doctor.Find(id); if (p == null) { return(HttpNotFound()); } else { RegisterDoctorviewmodel R = new RegisterDoctorviewmodel(); R.name = p.name; R.Email = p.email; R.Password = p.password; R.Doctor_id = p.id; R.Question = p.question; R.register_status = p.status; R.type = p.type; R.Category = p.category; R.Answer = p.answer; return(View(R)); } } else { return(HttpNotFound()); } }
public ActionResult Register(Registerviewmodel model, string returnurl) { if (ModelState.IsValid) { Member mem = new Member(); mem.MemberName = model.MemberName; mem.LastName = model.LastName; mem.UserName = model.UserName; mem.CreatedOn = DateTime.Now; mem.Password = EncryptDecrypt.Encrypt(model.Password, true); mem.IsActive = true; _unitOfWork.GetRepositoryInstance <Member>().Add(mem); return(RedirectToAction("Index", "Home")); } return(View("Register", model)); }
public ActionResult Approve_status() { list_p_d list = new list_p_d(); hospital_managementEntities db = new hospital_managementEntities(); foreach (Register_patient p in db.Register_patient) { if (p.status == 0) { Registerviewmodel R = new Registerviewmodel(); R.Email = p.email; R.Password = p.password; R.patient_id = p.id; R.Question = p.question; R.register_status = p.status; R.Answer = p.answer; R.type = p.type; R.ConfirmPassword = p.password; list.list_patient.Add(R); } } foreach (Register_doctor p in db.Register_doctor) { if (p.status == 0) { RegisterDoctorviewmodel R = new RegisterDoctorviewmodel(); R.Email = p.email; R.name = p.name; R.Password = p.password; R.Doctor_id = p.id; R.Question = p.question; R.register_status = p.status; R.Answer = p.answer; R.type = p.type; R.Category = p.category; R.ConfirmPassword = p.password; list.list_doctor.Add(R); } } return(View(list)); }
public ActionResult Register(Registerviewmodel model) { try { Register_patient R = new Register_patient(); R.type = "patient"; R.answer = model.Answer; R.email = model.Email; R.password = model.Password; R.question = model.Question; R.status = 0; int k = 0; hospital_managementEntities db = new hospital_managementEntities(); foreach (Register_patient t in db.Register_patient) { if (t.email == model.Email) { ViewBag.error = "this email already exists"; k = 1; } } if (k == 0) { db.Register_patient.Add(R); db.SaveChanges(); return(RedirectToAction("MakeAppointment", "Patient")); } else { return(View()); } } catch (Exception e) { return(View()); } }