Esempio n. 1
0
        public void PrintChecked()
        {
            try
            {
                if (SelectedRow != null)
                {
                    CheckPrintClicked();
                    if (!_permissionDet.IsPrintDisable(SelectedRow.OBJECT_NAME))
                    {
                        SelectedRow.PERM_PRINT = false;
                    }
                    SelectedRow.PERM_VIEW = SelectedRow.PERM_PRINT;

                    NotifyPropertyChanged("SelectedRow");
                }
            }
            catch (Exception ex)
            {
                throw ex.LogException();
            }
        }
Esempio n. 2
0
        public PermissionViewModel(UserInformation userInformation, string roleName)
        {
            _secRoleObjectPermission = new SEC_ROLE_OBJECT_PERMISSION();
            _permissionDet           = new PermissionDet(userInformation);
            Permission = _permissionDet.GetRolePermissionList(roleName);
            _roleName  = roleName;

            foreach (SEC_ROLE_OBJECT_PERMISSION perm in Permission)
            {
                if (!_permissionDet.IsPrintDisable(perm.OBJECT_NAME))
                {
                    perm.PERM_PRINT = false;
                    perm.PERM_VIEW  = false;
                }
            }

            //var checkedcnt = Permission.Where(perm => perm.PERM_PRINT == true);
            //var cnt = Permission.Where(perm => _permissionDet.IsPrintDisable(perm.OBJECT_NAME));
            //chkSelectAllPrint.IsChecked = (checkedcnt.Count() == cnt.Count() ? true : false);
        }