Exemplo n.º 1
0
        public void TestDALTestRecordListPreviousPoints()
        {
            /*
             *
             * mysql> select * from TestRecord where Line = 'line88';
             +----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
             | ID | CustomerCode | ModelName | FileName | FileTime            | Line   | X    | R    | XFlag | RFlag | BoardType |
             +----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
             | 14 | NE           | M123      | ABC.Csv  | 2017-04-10 10:18:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 15 | NE           | M123      | ABC.Csv  | 2017-04-10 10:19:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 16 | NE           | M123      | ABC.Csv  | 2017-04-10 10:21:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 17 | NE           | M123      | ABC.Csv  | 2017-04-10 10:22:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 18 | NE           | M123      | ABC.Csv  | 2017-04-10 10:23:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 19 | NE           | M123      | ABC.Csv  | 2017-04-10 10:24:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 20 | NE           | M123      | ABC.Csv  | 2017-04-10 10:25:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 21 | NE           | M123      | ABC.Csv  | 2017-04-10 10:26:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 22 | NE           | M123      | ABC.Csv  | 2017-04-10 10:27:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 23 | NE           | M123      | ABC.Csv  | 2017-04-10 10:28:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 24 | NE           | M123      | ABC.Csv  | 2017-04-10 10:29:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             +----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
             |  11 rows in set (0.00 sec)
             *
             *
             *
             *
             */

            SPI_PCC.Model.TestRecordInfo trInfo = new SPI_PCC.Model.TestRecordInfo();
            trInfo.Model           = new SPI_PCC.Model.ModelInfo();
            trInfo.Line            = "line88";
            trInfo.FileTime        = Convert.ToDateTime("2017-04-10 10:27");
            trInfo.Model.ModelName = "M123";
            trInfo.Model.BoardType = "T";

            SPI_PCC.DAL.TestRecord tr = new SPI_PCC.DAL.TestRecord();
            tr.info = trInfo;

            List <SPI_PCC.Model.TestRecordInfo> l = tr.ListPreviousPoints(5);
        }
Exemplo n.º 2
0
        public void TestDALTestRecordDelete()
        {
            /*
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:18','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:19','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:21','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:22','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:23','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:24','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:25','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:26','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:27','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:28','line88',10,3.5,0,0);
             *  insert into TestRecord(CustomerCode,ModelName,BoardType,FileName,FileTime,Line,X,R,XFlag,RFlag)values ('NE','M123','T','ABC.Csv','2017-04-10 10:29','line88',10,3.5,0,0);
             *
             *  mysql>  select * from TestRecord where Line = 'line88';
             +----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
             | ID | CustomerCode | ModelName | FileName | FileTime            | Line   | X    | R    | XFlag | RFlag | BoardType |
             +----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
             | 14 | NE           | M123      | ABC.Csv  | 2017-04-10 10:18:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 15 | NE           | M123      | ABC.Csv  | 2017-04-10 10:19:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 16 | NE           | M123      | ABC.Csv  | 2017-04-10 10:21:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 17 | NE           | M123      | ABC.Csv  | 2017-04-10 10:22:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 18 | NE           | M123      | ABC.Csv  | 2017-04-10 10:23:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 19 | NE           | M123      | ABC.Csv  | 2017-04-10 10:24:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 20 | NE           | M123      | ABC.Csv  | 2017-04-10 10:25:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 21 | NE           | M123      | ABC.Csv  | 2017-04-10 10:26:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 22 | NE           | M123      | ABC.Csv  | 2017-04-10 10:27:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 23 | NE           | M123      | ABC.Csv  | 2017-04-10 10:28:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             | 24 | NE           | M123      | ABC.Csv  | 2017-04-10 10:29:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
             +----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
             |  11 rows in set (0.00 sec)
             |
             */

            SPI_PCC.Model.TestRecordInfo trInfo = new SPI_PCC.Model.TestRecordInfo();
            trInfo.Model = new SPI_PCC.Model.ModelInfo();
            trInfo.Line  = "line88";


            SPI_PCC.DAL.TestRecord tr = new SPI_PCC.DAL.TestRecord();
            tr.info = trInfo;

            tr.Delete(20);
            tr.Delete(11);
            tr.Delete(10);  //!!!error
            tr.Delete(9);   //!!!error

            //            delete 20:
            //mysql>  select * from TestRecord where Line = 'line88';
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //| ID | CustomerCode | ModelName | FileName | FileTime            | Line   | X    | R    | XFlag | RFlag | BoardType |
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //| 14 | NE           | M123      | ABC.Csv  | 2017-04-10 10:18:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 15 | NE           | M123      | ABC.Csv  | 2017-04-10 10:19:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 16 | NE           | M123      | ABC.Csv  | 2017-04-10 10:21:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 17 | NE           | M123      | ABC.Csv  | 2017-04-10 10:22:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 18 | NE           | M123      | ABC.Csv  | 2017-04-10 10:23:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 19 | NE           | M123      | ABC.Csv  | 2017-04-10 10:24:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 20 | NE           | M123      | ABC.Csv  | 2017-04-10 10:25:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 21 | NE           | M123      | ABC.Csv  | 2017-04-10 10:26:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 22 | NE           | M123      | ABC.Csv  | 2017-04-10 10:27:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 23 | NE           | M123      | ABC.Csv  | 2017-04-10 10:28:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 24 | NE           | M123      | ABC.Csv  | 2017-04-10 10:29:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //11 rows in set (0.01 sec)


            //delete 11:
            //mysql>  select * from TestRecord where Line = 'line88';
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //| ID | CustomerCode | ModelName | FileName | FileTime            | Line   | X    | R    | XFlag | RFlag | BoardType |
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //| 14 | NE           | M123      | ABC.Csv  | 2017-04-10 10:18:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 15 | NE           | M123      | ABC.Csv  | 2017-04-10 10:19:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 16 | NE           | M123      | ABC.Csv  | 2017-04-10 10:21:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 17 | NE           | M123      | ABC.Csv  | 2017-04-10 10:22:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 18 | NE           | M123      | ABC.Csv  | 2017-04-10 10:23:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 19 | NE           | M123      | ABC.Csv  | 2017-04-10 10:24:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 20 | NE           | M123      | ABC.Csv  | 2017-04-10 10:25:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 21 | NE           | M123      | ABC.Csv  | 2017-04-10 10:26:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 22 | NE           | M123      | ABC.Csv  | 2017-04-10 10:27:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 23 | NE           | M123      | ABC.Csv  | 2017-04-10 10:28:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 24 | NE           | M123      | ABC.Csv  | 2017-04-10 10:29:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //11 rows in set (0.00 sec)

            //delete 10:   !!! 没有删除掉
            //mysql>  select * from TestRecord where Line = 'line88';
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //| ID | CustomerCode | ModelName | FileName | FileTime            | Line   | X    | R    | XFlag | RFlag | BoardType |
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //| 14 | NE           | M123      | ABC.Csv  | 2017-04-10 10:18:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 15 | NE           | M123      | ABC.Csv  | 2017-04-10 10:19:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 16 | NE           | M123      | ABC.Csv  | 2017-04-10 10:21:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 17 | NE           | M123      | ABC.Csv  | 2017-04-10 10:22:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 18 | NE           | M123      | ABC.Csv  | 2017-04-10 10:23:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 19 | NE           | M123      | ABC.Csv  | 2017-04-10 10:24:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 20 | NE           | M123      | ABC.Csv  | 2017-04-10 10:25:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 21 | NE           | M123      | ABC.Csv  | 2017-04-10 10:26:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 22 | NE           | M123      | ABC.Csv  | 2017-04-10 10:27:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 23 | NE           | M123      | ABC.Csv  | 2017-04-10 10:28:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 24 | NE           | M123      | ABC.Csv  | 2017-04-10 10:29:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //11 rows in set (0.00 sec)

            //delete 9:   !!!没有删除掉
            //mysql>  select * from TestRecord where Line = 'line88';
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //| ID | CustomerCode | ModelName | FileName | FileTime            | Line   | X    | R    | XFlag | RFlag | BoardType |
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //| 14 | NE           | M123      | ABC.Csv  | 2017-04-10 10:18:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 15 | NE           | M123      | ABC.Csv  | 2017-04-10 10:19:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 16 | NE           | M123      | ABC.Csv  | 2017-04-10 10:21:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 17 | NE           | M123      | ABC.Csv  | 2017-04-10 10:22:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 18 | NE           | M123      | ABC.Csv  | 2017-04-10 10:23:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 19 | NE           | M123      | ABC.Csv  | 2017-04-10 10:24:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 20 | NE           | M123      | ABC.Csv  | 2017-04-10 10:25:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 21 | NE           | M123      | ABC.Csv  | 2017-04-10 10:26:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 22 | NE           | M123      | ABC.Csv  | 2017-04-10 10:27:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 23 | NE           | M123      | ABC.Csv  | 2017-04-10 10:28:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //| 24 | NE           | M123      | ABC.Csv  | 2017-04-10 10:29:00 | line88 |   10 |  3.5 |     0 |     0 | T         |
            //+----+--------------+-----------+----------+---------------------+--------+------+------+-------+-------+-----------+
            //11 rows in set (0.00 sec)
        }