public ActionResult profile(string id) { List <OPDPatient> OPDPatientList = new List <OPDPatient>(); List <Diagnosis> DiagnosisList = new List <Diagnosis>(); List <Timeline> TimelineList = new List <Timeline>(); Property p = new Property(); DataSet ds = new DataSet(); p.OnTable = "PatientDetails"; p.Condition1 = id; ds = dl.FetchOpdPatient_sp(p); OPDPatient info = new RXGOADMIN.Models.OPDPatient(); try { info = new RXGOADMIN.Models.OPDPatient() { OPDId = ds.Tables[0].Rows[0]["OPDId"].ToString(), PatientId = ds.Tables[0].Rows[0]["PatientId"].ToString(), PatientUniqueId = ds.Tables[0].Rows[0]["PatientUniqueId"].ToString(), Gender = ds.Tables[0].Rows[0]["Gender"].ToString(), MaritalStatus = ds.Tables[0].Rows[0]["MaritalStatus"].ToString(), Phone = ds.Tables[0].Rows[0]["Phone"].ToString(), Email = ds.Tables[0].Rows[0]["Email"].ToString(), Address = ds.Tables[0].Rows[0]["Address"].ToString(), //Age= ds.Tables[0].Rows[0]["Age"].ToString(), Year = ds.Tables[0].Rows[0]["Year"].ToString(), Month = ds.Tables[0].Rows[0]["Month"].ToString(), GuardianName = ds.Tables[0].Rows[0]["GuardianName"].ToString(), Name = ds.Tables[0].Rows[0]["Name"].ToString(), PatientPhoto = ds.Tables[0].Rows[0]["PatientPhoto"].ToString(), }; } catch (Exception ex) { } foreach (DataRow item in ds.Tables[1].Rows) { OPDPatient m = new OPDPatient(); m.OPDId = item["OPDId"].ToString(); m.OPDNo = item["OPDNo"].ToString(); m.AppointmentDate = item["AppointmentDate"].ToString(); m.ConsultantDoctor = item["ConsultantDoctor"].ToString(); m.Reference = item["Reference"].ToString(); m.Symptoms = item["Symptoms"].ToString(); m.SymptomsTitle = item["SymptomsTitle"].ToString(); OPDPatientList.Add(m); } ViewBag.OPDPatientList = OPDPatientList; foreach (DataRow item in ds.Tables[2].Rows) { Diagnosis dis = new Diagnosis(); dis.DId = item["DiagnosisId"].ToString(); dis.ReportDate = item["ReportDate"].ToString(); dis.ReportType = item["ReportType"].ToString(); dis.Description = item["Description"].ToString(); dis.Attachment = item["Attachment"].ToString(); DiagnosisList.Add(dis); } ViewBag.DiagnosisList = DiagnosisList; foreach (DataRow item in ds.Tables[3].Rows) { Timeline t = new Timeline(); t.TId = item["TId"].ToString(); t.Date = item["Date"].ToString(); t.Title = item["Title"].ToString(); t.Description = item["Description"].ToString(); t.Attachment = item["Attachment"].ToString(); TimelineList.Add(t); } ViewBag.TimelineList = TimelineList; List <SelectListItem> DoctorList = new List <SelectListItem>(); DoctorList.Add(new SelectListItem { Text = "Select", Value = "" }); foreach (DataRow dr in ds.Tables[4].Rows) { DoctorList.Add(new SelectListItem { Text = dr["FullName"].ToString(), Value = dr["EmployeeId"].ToString() }); } ViewBag.DoctorList = new SelectList(DoctorList, "Value", "Text"); List <SelectListItem> SymptomsType = new List <SelectListItem>(); SymptomsType.Add(new SelectListItem { Text = "Select", Value = "" }); foreach (DataRow dr in ds.Tables[5].Rows) { SymptomsType.Add(new SelectListItem { Text = dr["SymptomsType"].ToString(), Value = dr["SymptomsTypeId"].ToString() }); } ViewBag.SymptomsType = new SelectList(SymptomsType, "Value", "Text"); List <SelectListItem> TPA = new List <SelectListItem>(); TPA.Add(new SelectListItem { Text = "Select", Value = "" }); foreach (DataRow dr in ds.Tables[6].Rows) { TPA.Add(new SelectListItem { Text = dr["TPAName"].ToString(), Value = dr["TPAId"].ToString() }); } ViewBag.TPA = new SelectList(TPA, "Value", "Text"); return(View(info)); }