public ActionResult AddPatient(Common.Doctor d, Common.DiagnosisPatient dp, Common.PatientsEmployee pe, Common.Patient pat, Common.Person per, string txtStreetP, string txtPropertyP, Guid?locality, Guid?street, string txtOnc, Guid?ddOnc, string txtCon, Guid?ddCon, string txtFD, Guid?ddFD) { BusinessLayer.PatientsBL patient = new BusinessLayer.PatientsBL(); try { if (per.IdCardNumber != null) { if (patient.CheckRegister(per.IdCardNumber)) { patient.RegisterPerson(per, txtStreetP, txtPropertyP, locality, street); pat.Personfk = per.PersonID; patient.RegisterPatient(pat); if (pe.EmployeeId_fk != Guid.Empty) { patient.AddKeyWorker(pe); } if (dp.DiagnosisType_fk != Guid.Empty && dp.DiagnosisType_fk != null)//Issue Fix it { patient.AddDiagnosis(dp); } patient.AddDoctor(d, txtCon, txtOnc, txtFD, ddCon, ddFD, ddOnc); } } else { patient.RegisterPerson(per, txtStreetP, txtPropertyP, locality, street); pat.Personfk = per.PersonID; patient.RegisterPatient(pat); if (pe.EmployeeId_fk != Guid.Empty) { patient.AddKeyWorker(pe); } if (dp.DiagnosisType_fk != Guid.Empty && dp.DiagnosisType_fk != null)//Issue Fix it { patient.AddDiagnosis(dp); } patient.AddDoctor(d, txtCon, txtOnc, txtFD, ddCon, ddFD, ddOnc); } } catch (Exception ex) { throw ex; } return(Json("Valid", JsonRequestBehavior.AllowGet)); }
public ActionResult AddNextOfKin(Common.NextOfKin nok, Common.Person personNOK, string txtStreetNOK, string txtPropertyNOK, Guid?localityNOK, Guid?streetNOK) { BusinessLayer.PatientsBL patient = new BusinessLayer.PatientsBL(); try { //nok.PatientId_fk = Int32.Parse(PatientIds); patient.RegisterPerson(personNOK, txtStreetNOK, txtPropertyNOK, localityNOK, streetNOK); nok.Personfk = personNOK.PersonID; patient.AddNextOfKin(nok); } catch (Exception ex) { throw ex; } return(Json(null, JsonRequestBehavior.AllowGet)); }