Example #1
0
        public ActionResult Confirmation(RegisterPack doctor)
        {
            ViewBag.IsLogin = false;
            try
            {
                if (!ModelState.IsValid)
                {
                    if (doctor.RegisterModel.Agree.ToString() == "False")
                    {
                        return(View("Register", doctor));
                    }
                    else
                    {
                        TempData["Error"] = "خطا در مقادیر ورودی...دوباره امتحان کنید";
                        return(RedirectToAction("Register", doctor));
                    }
                }
                PezeshkPlusEntities db = new PezeshkPlusEntities();

                List <int?> medicalFieldID = db.USP_SEL_MedicalFieldID(doctor.RegisterModel.MedicalField).ToList();

                db.USP_INS_Doctor(doctor.RegisterModel.FirstName, doctor.RegisterModel.LastName, doctor.RegisterModel.Email, doctor.RegisterModel.Password, doctor.RegisterModel.PhoneNumber, doctor.RegisterModel.Province, doctor.RegisterModel.City, medicalFieldID[0], doctor.RegisterModel.NationalID, doctor.RegisterModel.ClinicPhone, doctor.RegisterModel.Address);

                return(View());
            }
            catch (Exception)
            {
                TempData["Error"] = "خطا...دوباره امتحان کنید";
                return(RedirectToAction("Register"));
            }
        }