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
65
66
67
68
69
70
71
72
73
74
75
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using CY.BLL.Sys;
using CY.Model;
 
namespace CY.WebForm.Pages.sysInquiry
{
    public partial class PrintType : System.Web.UI.UserControl
    {
        SysInquiry_PrintingTypeBLL _printingTypeBLL = new SysInquiry_PrintingTypeBLL();
 
        public string PrintTypeListStr;
 
        public string OnClick = string.Empty;
 
        public string UserType = string.Empty;
 
        public Guid FirmId = Guid.Empty;
        public void SetPrintTypeListStr()
        {
            IList<SysInquiry_PrintingType> parentList = null;
            if (UserType == "1")
            {
                parentList = _printingTypeBLL.SelectParentModelListBySpecial();
            }
            else if (UserType == "2")
            {
 
                parentList = _printingTypeBLL.SelectParentModelListByAfterConsumption(FirmId);
            }
            else if (UserType == "3")
            {
                parentList = _printingTypeBLL.SelectParentModelListByAfterSet(FirmId);
            }
            IEnumerable<SysInquiry_PrintingType> childList = null;
            PrintTypeListStr = "[{ id: -1, parentId: 0, name: \"印刷类型\" }";
            if (parentList != null&&parentList.Count>0)
            {
                foreach (SysInquiry_PrintingType parent in parentList)
                {
                    PrintTypeListStr += " ,{id:" + parent.KeyId + ",parentId:-1,name:\"" + parent.PrintName + "\"}";
                    if (UserType == "1")
                    {
                        childList = _printingTypeBLL.SelectUsedModlesBySpecial(parent.KeyId);
                    }
                    else if (UserType == "2")
                    {
                        childList = _printingTypeBLL.SelectUsedModlesByAfterConsumption(parent.KeyId, FirmId);
                    }
                    else if (UserType == "3")
                    {
                        childList = _printingTypeBLL.SelectUsedModlesByAfterSet(parent.KeyId, FirmId);
                    }
                    if (childList != null && childList.Count() > 0)
                    {
                        foreach (SysInquiry_PrintingType child in childList)
                        {
                            PrintTypeListStr += " ,{id:" + child.KeyId + ",parentId:" + parent.KeyId + ",name:\"" + child.PrintName + "\"}";
                        }
                    }
                }
            }
            PrintTypeListStr += "]";
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            SetPrintTypeListStr();
        }
    }
}