Beispiel #1
0
        public SelectUserViewModel()
        {
            DeptDao deptDao = new DeptDao();
            var     deptrlt = deptDao.GetDepartments();

            if (deptrlt.HasError)
            {
                MessageAlert.Alert(deptrlt.Msg);
                return;
            }
            Department deptAll = new Department()
            {
                Id   = 0,
                Name = "全部"
            };

            deptrlt.Entities.Insert(0, deptAll);
            Departments = deptrlt.Entities;
            Search();
        }
Beispiel #2
0
        public UserListViewModel()
        {
            MessengerInstance.Register <object>(this, MsgToken.RefreshUserList, RefreshList);
            RefreshList(null);

            DeptDao deptDao = new DeptDao();
            var     deptrlt = deptDao.GetDepartments();

            if (deptrlt.HasError)
            {
                MessageAlert.Alert(deptrlt.Msg);
            }
            //RoleDao roleDao = new RoleDao();
            //var rolerlt = roleDao.GetRoles();
            //if (rolerlt.HasError)
            //{
            //    MessageAlert.Alert(rolerlt.Msg);
            //}
            //DutyDao dutyDao = new DutyDao();
            //var dutyrlt = dutyDao.GetDuties();
            //if (dutyrlt.HasError)
            //{
            //    MessageAlert.Alert(dutyrlt.Msg);
            //}

            Department deptAll = new Department()
            {
                Id   = 0,
                Name = "全部"
            };

            deptrlt.Entities.Insert(0, deptAll);
            Departments = deptrlt.Entities;

            //Roles = rolerlt.Entities;
            //Duties = dutyrlt.Entities;
            if (App.ICCardReader.IsOpen())
            {
                App.ICCardReader.HandDataBack += ICCardReader_HandDataBack;
            }
        }