AIMS/AIMSEntity/DAL/Extension/DApplyDiagnoseInfo.cs
2022-09-26 17:39:34 +08:00

52 lines
1.9 KiB
C#

using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections;
using System.Collections.Generic;
using AIMSModel;
using AIMSObjectQuery;
using System.Text;
namespace AIMSDAL
{
internal partial class DApplyDiagnoseInfo
{
public static void Add(ApplyDiagnoseInfo ApplyDiagnoseInfoObj)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("insert into [ApplyDiagnoseInfo](");
strSql.Append("OperationApplyId,DiagnoseId,OperatorNo,OperatorName,OperateDate");
strSql.Append(")");
strSql.Append(" values (");
strSql.Append("" + ApplyDiagnoseInfoObj.OperationApplyId + ",");
strSql.Append("" + ApplyDiagnoseInfoObj.DiagnoseId + ",");
strSql.Append("'" + ApplyDiagnoseInfoObj.OperatorNo + "',");
strSql.Append("'" + ApplyDiagnoseInfoObj.OperatorName + "',");
strSql.Append("'" + ApplyDiagnoseInfoObj.OperateDate + "'");
strSql.Append(")");
HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
}
public static void Delete(int OperationApplyId)
{
StringBuilder strSql=new StringBuilder();
strSql.Append("delete ApplyDiagnoseInfo ");
strSql.Append(" where OperationApplyId=" + OperationApplyId + "");
HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
}
public static List<int> GetApplyDiagnoseIdList(int OperationApplyId)
{
List<int> DiagnoseIdList = new List<int>();
string strSql = "SELECT DiagnoseId FROM ApplyDiagnoseInfo WHERE OperationApplyId='" + OperationApplyId + "'";
DataTable dt = HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
for (int i = 0; i < dt.Rows.Count; i++)
{
DiagnoseIdList.Add(int.Parse(dt.Rows[i]["DiagnoseId"].ToString()));
}
return DiagnoseIdList;
}
}
}