public ActionResult Registration(string id) { PatientModel _getregmodel = new PatientModel(); if (!string.IsNullOrEmpty(id)) { Guid getid = new Guid(id); Registeruser _getpinfo = PatientManage.patientInfobyregid(getid); if (_getpinfo != null) { _getregmodel.doctorkey = _getpinfo.DoctorKey; _getregmodel.Email = _getpinfo.Email; _getregmodel.Name = _getpinfo.Name; _getregmodel.PhoneNumber = _getpinfo.PhoneNumber; _getregmodel.DOB = _getpinfo.DOB; _getregmodel.Address1 = _getpinfo.Address1; _getregmodel.Address2 = _getpinfo.Address2; } else { ViewBag.result = "Invitation code has been suspended!"; } } else { return(RedirectToAction("Index", "Patient")); } return(View(_getregmodel)); }
public ActionResult Edit([Bind(Include = "Pid,Pname,Address1,Address2,Gender,DOB,PContactNumber,PEmail,Cretedby,Modifiedby,Creteddate,Modifieddate,RefCityid")] PatientManage patientManage) { if (ModelState.IsValid) { try { var ModifiedName = Convert.ToString(Session["AdminName"]); patientManage.Modifiedby = ModifiedName; patientManage.Modifieddate = DateTime.Now; db.Entry(patientManage).State = EntityState.Modified; db.SaveChanges(); TempData["msg"] = "Patient Details Updated!!"; return(RedirectToAction("Index")); } catch (Exception ex) { TempData["err"] = ex.Message; } } ViewBag.CountryId = new SelectList(db.CountryMasters.ToList(), "CountryId", "CountryName"); ViewBag.StateId = new List <SelectListItem>() { new SelectListItem() { Text = "", Value = "Select State" } }; ViewBag.RefCityid = new SelectList(db.CityMasters, "CityId", "CityName", patientManage.RefCityid); return(View(patientManage)); }
public ActionResult Edit(int id) { MembershipUser _getCurrentUser = Membership.GetUser(); PatientModel _getmodel = new PatientModel(); if (_getCurrentUser != null) { bool IsRole = Roles.IsUserInRole("Doctor"); if (IsRole) { Guid _doctorkey = (Guid)_getCurrentUser.ProviderUserKey; Registeruser _profile = PatientManage.EditUser(id, _doctorkey); if (_profile != null) { _getmodel.UserName = _profile.UserName; _getmodel.Email = _profile.Email; _getmodel.Name = _profile.Name; _getmodel.MedicalHistory = _profile.MedicalHistory; _getmodel.PatientHistorical = _profile.PatientHistorical; _getmodel.PersonalMotivator = _profile.PersonalMotivator; _getmodel.PhoneNumber = _profile.PhoneNumber; _getmodel.DOB = _profile.DOB; _getmodel.Address1 = _profile.Address1; _getmodel.Address2 = _profile.Address2; } return(View(_getmodel)); } } return(RedirectToAction("Index", "Patient")); }
public ActionResult PatientList() { MembershipUser _getCurrentUser = Membership.GetUser(); if (_getCurrentUser != null) { bool IsRole = Roles.IsUserInRole("Doctor"); if (IsRole) { Guid _getUserkey = (Guid)_getCurrentUser.ProviderUserKey; List <PatientProfile> _profile = PatientManage.GetPatientList(_getUserkey); return(View(_profile)); } else { return(RedirectToAction("Index", "Patient")); } } else { return(RedirectToAction("Index", "Patient")); } return(RedirectToAction("Index", "Patient")); }
public ActionResult Register(PatientModel _pmodel, FormCollection _frm) { MembershipUser _getCurrentUser = Membership.GetUser(); Guid getuserkey = (Guid)_getCurrentUser.ProviderUserKey; // Registeruser _newuser = new Registeruser() { Name = _pmodel.Name, UserName = _pmodel.UserName, Password = _pmodel.Password, Address1 = _pmodel.Address1, Address2 = _pmodel.Address2, DOB = _pmodel.DOB, Email = _pmodel.Email, MedicalHistory = _pmodel.MedicalHistory, PatientHistorical = _pmodel.PatientHistorical, PhoneNumber = _pmodel.PhoneNumber, PersonalMotivator = _pmodel.PersonalMotivator }; // string msg = Registeruser.RegisterPatient(_newuser, getuserkey); string IsexistUser = Membership.GetUserNameByEmail(_pmodel.Email); if (string.IsNullOrEmpty(IsexistUser)) { string msg = PatientManage.AddPatientInfo(_pmodel.Name, _pmodel.Address1, _pmodel.Address2, _pmodel.PhoneNumber, _pmodel.DOB, "", "", _pmodel.Email, "", getuserkey); if (msg == "Success") { ViewBag.result = "An invitation mail sent to the patient!"; } else { ViewBag.result = "Error occured!"; } } else { ViewBag.result = "Email Already Exist!"; } return(View(_pmodel)); }
// GET: Admin/PatientManages/Details/5 public ActionResult Details(int?id) { if (id == null) { return(RedirectToAction("Error", "Dashboard", new { err = "Id is not Avalible!!" })); } PatientManage patientManage = db.PatientManages.Find(id); if (patientManage == null) { return(RedirectToAction("Error", "Dashboard", new { err = "Data is not Avalible!!" })); } return(View(patientManage)); }
public ActionResult DeleteConfirmed(int id) { try { PatientManage patientManage = db.PatientManages.Find(id); db.PatientManages.Remove(patientManage); db.SaveChanges(); TempData["msg"] = "Patient Details Delete!!"; } catch (Exception ex) { TempData["err"] = ex.Message; } return(RedirectToAction("Index")); }
public ActionResult Profile(PatientModel _user) { MembershipUser _getCurrentUser = Membership.GetUser(); if (_getCurrentUser.Email != _user.Email) { _getCurrentUser.Email = _user.Email; Membership.UpdateUser(_getCurrentUser); } Registeruser _updateUser = new Registeruser { Name = _user.Name, DOB = _user.DOB, Address1 = _user.Address1, Address2 = _user.Address2, MedicalHistory = _user.MedicalHistory, PatientHistorical = _user.PatientHistorical, PhoneNumber = _user.PhoneNumber, PersonalMotivator = _user.PersonalMotivator }; Guid _getkey = (Guid)_getCurrentUser.ProviderUserKey; string msg = PatientManage.UpdateUser(_updateUser, _getkey); return(View(_user)); }
public ActionResult ForgotPass(PatientModel model) { if (!string.IsNullOrEmpty(model.Email)) { string password = Registeruser.GetUserPassword(model.Email); if (!string.IsNullOrEmpty(password)) { PatientManage.SendPassword(model.Email, string.Empty, password); ModelState.AddModelError("EmptyEmail", "Password has been sent to your email address !"); } else { ModelState.AddModelError("EmptyEmail", "Invalid email address!"); } } else { ModelState.AddModelError("EmptyEmail", "Invalid email address!"); } return(View()); }
// GET: Admin/PatientManages/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(RedirectToAction("Error", "Dashboard", new { err = "Id is not Avalible!!" })); } PatientManage patientManage = db.PatientManages.Find(id); if (patientManage == null) { return(RedirectToAction("Error", "Dashboard", new { err = "Data is not Avalible!!" })); } ViewBag.CountryId = new SelectList(db.CountryMasters.ToList(), "CountryId", "CountryName"); ViewBag.StateId = new List <SelectListItem>() { new SelectListItem() { Text = "", Value = "Select State" } }; ViewBag.RefCityid = new SelectList(db.CityMasters, "CityId", "CityName", patientManage.RefCityid); return(View(patientManage)); }
public JsonResult PatientContact(string pname, string padd1, string padd2, string pphone, string pdob, string pmedhis, string ppathis, string pemail, string pmot) { string msg = PatientManage.AddPatientInfo(pname, padd1, padd2, pphone, pdob, pmedhis, ppathis, pemail, pmot, new Guid()); return(Json(msg, JsonRequestBehavior.AllowGet)); }