Example #1
0
        private void rptCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var departmentId   = (int)e.Item.DataItem;
            var departmentInfo = DepartmentManager.GetDepartmentInfo(departmentId);

            var ltlHtml = (Literal)e.Item.FindControl("ltlHtml");

            ltlHtml.Text = PageDepartment.GetDepartmentRowHtml(departmentInfo, EDepartmentLoadingType.DepartmentSelect, _additional);
        }
Example #2
0
        private void rptDepartment_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            var departmentId   = (int)e.Item.DataItem;
            var departmentInfo = DepartmentManager.GetDepartmentInfo(departmentId);

            var ltlHtml = e.Item.FindControl("ltlHtml") as Literal;

            if (ltlHtml != null)
            {
                ltlHtml.Text = PageDepartment.GetDepartmentRowHtml(departmentInfo, EDepartmentLoadingType.AdministratorTree, _additional);
            }
        }
Example #3
0
        public void Page_Load(object sender, EventArgs e)
        {
            if (IsForbidden)
            {
                return;
            }

            _departmentId = Body.GetQueryInt("DepartmentID");
            _returnUrl    = StringUtils.ValueFromUrl(Body.GetQueryString("ReturnUrl"));
            if (string.IsNullOrEmpty(_returnUrl))
            {
                _returnUrl = PageDepartment.GetRedirectUrl(0);
            }

            if (!IsPostBack)
            {
                if (_departmentId == 0)
                {
                    ParentID.Items.Add(new ListItem("<无上级部门>", "0"));

                    var departmentIdList = DepartmentManager.GetDepartmentIdList();
                    var count            = departmentIdList.Count;
                    _isLastNodeArray = new bool[count];
                    foreach (var theDepartmentId in departmentIdList)
                    {
                        var departmentInfo = DepartmentManager.GetDepartmentInfo(theDepartmentId);
                        var listitem       = new ListItem(GetTitle(departmentInfo.DepartmentId, departmentInfo.DepartmentName, departmentInfo.ParentsCount, departmentInfo.IsLastNode), theDepartmentId.ToString());
                        ParentID.Items.Add(listitem);
                    }
                }
                else
                {
                    phParentID.Visible = false;
                }

                if (_departmentId != 0)
                {
                    var departmentInfo = DepartmentManager.GetDepartmentInfo(_departmentId);

                    DepartmentName.Text    = departmentInfo.DepartmentName;
                    Code.Text              = departmentInfo.Code;
                    ParentID.SelectedValue = departmentInfo.ParentId.ToString();
                    Summary.Text           = departmentInfo.Summary;
                }
            }
        }