示例#1
0
        public List <LogRecord> InitDt(IDictionary <string, object> strWhere, int startIndex, int endIndex)
        {
            try
            {
                ICustomsCMS server = XmlRpcInstance.getInstance();

                NumResponse num = server.getLogCount((DateTime)strWhere[LogColumn.para_begin_column], (DateTime)strWhere[LogColumn.para_end_column], strWhere[LogColumn.operatePeople_column].ToString(), "", "");;
                TotalNum = num.all_num;

                LogListRPCResponse logListRPCResponse = server.getLog((DateTime)strWhere[LogColumn.para_begin_column], (DateTime)strWhere[LogColumn.para_end_column], strWhere[LogColumn.operatePeople_column].ToString(), "", "", startIndex, endIndex);

                LogRecord[] list = logListRPCResponse.loglists;



                List <LogRecord> logs = new List <LogRecord>();
                for (int i = 0; i < list.Length; i++)
                {
                    logs.Add(list[i]);
                }
                return(logs);
            }
            catch (Exception ex)
            {
                throw new Exception("错误:" + ex.Message);
            }
        }
示例#2
0
        public List <SystemManage> InitDt(IDictionary <string, object> strWhere, int startIndex, int endIndex)
        {
            try
            {
                ICustomsCMS server      = XmlRpcInstance.getInstance();
                NumResponse numResponse = server.findAllUserCount(strWhere[SystemManage.USERNAME_COLUMN].ToString());
                if (numResponse.error_code != 0)
                {
                    throw new Exception("连接服务器错误:" + numResponse.error_msg);
                }
                TotalNum = numResponse.all_num;

                UsercheckListRPCResponse response = server.findAllUserByUserid(strWhere[SystemManage.USERNAME_COLUMN].ToString(), startIndex, endIndex);
                Usercheck[]         titlelist     = response.listmodule;
                List <SystemManage> wrs           = new List <SystemManage>();
                for (int i = 0; i < titlelist.Length; i++)
                {
                    string rolename = getRoleName(Int32.Parse(titlelist[i].rolename));
                    wrs.Add(new SystemManage(titlelist[i].id, titlelist[i].username, titlelist[i].password, Int32.Parse(titlelist[i].rolename), rolename, titlelist[i].realname, titlelist[i].idcard));
                }
                return(wrs);
            }
            catch (Exception ex)
            {
                Console.WriteLine("错误:" + ex.Message);
                return(null);
            }
        }
        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);
        }