Ejemplo n.º 1
0
        public ActionResult Edit(int?id, int?ScheduleRecordID)
        {
            PatientEditViewModel model = new PatientEditViewModel();

            if (id == null || id == 0)
            {
                model.CreateNewDentalCards();
                UserInfo userInfo = _UserInfoService.GetUserInfo(Int32.Parse(User.Identity.GetUserId()));
                if (userInfo != null)
                {
                    model.CountryId = userInfo.CountryId;
                    model.CityId    = userInfo.CityId;
                }
            }
            else
            {
                Patient patientInfo = _patientService.GetPatientInfo((int)id, Int32.Parse(User.Identity.GetUserId()));
                ViewBag.Debt = patientInfo.Debt;
                if (patientInfo == null)
                {
                    throw new HttpException(404, "Patient not found"); // TODO: need not found page
                }
                else
                {
                    model.FromEntity(patientInfo);
                }
            }
            model.ScheduleRecordId = ScheduleRecordID ?? 0;
            FillCountryAndCity(model);

            return(View(model));
        }
Ejemplo n.º 2
0
        public ActionResult Review(int?id)
        {
            PatientEditViewModel model = new PatientEditViewModel();

            if (id != null && id != 0)
            {
                Patient patientInfo = _patientService.GetPatientInfo((int)id, Int32.Parse(User.Identity.GetUserId()));
                ViewBag.Debt = patientInfo.Debt;
                if (patientInfo == null)
                {
                    throw new HttpException(404, "Patient not found"); // TODO: need not found patient page
                }
                else
                {
                    model.FromEntity(patientInfo);
                    FillCountryAndCity(model);
                }
            }
            else
            {
                throw new HttpException(404, "Page not found");
            }
            return(View(model));
        }