//获取指定行的字段值: JiaohaoTable_get_Field_String_by_IndexID("63","status") public static String JiaohaoTable_Get_Field_Value_by_IndexID(String indexID, String fieldName) { indexID = CSTR.trim(indexID); fieldName = CSTR.trim(fieldName); if (CSTR.isEmpty(indexID)) { return(""); } if (CSTR.isEmpty(fieldName)) { return(""); } //获取JiaohaoTable表 DataTable cache_tbl = DB_Get_JiaohaoTable_table(); if (CSTR.IsTableEmpty(cache_tbl)) { return(null); } //查询符合条件的行集合 DataRow[] row_result = cache_tbl.Select(String.Format("IndexID='{0}'", indexID)); if (CSTR.IsArrayEmpty(row_result)) { return(""); } //从第一行中返回指定的列数据 return(CSTR.ObjectTrim(row_result[0][fieldName])); }
public static String RoomInfo_get_BackupRoom(String roomID) { String sql = String.Format("RoomID='{0}'", roomID); DataRow[] sel_rows = DB_Get_JiaohaoRoomInfo_table().Select(sql); if (CSTR.IsArrayEmpty(sel_rows)) { return(""); } String strValue = CSTR.ObjectTrim(sel_rows[0]["BackupRoom"]); return(strValue); }
public static bool RoomInfo_is_active(String roomID) { String sql = String.Format("RoomID='{0}'", roomID); DataRow[] sel_rows = DB_Get_JiaohaoRoomInfo_table().Select(sql); if (CSTR.IsArrayEmpty(sel_rows)) { return(false); } String strValue = CSTR.ObjectTrim(sel_rows[0]["RoomState"]); return((strValue.Equals("active")) ? true : false); }
public static bool RoomInfo_is_need_voice(String roomID) { String sql = String.Format("RoomID='{0}'", roomID); DataRow[] sel_rows = DB_Get_JiaohaoRoomInfo_table().Select(sql); if (CSTR.IsArrayEmpty(sel_rows)) { return(false); } String strValue = CSTR.ObjectTrim(sel_rows[0]["IsNeedVoice"]); //return (strValue.Equals("1")) ? true : false; return((strValue.Equals("0")) ? false : true); }
public static DataRow[] Exam_Get_Single_Exam_By_IndexID(String strIndexID) { String sql = String.Format("IndexID='{0}'", strIndexID); DataTable tbl = DatabaseCache.DB_Get_JiaohaoTable_table(); if (CSTR.IsTableEmpty(tbl)) { return(null); } DataRow[] sel_rows = tbl.Select(sql); if (CSTR.IsArrayEmpty(sel_rows)) { return(null); } return(sel_rows); }
//获取指定房间的过号检查队列总数(过号) public static int Queue_Length_Count_Specified_Room_Passed_Exam(String roomID) { //包含状态字为 1000,1110的检查,即只要QueueActive=1,IsOver=0 String sql = String.Format("QueueActive='0' And status='1' And IsChecking='0' And IsOver='0' And RoomID='{0}'", roomID); DataTable tbl = DatabaseCache.DB_Get_JiaohaoTable_table(); if (CSTR.IsTableEmpty(tbl)) { return(0); } DataRow[] sel_rows = tbl.Select(sql); if (CSTR.IsArrayEmpty(sel_rows)) { return(0); } return(sel_rows.Length); }
//获取指定房间当前已分配的未完成检查数 #endregion DocBench专属查询---------------------------------------------End #region 队列数目查询----------------------------------------------------Start //获取指定房间的Pending的队列总数,忽略QueueActive状态(use case:在新到检时需要知道各个房间的总检查,而非活动检查) public static int Queue_Length_Count_Specified_Room_Ignore_QueueActive(String roomID) { //只要IsOver=0就属于未完成检查 String sql = String.Format("IsOver='0' And RoomID='{0}'", roomID); DataTable tbl = DatabaseCache.DB_Get_JiaohaoTable_table(); if (CSTR.IsTableEmpty(tbl)) { return(0); } DataRow[] sel_rows = tbl.Select(sql); if (CSTR.IsArrayEmpty(sel_rows)) { return(0); } return(sel_rows.Length); }
/** * 获取指定QueueID的活动检查在指定房间的队列次序(前面还有?人) * 使用: * FinalCheckWnd.cs在显示检查列表时调用 * * **/ public static int TJ_Queue_Arrange_Get_Position_In_Specified_Room_Actual_Pending_Queue(String roomID, String queueID) { //String sql = String.Format("QueueActive=1 And status=0 And IsChecking=0 And RoomID='{0}' And QueueID<{1}", roomID, queueID); String sql = String.Format("QueueActive='1' And RoomID='{0}' And QueueID<'{1}'", roomID, queueID); DataTable cache_tbl = DB_Get_JiaohaoTable_table(); if (CSTR.IsTableEmpty(cache_tbl)) { return(-1); } DataRow[] row_result = cache_tbl.Select(sql); if (CSTR.IsArrayEmpty(row_result)) { return(0); } return(row_result.Length); }
public static DataRow Exam_Get_Pending_First_One() { //取得本进程对应的ModalityID(room_id) String strRoomID = CONFIG.system_param["room_id"]; String sql = String.Format("QueueActive='1' and RoomID='{0}' and status='0' and IsChecking='0' and IsOver='0'", strRoomID); DataTable tbl = DatabaseCache.DB_Get_JiaohaoTable_table(); if (CSTR.IsTableEmpty(tbl)) { return(null); } //order by QueueID DataRow[] rows = tbl.Select(sql, "QueueID"); if (CSTR.IsArrayEmpty(rows)) { return(null); } return(rows[0]); }
public static String Exam_Get_RingNo_By_RfidNo(String strRFID) { strRFID = CSTR.trim(strRFID); if (strRFID.Length <= 0) { return(null); } String sql = String.Format("Rfid='{0}' ", strRFID); DataTable tbl = DatabaseCache.DB_Get_JiaohaoTable_table(); if (CSTR.IsTableEmpty(tbl)) { return(null); } DataRow[] sel_rows = tbl.Select(sql); if (CSTR.IsArrayEmpty(sel_rows)) { return(null); } return(CSTR.ObjectTrim(sel_rows[0]["RfidName"])); }
/** * 获取所有的检查项目(ExamInfo关联) * 使用: * FinalCheckWnd.cs在显示检查列表时调用 * * **/ public static DataTable ExamInfo_get_All_Items_by_RingNo(String ringNo) { DataTable tblRet = null; ringNo = CSTR.trim(ringNo); if (ringNo.Length <= 0) { return(null); } //获取JiaohaoTable表 DataTable cache_tbl = DB_Get_JiaohaoTable_table(); if (CSTR.IsTableEmpty(cache_tbl)) { return(null); } //查询符合条件的行集合(排序优先级别"QueueActive DESC,IsOver" DataRow[] JiaohaoTable_row_result = cache_tbl.Select(String.Format("RfidName='{0}'", ringNo), "IsOver,QueueActive DESC,IsNeedQueue"); if (CSTR.IsArrayEmpty(JiaohaoTable_row_result)) { return(null); } //构建返回表 tblRet = new DataTable(); tblRet = cache_tbl.Clone();//克隆表结构,但无数据 foreach (DataRow row_JiaohaoTable in JiaohaoTable_row_result) { //Split本检查的ArrayProcedureStepName,并逐条添加到返回表 String ArrayProcedureStepName = CSTR.ObjectTrim(row_JiaohaoTable["ArrayProcedureStepName"]); if (CSTR.isEmpty(ArrayProcedureStepName)) { //如果ArrayProcedureStepName无内容,直接Copy本条记录到返回表 DataRow newRow = Row_Copy(row_JiaohaoTable, tblRet); tblRet.Rows.Add(newRow); continue; } String[] procedureName_arr = ArrayProcedureStepName.Split(';'); if (null == procedureName_arr || procedureName_arr.Length <= 1) { //如果检查Item数量少于2个,直接Copy本条记录到返回表 DataRow newRow = Row_Copy(row_JiaohaoTable, tblRet); tblRet.Rows.Add(newRow); continue; } foreach (String procedureName in procedureName_arr) { //把每个ProcedureStepName的数据Copy到新的行newRow DataRow newRow = Row_Copy(row_JiaohaoTable, tblRet); if (null != newRow) { newRow["ProcedureStepName"] = procedureName; tblRet.Rows.Add(newRow); } } }//end foreach (DataRow row in JiaohaoTable_row_result) return(tblRet); }