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)); }
public IActionResult Edit(string p, RegistrationNewEditViewModel model) { model.Patient = IPatientService.GetPatient(p); model.IdType = IPatientService.GetPatientIdentificationTypes(); return(View(model)); }
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)); }