using HL_FristAidPlatform_DataBase; using HL_FristAidPlatform_Help; using HL_FristAidPlatform_IDataBase; using HL_FristAidPlatform_Models; using System; namespace HL_FristAidPlatform_Bussiness { /// /// 动静脉畸形AVM诊疗登记表 /// public class T_Service_Apoplexy_NCXAVMBLL { private IT_Service_Apoplexy_NCXAVM IService = new T_Service_Apoplexy_NCXAVMDB(); public T_Service_Apoplexy_NCXAVM Add(T_Service_Apoplexy_NCXAVM model) { return IService.Add(model); } public MessageModel Update(T_Service_Apoplexy_NCXAVM model) { if (IService.Update(model) > 0) { return new MessageModel { Success = true, Msg = "操作成功" }; } else { return new MessageModel { Success = false, Msg = "操作失败" }; } } public MessageModel AddORUpdate(T_Service_Apoplexy_NCXAVM model) { //先查询有没有该患者数据 T_Service_Apoplexy_NCXAVM anxywb = new T_Service_Apoplexy_NCXAVM(); anxywb = IService.GetByPatientGuid_AVM(model.PatientGuid); if (anxywb != null) //有执行修改操作 { model.GUID = anxywb.GUID; if (IService.Update(model) > 0) { return new MessageModel { Success = true, Msg = "修改成功" }; } else { return new MessageModel { Success = false, Msg = "修改失败" }; } } else { //没有执行新增操作 model.GUID = Guid.NewGuid().ToString(); if (Add(model) == null) { return new MessageModel { Success = true, Msg = "新增成功" }; } else { return new MessageModel { Success = true, 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_NCXAVM Get(long id) { return IService.Get(id); } public T_Service_Apoplexy_NCXAVM GetByPatientGuid_AVM(string PatientGuid) { return IService.GetByPatientGuid_AVM(PatientGuid); } public TableModel GetPageList(int pageIndex, int pageSize) { return IService.GetPageList(pageIndex, pageSize); } public TableModel GetByPatientGuidAndReportType(string patientGuid) { return IService.GetByPatientGuidAndReportType(patientGuid); } } }