schangxiang@126.com
2025-09-17 e8e8a06fc68a6a645ce32be2cc9c3aaa67a97d68
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
using FineUIPro;
using iWareCommon.Common.Entity;
using iWareDataCore.RBAC.Entity;
using iWareDataCore.RBAC.EnumType;
using iWareDataCore.RBAC.Service;
using System;
using System.Collections.Generic;
 
namespace iWareWms.UserControl
{
    /// <summary>
    /// 许艺潇
    /// 2018.06
    /// 用于在添加菜单时父菜单选择的用户控件
    /// </summary>
    public partial class SelectParentControl : System.Web.UI.UserControl
    {
 
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                string msg;
                var contents = ContentService.GetInstance().QueryByParam(new QueryParam { Order = new Dictionary<string, object> { { "Type", "ASC" }, { "ContentIndex", "ASC" } } }, out msg);
 
                if (!string.IsNullOrEmpty(msg))
                {
                    Alert.ShowInTop(msg);
                    return;
                }
 
                contents.Add(new ContentEntity()
                {
                    Id = -1,
                    Name = "根目录",
                    Url = "/root",
                    ParentId = -2,
                    Type = -1,
                    Remark = "",
                    ContentIndex = 0,
                    Image = ""
                });
                Grid1.DataSource = contents;
                Grid1.DataBind();
            }
        }
 
 
        /// <summary>
        /// 改变contentType显示信息
        /// </summary>
        /// <param name="workLabel"></param>
        /// <returns></returns>
        protected string GetContentType(object contentType)
        {
            if ((int)contentType == -1)
            {
                return "根目录";
            }
            return ((iWareDataCore.RBAC.EnumType.EContentType)contentType).ToString();
        }
 
    }
}