Exemple #1
0
        public string getDemoRTInfo()
        {
            DoorDAL           doorDAL        = new DoorDAL();
            List <doorRecord> doorRecordList = doorDAL.getDemoDoorInfo();
            RfidDAL           rfidDAL        = new RfidDAL();
            List <RFIDRecord> RFIDRecordList = rfidDAL.getDemoRFIDInfo();

            bookDAL     bookDAL        = new bookDAL();
            ReaderDAL   readerDAL      = new ReaderDAL();
            LocationDAL locationDAL    = new LocationDAL();
            string      demoInfoInJson = "[";
            bool        flag           = true;

            //Door_RT_info
            foreach (doorRecord doorRecord in doorRecordList)
            {
                if (!flag)
                {
                    demoInfoInJson += ",";
                }
                string locationName = locationDAL.getLocationByDoorIp(doorRecord.Door_ip);
                string readerName   = readerDAL.getReaderNameBySC(doorRecord.Signal_code);
                string each         = "{\"action\":\"" + doorRecord.Action + "\",";
                each           += "\"reader_name\":\"" + readerName + "\",";
                each           += "\"generate_date\":\"" + doorRecord.Generate_date + "\",";
                each           += "\"location_door\":\"" + locationName + "\",";
                each           += "\"door_ip\":\"" + doorRecord.Door_ip + "\"}";
                demoInfoInJson += each;
                flag            = false;
            }


            //RFID_RT_info
            foreach (RFIDRecord RFIDRecord in RFIDRecordList)
            {
                if (!flag)
                {
                    demoInfoInJson += ",";
                }
                string locationName = locationDAL.getLocationByRFIDIp(RFIDRecord.Ip);
                string bookName     = bookDAL.getbookNameBySC(RFIDRecord.Signal_code);
                string each         = "{\"signal_code\":\"" + RFIDRecord.Signal_code + "\",";
                each           += "\"book_name\":\"" + bookName + "\",";
                each           += "\"action_date\":\"" + RFIDRecord.Action_date + "\",";
                each           += "\"location_rfid\":\"" + locationName + "\",";
                each           += "\"ip\":\"" + RFIDRecord.Ip + "\"}";
                demoInfoInJson += each;
                flag            = false;
            }

            demoInfoInJson += "]";
            return(demoInfoInJson);
        }
Exemple #2
0
 public bookBUS()
 {
     bookDAL = new bookDAL();
 }
Exemple #3
0
 public bookBAL(string pConString)
 {
     obj_bookDAL = new bookDAL(pConString);
 }
Exemple #4
0
 public amanatBAL(string pConString)
 {
     obj_amanat = new amanatDAL(pConString);
     obj_member = new memberDAL(pConString);
     obj_book   = new bookDAL(pConString);
 }