コード例 #1
0
        private void SearchButton_Click(object sender, RoutedEventArgs e)
        {
            string filter    = " 1=1 ";
            int    pageCount = 0;
            ObservableCollection <object> paras = new System.Collections.ObjectModel.ObservableCollection <object>();   //参数值
            ComboBox cbxSystemType = Utility.FindChildControl <ComboBox>(expander, "cbxSystemType");
            //T_SYS_DICTIONARY dict = cbxSystemType.SelectedItem as T_SYS_DICTIONARY;
            //string systype = dict == null ? "" : dict.DICTIONARYVALUE.GetValueOrDefault().ToString();

            string parentid = "";

            LookUp           lkParentMenu = Utility.FindChildControl <LookUp>(expander, "lkParentMenu");
            T_SYS_ENTITYMENU menu         = lkParentMenu.DataContext as T_SYS_ENTITYMENU;

            if (!string.IsNullOrEmpty(StrSystemType))
            {
                filter += " && SYSTEMTYPE ==@" + paras.Count().ToString();
                paras.Add(StrSystemType);
            }
            if (menu != null)
            {
                parentid = menu.ENTITYMENUID;
                if (!string.IsNullOrEmpty(parentid))
                {
                    filter += " && T_SYS_ENTITYMENU2!=null && T_SYS_ENTITYMENU2.ENTITYMENUID ==@" + paras.Count().ToString();
                    paras.Add(parentid);
                }
            }
            SMT.Saas.Tools.PermissionWS.LoginUserInfo loginUserInfo = new SMT.Saas.Tools.PermissionWS.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID    = Common.CurrentLoginUserInfo.EmployeeID;
            //loadbar.Start();
            RefreshUI(RefreshedTypes.ShowProgressBar);
            client.GetSysMenuByTypePagingAsync(0, 500, "ORDERNUMBER", filter, paras, pageCount, loginUserInfo);
        }
コード例 #2
0
        /// <summary>
        /// 加载菜单数据
        /// </summary>
        private void LoadData()
        {
            string filter    = " 1=1 ";
            int    pageCount = 0;
            //from a in DataContext.T_SYS_ENTITYMENU.Include("T_SYS_ENTITYMENU2")
            //           where (string.IsNullOrEmpty(sysType) || a.SYSTEMTYPE == sysType)
            //           && (string.IsNullOrEmpty(parentID) || ( a.T_SYS_ENTITYMENU2!=null && a.T_SYS_ENTITYMENU2.ENTITYMENUID == parentID) )
            //           orderby a.ORDERNUMBER
            //           select a;


            ComboBox         cbxSystemType = Utility.FindChildControl <ComboBox>(expander, "cbxSystemType");
            T_SYS_DICTIONARY dict          = cbxSystemType.SelectedItem as T_SYS_DICTIONARY;
            string           systype       = dict == null ? "" : dict.DICTIONARYVALUE.GetValueOrDefault().ToString();

            string parentid = "";
            //string StrName = "";//菜单名称


            LookUp           lkParentMenu = Utility.FindChildControl <LookUp>(expander, "lkParentMenu");
            T_SYS_ENTITYMENU menu         = lkParentMenu.DataContext as T_SYS_ENTITYMENU;

            if (!string.IsNullOrEmpty(systype))
            {
                filter += " && SYSTEMTYPE ==@" + paras.Count().ToString();
                paras.Add(systype);
            }
            if (menu != null)
            {
                parentid = menu.ENTITYMENUID;
                if (!string.IsNullOrEmpty(parentid))
                {
                    filter += " && T_SYS_ENTITYMENU2!=null && T_SYS_ENTITYMENU2.ENTITYMENUID ==@" + paras.Count().ToString();
                    paras.Add(parentid);
                }
            }
            SMT.Saas.Tools.PermissionWS.LoginUserInfo loginUserInfo = new SMT.Saas.Tools.PermissionWS.LoginUserInfo();
            loginUserInfo.companyID = Common.CurrentLoginUserInfo.UserPosts[0].CompanyID;
            loginUserInfo.userID    = Common.CurrentLoginUserInfo.EmployeeID;
            loadbar.Start();
            client.GetSysMenuByTypePagingAsync(dataPager.PageIndex, dataPager.PageSize, "ORDERNUMBER", filter, paras, pageCount, loginUserInfo);
            //client.GetSysMenuByTypeAsync(systype, parentid);
        }