Beispiel #1
0
        /// <summary>
        /// 更新运行参数
        /// </summary>
        /// <param name="_entity"></param>
        internal void UpdateRunParams(RunParameters _entity)
        {
            string        sql = string.Format("UPDATE run_parameters SET CurUserAgentIndex=@user_agent, CurScrRslIndex=@scr_rsl, CurLoopNo=@loop_no;");
            SQLiteCommand cmd = new SQLiteCommand(sql, m_dbConnection);

            cmd.Parameters.Add(new SQLiteParameter("@user_agent", _entity.CurUserAgentIndex));
            cmd.Parameters.Add(new SQLiteParameter("@scr_rsl", _entity.CurScrRslIndex));
            cmd.Parameters.Add(new SQLiteParameter("@loop_no", _entity.CurLoopNo));

            cmd.ExecuteNonQuery();
        }
Beispiel #2
0
        /// <summary>
        /// 查询运行参数
        /// </summary>
        /// <returns></returns>
        internal RunParameters QryRunParams()
        {
            string           sql     = "SELECT CurUserAgentIndex, CurScrRslIndex, CurLoopNo FROM run_parameters limit 0,1";
            SQLiteCommand    command = new SQLiteCommand(sql, m_dbConnection);
            SQLiteDataReader reader  = command.ExecuteReader();
            RunParameters    _ret    = null;

            while (reader.Read())
            {
                _ret = new RunParameters()
                {
                    CurLoopNo         = Convert.ToInt32(reader["CurLoopNo"]),
                    CurScrRslIndex    = Convert.ToInt32(reader["CurScrRslIndex"]),
                    CurUserAgentIndex = Convert.ToInt32(reader["CurUserAgentIndex"])
                };
            }

            return(_ret);
        }