コード例 #1
0
        public IActionResult New(RegistrationNewEditViewModel model, string name = "", string id = "", string phone = "", string age = "", string gender = "")
        {
            if (!string.IsNullOrEmpty(name))
            {
                model.Patient.Person.Name = name;
            }
            if (!string.IsNullOrEmpty(id))
            {
                model.Patient.PI.Identifier = id;
            }
            if (!string.IsNullOrEmpty(gender))
            {
                model.Patient.Person.Name = gender;
            }
            if (!string.IsNullOrEmpty(phone))
            {
                model.Patient.Person.Address.Telephone = phone;
            }
            if (!string.IsNullOrEmpty(age) && Double.TryParse(age, out double dblAge) && double.Parse(age) > 0)
            {
                model.DateOfBirth = DateTime.Now.AddYears(0 - Int32.Parse(age)).ToString("dd/MM/yyyy");
            }

            model.IdType = IPatientService.GetPatientIdentificationTypes();

            return(View(model));
        }
コード例 #2
0
        public IActionResult Edit(string p, RegistrationNewEditViewModel model)
        {
            model.Patient = IPatientService.GetPatient(p);

            model.IdType = IPatientService.GetPatientIdentificationTypes();
            return(View(model));
        }
コード例 #3
0
        public IActionResult Edit(string p, RegistrationNewEditViewModel model)
        {
            if (string.IsNullOrEmpty(p))
            {
                return(LocalRedirect("/registration/search"));
            }

            model.Patient     = IPatientService.GetPatient(p);
            model.IdType      = IPatientService.GetPatientIdentificationTypes();
            model.DateOfBirth = model.Patient.Person.DateOfBirth.ToString("dd/MM/yyyy");

            return(View(model));
        }