135 lines
		
	
	
		
			5.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			135 lines
		
	
	
		
			5.7 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| using System;
 | |
| using AIMSDAL;
 | |
| using AIMSModel;
 | |
| using AIMSObjectQuery;
 | |
| using System.Collections;
 | |
| using System.Collections.Generic;
 | |
| using System.Data;
 | |
| using System.Reflection;
 | |
| using System.Windows.Forms;
 | |
| using HelperDB;
 | |
| 
 | |
| namespace AIMSBLL
 | |
| {
 | |
|     public partial class BOperationApply
 | |
|     {
 | |
|         public static void Add(OperationApply OperationApplyObj)
 | |
|         {
 | |
|             DOperationApply.Add(OperationApplyObj);
 | |
|         }
 | |
| 
 | |
|         public static void UpdatePlanOrder(int ApplyId, int PlanOrder)
 | |
|         {
 | |
|             DOperationApply.UpdatePlanOrder(ApplyId, PlanOrder);
 | |
|         }
 | |
|         public static void UpdateASA(int ApplyId, string ASA, string HeartFunctionLevel)
 | |
|         {
 | |
|             DOperationApply.UpdateASA(ApplyId, ASA, HeartFunctionLevel);
 | |
|         }
 | |
|         public static int GetMaxPlanOrder(DateTime PlanOperationTime, int OperationRoomId)
 | |
|         {
 | |
|             return DOperationApply.GetMaxPlanOrder(PlanOperationTime, OperationRoomId);
 | |
|         }
 | |
| 
 | |
|         public static OperationApply GetModel(int Id)
 | |
|         {
 | |
|             return DOperationApply.GetModel(Id);
 | |
|         }
 | |
| 
 | |
|         public static DataTable GetDataTable(string strWhere)
 | |
|         {
 | |
|             return DOperationApply.GetDataTable(strWhere);
 | |
|         }
 | |
|         public static int GetOperationApplyMaxId()
 | |
|         {
 | |
|             return DOperationApply.GetOperationApplyMaxId();
 | |
|         }
 | |
|         public static DataTable GetOperationFrontDataTableByPatientId(int PatientId)
 | |
|         {
 | |
|             return DOperationApply.GetOperationFrontDataTableByPatientId(PatientId);
 | |
|         }
 | |
|         public static DataTable GetOperationFrontDataTable(string BegInData, string EndData)
 | |
|         {
 | |
|             return DOperationApply.GetOperationFrontDataTable(BegInData, EndData);
 | |
|         }
 | |
|         public static DataTable GetOperationFrontDataTableByPlanOperationTime(string BegInData, string EndData)
 | |
|         {
 | |
|             return DOperationApply.GetOperationFrontDataTableByPlanOperationTime(BegInData, EndData);
 | |
|         }
 | |
|         public static DataTable GetOperationDoingDataTable(string BegInData, string EndData)
 | |
|         {
 | |
|             return DOperationApply.GetOperationDoingDataTable (BegInData, EndData);
 | |
|         }  
 | |
|         public static void UpdateVerifyTime(int ApplyId, string VerifyTime, string VerifyOperatorNo)
 | |
|         {
 | |
|             DOperationApply.UpdateVerifyTime(ApplyId, VerifyTime, VerifyOperatorNo);
 | |
|         }
 | |
|         public static void UpdateApplyState(int ApplyId, int State)
 | |
|         {
 | |
|             DOperationApply.UpdateApplyState(ApplyId, State);
 | |
|         }
 | |
|         public static void UpdateApplyRoom(int ApplyId, int room, DateTime PlanOperationTime)
 | |
|         {
 | |
|             int PlanOrder = BOperationApply.GetMaxPlanOrder(PlanOperationTime, room) + 1;
 | |
|             DOperationApply.UpdateApplyRoom(ApplyId, room, PlanOperationTime, PlanOrder);
 | |
|         }
 | |
|         public static void UpdatePlanOperationTime(int ApplyId, string PlanOperationTime, int OperationRoomId, int State)
 | |
|         {
 | |
|             DOperationApply.UpdatePlanOperationTime(ApplyId, PlanOperationTime, OperationRoomId, State);
 | |
|         }
 | |
|         public static void UpdateStopOperation(int ApplyId, string Content)
 | |
|         {
 | |
|             DOperationApply.UpdateStopOperation(ApplyId, Content);
 | |
|         }
 | |
|         public static DataTable SelectPlanedOpeByRoom(string whereSql)
 | |
|         {
 | |
|             return DOperationApply.SelectPlanedOpeByRoom(whereSql);
 | |
|         }
 | |
|         public static int SaveDoctorByRommTime(string DoctorNuresName, DateTime SearchTime, int CurrentRoom)
 | |
|         {
 | |
|             return DOperationApply.SaveDoctorByRommTime(DoctorNuresName, SearchTime, CurrentRoom);
 | |
|         }
 | |
|         public static int SaveRoomOrderByTime(int SetRoom, DateTime SearchTime, int CurrentRoom)
 | |
|         {
 | |
|             int num = 0;
 | |
|             DataTable _operationInfoRows = DOperationApply.SelectPlanedOpe("  state in(1,2,3,4) and PlanOperationTime<='" + SearchTime.ToString("yyyy-MM-dd 23:59:59") + "' and PlanOperationTime>='" + SearchTime.ToString("yyyy-MM-dd 00:00:00") + "' and OperationRoomId=" + CurrentRoom + " order by PlanOrder asc");
 | |
|             if (_operationInfoRows.Rows.Count > 0)
 | |
|             {
 | |
|                 int PlanOrder = BOperationApply.GetMaxPlanOrder(SearchTime, SetRoom) + 1;
 | |
|                 for (int index = 0; index < _operationInfoRows.Rows.Count; index++)
 | |
|                 {
 | |
|                     int ApplyId = int.Parse(_operationInfoRows.Rows[index]["Id"].ToString());
 | |
|                     num += DOperationApply.UpdateApplyRoom(ApplyId, SetRoom, SearchTime, PlanOrder);
 | |
|                     PlanOrder++;
 | |
|                 }
 | |
| 
 | |
|             }
 | |
|             return num;
 | |
|         }
 | |
|         public static void UpdteOperationOrder(DateTime dtpSearchTime, int operationRoom)
 | |
|         {
 | |
|             DataTable _operationInfoRows = DOperationApply.SelectPlanedOpe(" PlanOperationTime<='" + dtpSearchTime.ToString("yyyy-MM-dd 23:59:59") + "' and PlanOperationTime>='" + dtpSearchTime.ToString("yyyy-MM-dd 00:00:00") + "' and State<>'10' and OperationRoomId=" + operationRoom + " order by PlanOrder asc");
 | |
|             if (_operationInfoRows.Rows.Count > 0)
 | |
|             {
 | |
|                 for (int index = 0; index < _operationInfoRows.Rows.Count; index++)
 | |
|                 {
 | |
|                     int ApplyId = int.Parse(_operationInfoRows.Rows[index]["Id"].ToString());
 | |
|                     int OperationOrder = index + 1;
 | |
|                     UpdateApplyOrder(ApplyId, OperationOrder);
 | |
|                 }
 | |
| 
 | |
|             }
 | |
|         }
 | |
|         public static void UpdateApplyOrder(int ApplyId, int order)
 | |
|         {
 | |
|             DOperationApply.UpdateApplyOrder(ApplyId, order);
 | |
|         }
 | |
|         public static DataTable SelectOperationInformationByWhere(string whereSql)
 | |
|         {
 | |
|             string sql = "select * from V_OperationRecordInfo where " + whereSql;
 | |
|             return DBHelper.GetDataTable(sql);
 | |
|         }
 | |
| 
 | |
|     }
 | |
| }
 |