// GET: users
        public ActionResult GetUserList()
        {
            BaseTran <user> recv = client.GetUserList();

            return(View(recv));
        }
Beispiel #2
0
        private void GetDate()
        {
            Worker.Run(() =>
            {
                try
                {
                    WebApiHelper.IsSaveJsonToFile = true;//保存数据到文件中
                    bool isSave1 = true;
                    bool isSave2 = false;
                    using (Bll bll = Bll.NewBllNoRelation())
                    {
                        //区域

                        zoneList = client.GetZoneList();
                        Log.Error(LogTags.BaseData, "1 GetZoneList:" + zoneList.Count);
                        //areaList = client.GetAreaList(isSave2);
                        areaList = bll.Areas.Where(i => i.Type != DbModel.Tools.AreaTypes.CAD).ToList();
                        Log.Error(LogTags.BaseData, "2 GetAreaList:" + areaList.Count);

                        //组织
                        orgList = client.GetOrgList();
                        Log.Error(LogTags.BaseData, "3 GetOrgList:" + orgList.Count);
                        //depList = client.GetDepList(isSave2);
                        depList = bll.Departments.ToList();
                        Log.Error(LogTags.BaseData, "4 GetDepList:" + depList.Count);

                        //人员
                        userList = client.GetUserList();
                        Log.Error(LogTags.BaseData, "5 GetUserList:" + orgList.Count);
                        //personnelList = client.GetPersonnelList(isSave2);
                        personnelList = bll.Personnels.ToList();
                        Log.Error(LogTags.BaseData, "6 GetPersonnelList:" + personnelList.Count);

                        //设备
                        deviceList = client.GetDeviceList(null, null, null);
                        Log.Error(LogTags.BaseData, "7 GetDeviceList:" + deviceList.Count);
                        //devInfoList = client.GetDevInfoList(null, null, null, isSave2);
                        devInfoList = bll.DevInfos.ToList();
                        Log.Error(LogTags.BaseData, "8 GetDevInfoList:" + devInfoList.Count);

                        //门禁
                        cardList = client.GetCardList();
                        Log.Error(LogTags.BaseData, "9 GetCardList:" + cardList.Count);
                        //guardCardList = client.GetGuardCardList(isSave2);
                        guardCardList = bll.EntranceGuardCards.ToList();

                        //告警事件
                        eventList = client.GetEventList(null, null, null, null);

                        WebApiHelper.IsSaveJsonToFile = false;
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(LogTags.BaseData, "Worker_DoWork:" + ex);
                }
            }, () =>
            {
                dg_zone.ItemsSource = zoneList;
                dg_area.ItemsSource = areaList;

                dg_org.ItemsSource = orgList;
                dg_dep.ItemsSource = depList;

                dg_user.ItemsSource   = userList;
                dg_person.ItemsSource = personnelList;

                dg_dev.ItemsSource     = deviceList;
                dg_devInfo.ItemsSource = devInfoList;

                dg_card.ItemsSource       = cardList;
                dg_guardCards.ItemsSource = guardCardList;

                dg_event.ItemsSource = eventList;
            });
        }