100 lines
3.2 KiB
C#
100 lines
3.2 KiB
C#
|
using HL_FristAidPlatform_DataBase;
|
|||
|
using HL_FristAidPlatform_Help;
|
|||
|
using HL_FristAidPlatform_IDataBase;
|
|||
|
using HL_FristAidPlatform_Models;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace HL_FristAidPlatform_Bussiness
|
|||
|
{
|
|||
|
/// <summary>
|
|||
|
/// 动静脉畸形AVM诊疗登记表
|
|||
|
/// </summary>
|
|||
|
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<T_Service_Apoplexy_NCXAVM> Update(T_Service_Apoplexy_NCXAVM model)
|
|||
|
{
|
|||
|
if (IService.Update(model) > 0)
|
|||
|
{
|
|||
|
return new MessageModel<T_Service_Apoplexy_NCXAVM> { Success = true, Msg = "操作成功" };
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return new MessageModel<T_Service_Apoplexy_NCXAVM> { Success = false, Msg = "操作失败" };
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
public MessageModel<bool> 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<bool> { Success = true, Msg = "修改成功" };
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return new MessageModel<bool> { Success = false, Msg = "修改失败" };
|
|||
|
}
|
|||
|
}
|
|||
|
else
|
|||
|
{ //没有执行新增操作
|
|||
|
model.GUID = Guid.NewGuid().ToString();
|
|||
|
if (Add(model) == null)
|
|||
|
{
|
|||
|
return new MessageModel<bool> { Success = true, Msg = "新增成功" };
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return new MessageModel<bool> { Success = true, Msg = "新增成功" };
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public MessageModel<T_Service_Apoplexy_NCXAVM> Delete(int id)
|
|||
|
{
|
|||
|
if (IService.Delete(id))
|
|||
|
{
|
|||
|
return new MessageModel<T_Service_Apoplexy_NCXAVM> { Success = true, Msg = "操作成功" };
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
return new MessageModel<T_Service_Apoplexy_NCXAVM> { 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<T_Service_Apoplexy_NCXAVM> GetPageList(int pageIndex, int pageSize)
|
|||
|
{
|
|||
|
return IService.GetPageList(pageIndex, pageSize);
|
|||
|
}
|
|||
|
|
|||
|
public TableModel<T_Service_Apoplexy_NCXAVM> GetByPatientGuidAndReportType(string patientGuid)
|
|||
|
{
|
|||
|
return IService.GetByPatientGuidAndReportType(patientGuid);
|
|||
|
}
|
|||
|
}
|
|||
|
}
|