Ejemplo n.º 1
0
 /// <summary>
 /// 修改
 /// </summary>
 /// <param name="model"></param>
 /// <returns>
 /// 0操作失败,请联系管理员
 /// 1操作成功
 /// 11当前对象已不存在
 /// 12名称重复
 /// 13编码重复
 /// </returns>
 public int MenuEdit(MenuInfo model)
 {
     string xmlModel = model.ToXmlString();
     return TryCatchCore<int>(() =>
     {
         return _proxy.MenuEdit(User.Current.Credentials.ToXmlString(), xmlModel);
     });
 }
Ejemplo n.º 2
0
        /// <summary>
        /// 添加选项卡
        /// </summary>
        private void AddTabs(MenuInfo menuInfo)
        {
            foreach (DocumentPanel item in docGroup.Items)
            {
                MenuInfo tmpMenuInfo = item.Caption as MenuInfo;
                if (tmpMenuInfo.ID == menuInfo.ID)
                {
                    docGroup.SelectedTabIndex = item.TabIndex;
                    return;
                }
            }

            DocumentPanel docPanel = new DocumentPanel();
            docPanel.Style = (Style)this.FindResource("homeDocumentPanel");
            System.Windows.Controls.UserControl control = (System.Windows.Controls.UserControl)Assembly.Load("BPMS.Views.Default").CreateInstance("BPMS.Views.Default." + menuInfo.FormName);  
            docPanel.Content = control;
            docPanel.TabIndex = docGroup.Items.Count;
            docPanel.Caption = menuInfo;
            docGroup.Items.Add(docPanel);
            docGroup.SelectedTabIndex = docGroup.Items.Count -1;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 获取菜单
 /// </summary>
 /// <param name="parentId"></param>
 /// <returns></returns>
 public List<MenuInfo> GetMenuList(int parentId)
 {
     List<MenuInfo> list = new List<MenuInfo>();
     DataTable menuDt = RefProvider.BPMSServiceRefInstance.LogGetUserMenuList();
     foreach (DataRow item in menuDt.Rows)
     {
         if (int.Parse(item["ParentId"].ToString()) == parentId)
         {
             MenuInfo menuInfo = new MenuInfo();
             menuInfo.ID = int.Parse(item["ID"].ToString());
             menuInfo.Name = item["Name"].ToString();
             menuInfo.IconUrl = item["IconUrl"].ToString();
             list.Add(menuInfo);
         }
     }
     return list;
 }