56 lines
1.8 KiB
C#
56 lines
1.8 KiB
C#
|
using HL_FristAidPlatform_Help;
|
|||
|
using HL_FristAidPlatform_IDataBase;
|
|||
|
using HL_FristAidPlatform_Models;
|
|||
|
using SqlSugar;
|
|||
|
using System;
|
|||
|
|
|||
|
namespace HL_FristAidPlatform_DataBase
|
|||
|
{
|
|||
|
public class Trauma_PatientTranService : BaseDB, ITrauma_PatientTranService
|
|||
|
{
|
|||
|
public SqlSugarClient db = GetClient();
|
|||
|
|
|||
|
|
|||
|
/// <summary>
|
|||
|
/// 修改创伤患者院前信息
|
|||
|
/// </summary>
|
|||
|
/// <param name="info"></param>
|
|||
|
/// <param name="health"></param>
|
|||
|
/// <returns></returns>
|
|||
|
public bool UpdateTraumaPatientFirstAidInfo(T_Service_FirstAid_PatientInfo info, T_Service_FirstAid_HealthCheckup health)
|
|||
|
{
|
|||
|
try
|
|||
|
{
|
|||
|
db.Ado.BeginTran();
|
|||
|
if (!SqlFunc.IsNullOrEmpty(info.GUID))
|
|||
|
{
|
|||
|
db.Updateable(info).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
db.Insertable(info).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand();
|
|||
|
}
|
|||
|
if (!SqlFunc.IsNullOrEmpty(health.GUID))
|
|||
|
{
|
|||
|
db.Updateable(health).IgnoreColumns(ignoreAllNullColumns: true).ExecuteCommand();
|
|||
|
}
|
|||
|
else
|
|||
|
{
|
|||
|
health.GUID = Guid.NewGuid().ToString();
|
|||
|
db.Insertable(health).IgnoreColumns(ignoreNullColumn: true).ExecuteCommand();
|
|||
|
}
|
|||
|
db.Ado.CommitTran();
|
|||
|
return true;
|
|||
|
}
|
|||
|
catch (Exception ex)
|
|||
|
{
|
|||
|
db.Ado.RollbackTran();
|
|||
|
Help.WriteErrorLog("创伤:修改创伤患者院前信息(UpdateTraumaPatientFirstAidInfo)", ex.ToString());
|
|||
|
return false;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
}
|
|||
|
}
|