Beispiel #1
0
        private void LoadData()
        {
            //ServiceClient.GetSysRoleByTypeAsync(this.txtSearchSystemType.Text.Trim());
            string filter    = "";                                                                                    //查询过滤条件
            int    pageCount = 0;
            ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>(); //参数值
            ComboBox         cbxSystemType      = Utility.FindChildControl <ComboBox>(expander, "cbxSystemType");
            TextBox          RoleName           = Utility.FindChildControl <TextBox>(expander, "TxtRoleName");
            T_SYS_DICTIONARY dict        = cbxSystemType.SelectedItem as T_SYS_DICTIONARY;
            string           StrRoleName = "";

            StrRoleName = RoleName.Text;


            if (!string.IsNullOrEmpty(StrRoleName))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }

                //filter += " @" + paras.Count().ToString() + ".Contains(ROLENAME)";//类型名称
                //filter += "ROLENAME  ^@" + paras.Count().ToString();//类型名称
                filter += " @" + paras.Count().ToString() + ".Contains(ROLENAME)";
                paras.Add(StrRoleName);
            }
            //if (!string.IsNullOrEmpty(txtEmpCode.Text.Trim()))
            //{
            //    //filter += "EMPLOYEECODE==@" + paras.Count().ToString();
            //    filter += " @" + paras.Count().ToString() + ".Contains(EMPLOYEECODE)";
            //    paras.Add(txtEmpCode.Text.Trim());
            //}


            string systype = "";

            if (dict != null)
            {
                systype = dict.DICTIONARYVALUE == null ? "" : dict.DICTIONARYVALUE.GetValueOrDefault().ToString();
            }
            if (!string.IsNullOrEmpty(systype))
            {
                if (!string.IsNullOrEmpty(filter))
                {
                    filter += " and ";
                }
                filter += "SYSTEMTYPE ==@" + paras.Count().ToString();//类型名称
                paras.Add(systype);
            }
            string sType = "", sValue = "";

            if (string.IsNullOrEmpty(filter))
            {
                //默认为自己公司的角色
                filter += "OWNERCOMPANYID ==@" + paras.Count().ToString();//类型名称
                paras.Add(Common.CurrentLoginUserInfo.UserPosts[0].CompanyID);
            }

            loadbar.Start();
            SMT.Saas.Tools.PermissionWS.LoginUserInfo loginUserInfo = new SMT.Saas.Tools.PermissionWS.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID    = Common.CurrentLoginUserInfo.EmployeeID;

            //permClient.GetSysRoleInfosPagingByCompanyIDsAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE", filter, paras, pageCount, loginUserInfo, null);
            permClient.GetRoleInfosByUserAsync(dataPager.PageIndex, dataPager.PageSize, "CREATEDATE", filter, paras, pageCount, checkState, loginUserInfo);
        }