public List<AppoitmentPatient> GetAppoitmentPatientList(DataConnection pclsCache, string healthCoachID, string Status) { List<AppoitmentPatient> list = new List<AppoitmentPatient>(); List<PatientsByStatus> list1 = new List<PatientsByStatus>(); if (Status == "{Status}") { Status = "-1"; } list1 = GetPatientsByStatus(pclsCache, healthCoachID, Status); if (list1 != null) { for (int i = 0; i < list1.Count; i++) { AppoitmentPatient app = new AppoitmentPatient(); app.PatientID = list1[i].PatientId; app.module = list1[i].Module; app.AppointmentStatus = list1[i].Status; app.Description = list1[i].Description; //app.ApplicationTime = list1[i].ApplicationTime; string[] DateAndTime = list1[i].ApplicationTime.Split(' ');//日期和时间分开 string Date = DateAndTime[0]; string[] YMD = Date.Split('/');//年月日分开 string month = YMD[1]; string day = YMD[2]; if (month.Length < 2) { month = "0" + month; } if (day.Length < 2) { day = "0" + day; } app.ApplicationTime = YMD[0] + "-" + month + "-" + day + " " + DateAndTime[1]; string[] DateAndTime1 = list1[i].AppointmentTime.Split(' ');//日期和时间分开 string Date1 = DateAndTime1[0]; string[] YMD1 = Date1.Split('/');//年月日分开 string month1 = YMD1[1]; string day1 = YMD1[2]; if (month1.Length < 2) { month1 = "0" + month1; } if (day1.Length < 2) { day1 = "0" + day1; } app.AppointmentTime = YMD1[0] + "-" + month1 + "-" + day1 + " " + DateAndTime1[1]; app.AppointmentAdd = list1[i].AppointmentAdd; if (app.PatientID != "") { //list[i].imageURL = Ps.DoctorInfoDetail.GetValue(pclsCache.CacheConnectionObject, app.PatientID, "Contact", "Contact001_4", 1); app.imageURL = new UsersMethod().GetPatientValue(pclsCache, app.PatientID, "Contact", "Contact001_4", 1);//病人照片 UserBasicInfo ret = new UserBasicInfo(); ret = new UsersMethod().GetUserBasicInfo(pclsCache, app.PatientID); if (ret != null) { app.name = ret.UserName; app.age = ret.Age; //app.age = Convert.ToString(Ps.BasicInfo.GetAgeByBirthDay(pclsCache.CacheConnectionObject, Convert.ToInt32(ret.Birthday))); app.sex = ret.Gender; } } list.Add(app); } } return list; }
public List<AppoitmentPatient> GetAppoitmentPatientList(DataConnection pclsCache, string healthCoachID, string Status) { List<AppoitmentPatient> list = new List<AppoitmentPatient>(); List<PatientsByStatus> list1 = new List<PatientsByStatus>(); try { list1 = GetPatientsByStatus(pclsCache, healthCoachID, Status); if (list1 != null) { for (int i = 0; i < list1.Count; i++) { AppoitmentPatient app = new AppoitmentPatient(); app.PatientID = list1[i].PatientId; app.module = list1[i].Module; app.AppointmentStatus = list1[i].Status; app.Description = list1[i].Description; app.ApplicationTime = list1[i].ApplicationTime; app.ApplicationTime = list1[i].ApplicationTime; app.AppointmentAdd = list1[i].AppointmentAdd; if (app.PatientID != "") { //list[i].imageURL = Ps.DoctorInfoDetail.GetValue(pclsCache.CacheConnectionObject, app.PatientID, "Contact", "Contact001_4", 1); app.imageURL = new UsersMethod().GetPatientValue(pclsCache, app.PatientID, "Contact", "Contact001_4", 1);//病人照片 UserBasicInfo ret = new UserBasicInfo(); ret = new UsersMethod().GetUserBasicInfo(pclsCache, app.PatientID); if (ret != null) { app.name = ret.UserName; app.age = ret.Age; //app.age = Convert.ToString(Ps.BasicInfo.GetAgeByBirthDay(pclsCache.CacheConnectionObject, Convert.ToInt32(ret.Birthday))); app.sex = ret.Gender; } } list.Add(app); } } return list; } catch (Exception ex) { HygeiaComUtility.WriteClientLog(HygeiaEnum.LogType.ErrorLog, "UserMethod.GetAppoitmentPatientList", "数据库操作异常! error information : " + ex.Message + Environment.NewLine + ex.StackTrace); return null; } finally { pclsCache.DisConnect(); } }