public List <GateRecord> InitDt(IDictionary <string, object> strWhere, int startIndex, int endIndex)
        {
            //实现分页查询的方法, 使用strWhere,startIndex,endIndex, 同时需要返回Pager
            //记录总数量

            ICustomsCMS server = XmlRpcInstance.getInstance();

            try
            {
                NumResponse numResponse = server.searchPassengerCount(strWhere[ClearanceRecord.NAME_COLUMN].ToString(), DictionaryToXmlRpcStruct.dictionaryToXmlRpcStruct(strWhere));;
                strWhere.Add("start", startIndex);
                strWhere.Add("limit", endIndex);
                GateRecordsResponse res = server.searchPassenger(strWhere[ClearanceRecord.NAME_COLUMN].ToString(), DictionaryToXmlRpcStruct.dictionaryToXmlRpcStruct(strWhere));
                TotalNum = numResponse.all_num;

                List <GateRecord> gateRecords = new List <GateRecord>(res.records);
                for (int i = 0; i < gateRecords.Count; i++)
                {
                    gateRecords[i].unnormal_type_name = zhuhai.util.AbnormalType.getAllAbnormalTypeNames()[gateRecords[i].unnormal_type + 1];
                    gateRecords[i].gate_mode_name     = zhuhai.util.GateWorkState.getAllGateWorkStateNames()[gateRecords[i].gate_mode];
                }
                return(gateRecords);
            }
            catch (Exception ex) {
                Console.WriteLine("ClearanceRecordService - InitDt" + ex.Message);
            }

            return(null);
        }
Exemple #2
0
        /// <summary>
        /// 根据条件查询通关记录人数
        /// </summary>
        /// <param name="name">姓名</param>
        /// <returns></returns>
        public string getGateRecordsNum(string name, IDictionary <string, object> strWhere)
        {
            try
            {
                ICustomsCMS            server = XmlRpcInstance.getInstance();
                GateRecordsNumResponse gateRecordsNumResponse = server.getGateRecordsNum(name, DictionaryToXmlRpcStruct.dictionaryToXmlRpcStruct(strWhere));

                if (gateRecordsNumResponse.error_code == 0)
                {
                    return("过关总人数:" + gateRecordsNumResponse.all_num +
                           "!正常过关人数:" + gateRecordsNumResponse.healthy_num + "!异常过关人数:" + gateRecordsNumResponse.unhealthy_num);
                }
                else
                {
                    throw new Exception("错误:" + gateRecordsNumResponse.error_msg);
                }
            }
            catch (Exception ex)
            {
                throw new Exception("错误:" + ex.Message);
            }
        }