using HL_FristAidPlatform_DataBase; using HL_FristAidPlatform_Help; using HL_FristAidPlatform_IDataBase; using HL_FristAidPlatform_Models; using System; namespace HL_FristAidPlatform_Bussiness { public class T_Service_Apoplexy_EmergencyRoomBLL { private IT_Service_Apoplexy_EmergencyRoom IService = new T_Service_Apoplexy_EmergencyRoomDB(); public MessageModel Add(T_Service_Apoplexy_EmergencyRoom model) { if (!string.IsNullOrEmpty(model.ArrivalCTRoomTime) && !string.IsNullOrEmpty(model.CTExaminationCompletionTime)) { model.CTToEC = GetTime(Convert.ToDateTime(model.ArrivalCTRoomTime), Convert.ToDateTime(model.CTExaminationCompletionTime)); } else { model.CTToEC = ""; } if (!string.IsNullOrEmpty(model.BloodCollectionTime) && !string.IsNullOrEmpty(model.BloodRoutineReportTime)) { model.BloodCollectionToReportTime = GetTime(Convert.ToDateTime(model.BloodCollectionTime), Convert.ToDateTime(model.BloodRoutineReportTime)); } else { model.BloodCollectionToReportTime = ""; } if (IService.Add(model)) { return new MessageModel { Success = true, Msg = "操作成功" }; } else { return new MessageModel { Success = false, Msg = "操作失败" }; } } public MessageModel Delete(int id) { if (IService.Delete(id)) { return new MessageModel { Success = true, Msg = "操作成功" }; } else { return new MessageModel { Success = false, Msg = "操作失败" }; } } public T_Service_Apoplexy_EmergencyRoom Get(long guid) { return IService.Get(guid); } public TableModel GetPageList(int pageIndex, int pageSize) { return IService.GetPageList(pageIndex, pageSize); } public static string GetTime(DateTime timeA,DateTime timeB) { //timeA 表示需要计算 TimeSpan ts = timeB - timeA; //计算时间差 string time = ts.TotalMinutes.ToString(); //将时间差转换为秒 return time; } public MessageModel Update(T_Service_Apoplexy_EmergencyRoom model) { if (!string.IsNullOrEmpty(model.ArrivalCTRoomTime) && !string.IsNullOrEmpty(model.CTExaminationCompletionTime)) { model.CTToEC = GetTime(Convert.ToDateTime(model.ArrivalCTRoomTime), Convert.ToDateTime(model.CTExaminationCompletionTime)); } else { model.CTToEC = ""; } if (!string.IsNullOrEmpty(model.BloodCollectionTime) && !string.IsNullOrEmpty(model.BloodRoutineReportTime)) { model.BloodCollectionToReportTime = GetTime(Convert.ToDateTime(model.BloodCollectionTime), Convert.ToDateTime(model.BloodRoutineReportTime)); } else { model.BloodCollectionToReportTime = ""; } if (IService.Update(model)) { return new MessageModel { Success = true, Msg = "操作成功" }; } else { return new MessageModel { Success = false, Msg = "操作失败" }; } } public TableModel GetByPatientGuid(string patientGuid) { return IService.GetByPatientGuid(patientGuid); } public TableModel GetModelByReport(string where) { return IService.GetModelByReport(where); } } }