108 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			108 lines
		
	
	
		
			4.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 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 DFactOperationInfo
 | |
|     {
 | |
|         public static void Add(FactOperationInfo FactOperationInfoObj)
 | |
|         {
 | |
|             StringBuilder strSql = new StringBuilder();
 | |
|             strSql.Append("insert into [FactOperationInfo](");
 | |
|             strSql.Append("PatientId,ApplyId,OperationId,OperatorNo,OperatorName,OperateDate,OperationName,LeftRemark,RightRemark");
 | |
|             strSql.Append(")");
 | |
|             strSql.Append(" values (");
 | |
|             strSql.Append("" + FactOperationInfoObj.PatientId + ",");
 | |
|             strSql.Append("" + FactOperationInfoObj.ApplyId + ",");
 | |
|             strSql.Append("" + FactOperationInfoObj.OperationId + ",");
 | |
|             strSql.Append("'" + FactOperationInfoObj.OperatorNo + "',");
 | |
|             strSql.Append("'" + FactOperationInfoObj.OperatorName + "',");
 | |
|             strSql.Append("'" + FactOperationInfoObj.OperateDate + "',");
 | |
|             strSql.Append("'" + FactOperationInfoObj.OperationName + "',");
 | |
|             strSql.Append("'" + FactOperationInfoObj.LeftRemark + "',");
 | |
|             strSql.Append("'" + FactOperationInfoObj.RightRemark + "'");
 | |
|             strSql.Append(")");
 | |
|             HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
 | |
|         }
 | |
| 
 | |
|         public static void Delete(int PatientId)
 | |
|         {
 | |
|             StringBuilder strSql = new StringBuilder();
 | |
|             strSql.Append("delete FactOperationInfo ");
 | |
|             strSql.Append(" where PatientId=" + PatientId + "");
 | |
|             HelperDB.DbHelperSQL.ExecNonQuery(strSql.ToString());
 | |
|         }
 | |
| 
 | |
|         public static FactOperationInfo GetModel(int Id)
 | |
|         {
 | |
|             FactOperationInfo FactOperationInfoObj = new FactOperationInfo();
 | |
|             StringBuilder strSql = new StringBuilder();
 | |
|             strSql.Append("select * from FactOperationInfo ");
 | |
|             strSql.Append(" where Id=" + Id + "");
 | |
|             DataSet ds = HelperDB.DbHelperSQL.GetDataSet(strSql.ToString());
 | |
|             if (ds.Tables[0].Rows.Count > 0)
 | |
|             {
 | |
|                 if (ds.Tables[0].Rows[0]["Id"].ToString() != "")
 | |
|                 {
 | |
|                     FactOperationInfoObj.Id = int.Parse(ds.Tables[0].Rows[0]["Id"].ToString());
 | |
|                 }
 | |
|                 if (ds.Tables[0].Rows[0]["PatientId"].ToString() != "")
 | |
|                 {
 | |
|                     FactOperationInfoObj.PatientId = int.Parse(ds.Tables[0].Rows[0]["PatientId"].ToString());
 | |
|                 }
 | |
|                 if (ds.Tables[0].Rows[0]["ApplyId"].ToString() != "")
 | |
|                 {
 | |
|                     FactOperationInfoObj.ApplyId = int.Parse(ds.Tables[0].Rows[0]["ApplyId"].ToString());
 | |
|                 }
 | |
|                 if (ds.Tables[0].Rows[0]["OperationId"].ToString() != "")
 | |
|                 {
 | |
|                     FactOperationInfoObj.OperationId = int.Parse(ds.Tables[0].Rows[0]["OperationId"].ToString());
 | |
|                 }
 | |
|                 FactOperationInfoObj.OperatorNo = ds.Tables[0].Rows[0]["OperatorNo"].ToString();
 | |
|                 FactOperationInfoObj.OperatorName = ds.Tables[0].Rows[0]["OperatorName"].ToString();
 | |
|                 //FactOperationInfoObj.OperationName = ds.Tables[0].Rows[0]["OperationName"].ToString();
 | |
|                 //FactOperationInfoObj.LeftRemark = ds.Tables[0].Rows[0]["LeftRemark"].ToString();
 | |
|                 //FactOperationInfoObj.RightRemark = ds.Tables[0].Rows[0]["RightRemark"].ToString();
 | |
|                 if (ds.Tables[0].Rows[0]["OperateDate"].ToString() != "")
 | |
|                 {
 | |
|                     FactOperationInfoObj.OperateDate = DateTime.Parse(ds.Tables[0].Rows[0]["OperateDate"].ToString());
 | |
|                 }
 | |
|             }
 | |
|             return FactOperationInfoObj;
 | |
|         }
 | |
| 
 | |
|         public static DataTable GetDataTable(string strWhere)
 | |
|         {
 | |
|             StringBuilder strSql = new StringBuilder();
 | |
|             strSql.Append("select * ");
 | |
|             strSql.Append(" FROM FactOperationInfo ");
 | |
|             if (strWhere.Trim() != "")
 | |
|             {
 | |
|                 strSql.Append(" where " + strWhere);
 | |
|             }
 | |
|             return HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
 | |
|         }
 | |
| 
 | |
|         public static List<int> GetFactOperationInfoIdList(int PatientId)
 | |
|         {
 | |
|             List<int> OperationIdList = new List<int>();
 | |
|             string strSql = "SELECT  OperationId FROM FactOperationInfo WHERE PatientId='" + PatientId + "'";
 | |
| 
 | |
|             DataTable dt = HelperDB.DbHelperSQL.GetDataTable(strSql.ToString());
 | |
|             for (int i = 0; i < dt.Rows.Count; i++)
 | |
|             {
 | |
|                 OperationIdList.Add(int.Parse(dt.Rows[i]["OperationId"].ToString()));
 | |
| 
 | |
|             }
 | |
|             return OperationIdList;
 | |
|         }
 | |
|     }
 | |
| }
 |