Exemplo n.º 1
0
        public List <Record> selectListByAll(string id, string seriesNum, string operatorName, DateTime startTime, DateTime endTime)
        {
            string query_string = "SELECT * from `t_record` where isDel=0";

            if (id != "")
            {
                query_string = query_string + " and id='" + id + "'";
            }
            if (operatorName != "")
            {
                query_string = query_string + " and operator='" + operatorName + "'";
            }
            if (seriesNum != "")
            {
                query_string = query_string + " and seriesNum='" + seriesNum + "'";
            }
            if (startTime.Year != 1)
            {
                query_string = query_string + " and createTime>='" + startTime.ToString("yyyy-MM-dd HH:mm:ss") + "'";
            }
            if (endTime.Year != 1)
            {
                query_string = query_string + " and createTime<='" + endTime.ToString("yyyy-MM-dd HH:mm:ss") + "'";
            }
            DataTable dt = MysqlTool.queryData(query_string, new MySqlParameter[] {
                new MySqlParameter()
            });
            List <Record> ls = MysqlTool.toList <Record>(dt);

            return(ls.Count > 0 ? ls : null);
        }
Exemplo n.º 2
0
        public List <RecordDetail> selectListByRecordId(string recordId)
        {
            string    query_string = "SELECT * from `t_record_detail` where recordId=@recordId and isDel=0 order by `index`";
            DataTable dt           = MysqlTool.queryData(query_string, new MySqlParameter[] {
                new MySqlParameter("@recordId", recordId)
            });
            List <RecordDetail> ls = MysqlTool.toList <RecordDetail>(dt);

            return(ls.Count > 0 ? ls : null);
        }