using System; using System.Data; using System.Data.SqlClient; using System.Collections; using System.Collections.Generic; using AIMSModel; using AIMSObjectQuery; using System.Reflection; using System.Text; namespace AIMSDAL { internal partial class DApplyAnaesthesiaMethod { public static void Add(ApplyAnaesthesiaMethod ApplyAnaesthesiaMethodObj) { StringBuilder strSql = new StringBuilder(); strSql.Append("insert into [ApplyAnaesthesiaMethod]("); strSql.Append("OperationApplyId,AnaesthesiaMethodId,OperatorNo,OperatorName,OperateDate"); strSql.Append(")"); strSql.Append(" values ("); strSql.Append("" + ApplyAnaesthesiaMethodObj.OperationApplyId + ","); strSql.Append("" + ApplyAnaesthesiaMethodObj.AnaesthesiaMethodId + ","); strSql.Append("'" + ApplyAnaesthesiaMethodObj.OperatorNo + "',"); strSql.Append("'" + ApplyAnaesthesiaMethodObj.OperatorName + "',"); strSql.Append("'" + ApplyAnaesthesiaMethodObj.OperateDate + "'"); strSql.Append(")"); HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString()); } public static void Delete(int OperationApplyId) { StringBuilder strSql = new StringBuilder(); strSql.Append("delete ApplyAnaesthesiaMethod "); strSql.Append(" where OperationApplyId=" + OperationApplyId + ""); HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString()); } public static List GetApplyAnaesthesiaMethodList(int OperationApplyId) { List ApplyAnaesthesiaMethodIdList = new List(); string strSql = "SELECT AnaesthesiaMethodId FROM ApplyAnaesthesiaMethod WHERE OperationApplyId='" + OperationApplyId + "'"; DataTable dt = HelperDB.DbHelperSQL.GetDataTable(strSql.ToString()); for (int i = 0; i < dt.Rows.Count; i++) { ApplyAnaesthesiaMethodIdList.Add(int.Parse(dt.Rows[i]["AnaesthesiaMethodId"].ToString())); } return ApplyAnaesthesiaMethodIdList; } public static string GetApplyAnaesthesiaMethod(int OperationApplyId) { string ApplyAnaesthesiaMethodIdList = ""; StringBuilder sb = new StringBuilder(); string strSql = "SELECT AnaesthesiaMethodId FROM ApplyAnaesthesiaMethod WHERE OperationApplyId='" + OperationApplyId + "'"; DataTable dt = HelperDB.DbHelperSQL.GetDataTable(strSql.ToString()); for (int i = 0; i < dt.Rows.Count; i++) { sb.Append(dt.Rows[i]["AnaesthesiaMethodId"].ToString() + "+"); } if (sb.ToString().Length > 1) { ApplyAnaesthesiaMethodIdList = sb.ToString().Substring(0, sb.ToString().Length - 1); } return ApplyAnaesthesiaMethodIdList; } } }