Esempio n. 1
0
        private void InitParas(string CustPermID)
        {
            ServiceClient = new PermissionServiceClient();

            ServiceClient.GetEntityMenuCustomPermByIDCompleted += new EventHandler <GetEntityMenuCustomPermByIDCompletedEventArgs>(ServiceClient_GetEntityMenuCustomPermByIDCompleted);

            //ServiceClient.GetSysMenuByTypeCompleted += new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted);

            ServiceClient.FindSysPermissionByTypeCompleted += new EventHandler <FindSysPermissionByTypeCompletedEventArgs>(ServiceClient_FindSysPermissionByTypeCompleted);

            ServiceClient.EntityMenuCustomPermAddCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_EntityMenuCustomPermAddCompleted);

            ServiceClient.EntityMenuCustomPermUpdateCompleted += new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_EntityMenuCustomPermUpdateCompleted);

            if (FormType == FormTypes.New)
            {
                CustPerm = new T_SYS_ENTITYMENUCUSTOMPERM();
                CustPerm.ENTITYMENUCUSTOMPERMID = Guid.NewGuid().ToString();
            }

            //初始化角色权限
            if (!string.IsNullOrEmpty(CustPermID))
            {
                ServiceClient.GetEntityMenuCustomPermByIDAsync(CustPermID);
            }
            else
            {
                //ServiceClient.GetSysMenuByTypeAsync("");
                ServiceClient.FindSysPermissionByTypeAsync("");
            }
        }
Esempio n. 2
0
        //void ServiceClient_GetSysMenuByTypeCompleted(object sender, GetSysMenuByTypeCompletedEventArgs e)
        //{
        //    cbxMenu.ItemsSource = null;
        //    if (e.Result != null)
        //    {
        //        //绑定角色名称
        //        List<T_SYS_ENTITYMENU> ents = e.Result.ToList();
        //        cbxMenu.ItemsSource = ents;
        //        cbxMenu.DisplayMemberPath = "MENUNAME";
        //        foreach (var item in cbxMenu.Items)
        //        {
        //            T_SYS_ENTITYMENU tmp = item as T_SYS_ENTITYMENU;
        //            if (tmp != null && CustPerm != null && CustPerm.T_SYS_ENTITYMENU != null
        //                && tmp.ENTITYMENUID == this.CustPerm.T_SYS_ENTITYMENU.ENTITYMENUID)
        //            {
        //                cbxMenu.SelectedItem = item;
        //                break;
        //            }
        //        }
        //    }
        //}

        void ServiceClient_GetEntityMenuCustomPermByIDCompleted(object sender, GetEntityMenuCustomPermByIDCompletedEventArgs e)
        {
            CustPerm = e.Result;
            BindORG();

            ServiceClient.GetSysMenuByTypeAsync("", "");
            ServiceClient.FindSysPermissionByTypeAsync("");
        }
        private void InitParas(string CustPermID)
        {
            ServiceClient = new PermissionServiceClient();
            
            ServiceClient.GetEntityMenuCustomPermByIDCompleted += new EventHandler<GetEntityMenuCustomPermByIDCompletedEventArgs>(ServiceClient_GetEntityMenuCustomPermByIDCompleted);
           
            //ServiceClient.GetSysMenuByTypeCompleted += new EventHandler<GetSysMenuByTypeCompletedEventArgs>(ServiceClient_GetSysMenuByTypeCompleted);
           
            ServiceClient.FindSysPermissionByTypeCompleted += new EventHandler<FindSysPermissionByTypeCompletedEventArgs>(ServiceClient_FindSysPermissionByTypeCompleted);
            
            ServiceClient.EntityMenuCustomPermAddCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_EntityMenuCustomPermAddCompleted);
                        
            ServiceClient.EntityMenuCustomPermUpdateCompleted += new EventHandler<System.ComponentModel.AsyncCompletedEventArgs>(ServiceClient_EntityMenuCustomPermUpdateCompleted);
            
            if (FormType == FormTypes.New)
            {
                CustPerm = new T_SYS_ENTITYMENUCUSTOMPERM();
                CustPerm.ENTITYMENUCUSTOMPERMID = Guid.NewGuid().ToString();

            }

            //初始化角色权限
            if (!string.IsNullOrEmpty(CustPermID))
            {
                ServiceClient.GetEntityMenuCustomPermByIDAsync(CustPermID);
            }
            else
            {
                //ServiceClient.GetSysMenuByTypeAsync("");
                ServiceClient.FindSysPermissionByTypeAsync("");
            }
        }