//设置指定的IndexID记录为活动检查 public bool Call_SP_Activate_Specified_IndexID(String strIndexID) { strIndexID = CSTR.trim(strIndexID); if (strIndexID.Length <= 0) { return(false); } int nIndexID = CSTR.convertToInt(strIndexID); if (nIndexID <= 0) { return(false); } try { MySqlConnection connection = getConn(); if (null == connection) { return(false); } //指定存储过程名称和连接 MySqlDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = new MySqlCommand(); adapter.SelectCommand.Connection = connection; adapter.SelectCommand.CommandText = "TJ_Queue_Activate_Specified_IndexID";//存储过程名称 adapter.SelectCommand.CommandType = CommandType.StoredProcedure; //设置参数 //mysql的存储过程参数是以?打头的!!!! //in - parameter_Handler_Name MySqlParameter parameter_in_index_id = new MySqlParameter("?in_index_id", MySqlDbType.Int32, 11); parameter_in_index_id.Direction = ParameterDirection.Input; parameter_in_index_id.Value = nIndexID; adapter.SelectCommand.Parameters.Add(parameter_in_index_id); //out - out_result_flag MySqlParameter parameter_out_result_flag = new MySqlParameter("?out_result_flag", MySqlDbType.Int32, 11); parameter_out_result_flag.Direction = ParameterDirection.Output; adapter.SelectCommand.Parameters.Add(parameter_out_result_flag); //把返回结果填入DataSet DataSet ds = new DataSet(); adapter.Fill(ds); //取得Out参数 int result_flag = CSTR.convertToInt(CSTR.ObjectTrim(parameter_out_result_flag.Value)); return((result_flag == 1) ? true : false); } catch (Exception exp) { Console.WriteLine(exp.Message); Log.log("[mysql.Call_SP_Activate_Specified_IndexID()] " + exp.Message); conn = null; } return(false); }
//定时刷新RoomInfo表数据 public Dictionary <String, Object> Call_SP_RoomInfo_Reflesh(int last_trigger_RoomInfo_id) { Dictionary <String, Object> map = new Dictionary <string, object>(); try { MySqlConnection connection = getConn(); if (null == connection) { return(map); } //指定存储过程名称和连接 MySqlDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = new MySqlCommand(); adapter.SelectCommand.Connection = connection; adapter.SelectCommand.CommandText = "Reflesh_RoomInfo";//存储过程名称 adapter.SelectCommand.CommandType = CommandType.StoredProcedure; //设置参数 //mysql的存储过程参数是以?打头的!!!! //inout - in_trigger_RoomInfo_id MySqlParameter parameter_in_trigger_RoomInfo_id = new MySqlParameter("?in_trigger_RoomInfo_id", MySqlDbType.Int32, 11); parameter_in_trigger_RoomInfo_id.Direction = ParameterDirection.InputOutput; parameter_in_trigger_RoomInfo_id.Value = last_trigger_RoomInfo_id; adapter.SelectCommand.Parameters.Add(parameter_in_trigger_RoomInfo_id); //out - out_reflesh_flag MySqlParameter parameter_out_reflesh_flag = new MySqlParameter("?out_reflesh_flag", MySqlDbType.Int32, 11); parameter_out_reflesh_flag.Direction = ParameterDirection.Output; adapter.SelectCommand.Parameters.Add(parameter_out_reflesh_flag); //把返回结果填入DataSet DataSet ds = new DataSet(); adapter.Fill(ds); //取得Out参数 int result_flag = CSTR.convertToInt(CSTR.ObjectTrim(parameter_out_reflesh_flag.Value)); int result_max_id1 = CSTR.convertToInt(CSTR.ObjectTrim(parameter_in_trigger_RoomInfo_id.Value)); //构建返回的映射表 map.Add("flag", result_flag); map.Add("max_id_1", result_max_id1); map.Add("data_set", ds); } catch (Exception exp) { Console.WriteLine(exp.Message); Log.log("[mysql.Call_SP_RoomInfo_Reflesh()] " + exp.Message); conn = null; map = null; } return(map); }
//Token获取 public int Call_SP_Token(String strHandlerName) { if (CSTR.isEmpty(strHandlerName)) { return(0); } try { MySqlConnection connection = getConn(); if (null == connection) { return(0); } //指定存储过程名称和连接 MySqlDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = new MySqlCommand(); adapter.SelectCommand.Connection = connection; adapter.SelectCommand.CommandText = "Tocken";//存储过程名称 adapter.SelectCommand.CommandType = CommandType.StoredProcedure; //设置参数 //mysql的存储过程参数是以?打头的!!!! //in - parameter_Handler_Name MySqlParameter parameter_Handler_Name = new MySqlParameter("?Handler_Name", MySqlDbType.VarChar, 128); parameter_Handler_Name.Direction = ParameterDirection.Input; parameter_Handler_Name.Value = strHandlerName; adapter.SelectCommand.Parameters.Add(parameter_Handler_Name); //out - out_token_flag MySqlParameter parameter_out_token_flag = new MySqlParameter("?out_token_flag", MySqlDbType.Int32, 11); parameter_out_token_flag.Direction = ParameterDirection.Output; adapter.SelectCommand.Parameters.Add(parameter_out_token_flag); //把返回结果填入DataSet DataSet ds = new DataSet(); adapter.Fill(ds); //取得Out参数 int result_flag = CSTR.convertToInt(CSTR.ObjectTrim(parameter_out_token_flag.Value)); return(result_flag); } catch (Exception exp) { Console.WriteLine(exp.Message); Log.log("[mysql.Call_SP_Token()] " + exp.Message); conn = null; } return(0); }
//----------------判断是否为职检--------------------------------------------------------- private bool StudyIsVocationType() { //[RoomID]:register_table.CheckRoom if (CSTR.IsTableEmpty(register_table)) { return(false); } //[规则]TFD体检项目:只要任意一个Exam的ExamType属于职检, //[规则]SpecialExam: 检查名称中包含职检字样,即为职检检查 //[规则]TFD体检项目与SpecialExam项目的区分:register_table.DWMC='非天方达' bool is_vocation_exam = false; foreach (DataRow row in register_table.Rows) { String DWMC = CSTR.ObjectTrim(row["DWMC"]); String ProcedureStepName = CSTR.ObjectTrim(row["TJXMMC"]); String TJLB = CSTR.ObjectTrim(row["TJLB"]); int n_TJLB = CSTR.convertToInt(TJLB);//转换为int_体检类别 if (DWMC.Equals("非天方达")) { //SpecialExam检查项目 if (ProcedureStepName.IndexOf("职检") >= 0) { is_vocation_exam = true; } } else { //TFD检查项目 if (n_TJLB != -1 && n_TJLB >= 7 && n_TJLB <= 15) { is_vocation_exam = true; } } }//end foreach return(is_vocation_exam); }
//语音叫号获取一条播报的信息 public DataTable Call_SP_TTS_Get_One_Item_To_Speak() { try { MySqlConnection connection = getConn(); if (null == connection) { return(null); } //指定存储过程名称和连接 MySqlDataAdapter adapter = new MySqlDataAdapter(); adapter.SelectCommand = new MySqlCommand(); adapter.SelectCommand.Connection = connection; adapter.SelectCommand.CommandText = "TTS_Get_One_Item_To_Speak";//存储过程名称 adapter.SelectCommand.CommandType = CommandType.StoredProcedure; //设置参数 //mysql的存储过程参数是以?打头的!!!! //in - parameter_Handler_Name //MySqlParameter parameter_in_index_id = new MySqlParameter("?in_index_id", MySqlDbType.Int32, 11); //parameter_in_index_id.Direction = ParameterDirection.Input; //parameter_in_index_id.Value = nIndexID; //adapter.SelectCommand.Parameters.Add(parameter_in_index_id); //out - out_result_flag MySqlParameter parameter_out_result_flag = new MySqlParameter("?out_result_flag", MySqlDbType.Int32, 11); parameter_out_result_flag.Direction = ParameterDirection.Output; adapter.SelectCommand.Parameters.Add(parameter_out_result_flag); //把返回结果填入DataSet DataSet ds = new DataSet(); adapter.Fill(ds); //取得Out参数 int result_flag = CSTR.convertToInt(CSTR.ObjectTrim(parameter_out_result_flag.Value)); //返回结果不为1,表示没有任何结果集 if (1 != result_flag) { return(null); } if (null == ds) { return(null); } if (ds.Tables.Count <= 0) { return(null); } //返回获取的一条记录 return(ds.Tables[0]); } catch (Exception exp) { Console.WriteLine(exp.Message); Log.log("[mysql.Call_SP_TTS_Get_One_Item_To_Speak()] " + exp.Message); conn = null; } return(null); }