Exemplo n.º 1
0
        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");
        }
Exemplo n.º 2
0
        public ActionResult Edit(PatientModel _user)
        {
            MembershipUser _getCurrentUser = Membership.GetUser(_user.UserName);
            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 RedirectToAction("PatientList", "Patient");
        }
Exemplo n.º 3
0
 public ActionResult Registration(PatientModel _pmodel)
 {
     Guid getuserkey = (Guid)_pmodel.doctorkey;
     if (getuserkey != default(Guid))
     {
         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);
         ViewBag.result = msg;
     }
     else
     {
         ViewBag.result = "Error, invitation code has been suspended!";
     }
     return View(_pmodel);
 }
Exemplo n.º 4
0
 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);
 }
Exemplo n.º 5
0
        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);
        }
Exemplo n.º 6
0
 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();
 }