Beispiel #1
0
        public static string GetDepartmentRowHtml(DepartmentInfo departmentInfo, EDepartmentLoadingType loadingType, NameValueCollection additional)
        {
            var treeItem = DepartmentTreeItem.CreateInstance(departmentInfo);
            var title    = treeItem.GetItemHtml(loadingType, additional, false);

            var rowHtml = string.Empty;

            if (loadingType == EDepartmentLoadingType.AdministratorTree || loadingType == EDepartmentLoadingType.DepartmentSelect || loadingType == EDepartmentLoadingType.ContentTree)
            {
                rowHtml = $@"
<tr treeItemLevel=""{departmentInfo.ParentsCount + 1}"">
	<td nowrap>{title}</td>
</tr>
";
            }
            else if (loadingType == EDepartmentLoadingType.ContentList)
            {
                string editUrl = $@"<a href=""javascript:;"" onclick=""{ModalDepartmentAdd.GetOpenWindowStringToEdit(
                    departmentInfo.Id, GetRedirectUrl(departmentInfo.Id))}"">编辑</a>";

                var urlUp = PageUtils.GetSettingsUrl(nameof(PageAdminDepartment), new NameValueCollection
                {
                    { "Subtract", "True" },
                    { "DepartmentID", departmentInfo.Id.ToString() }
                });
                string upLink = $@"<a href=""{urlUp}""><img src=""../Pic/icon/up.gif"" border=""0"" alt=""上升"" /></a>";

                var urlDown = PageUtils.GetSettingsUrl(nameof(PageAdminDepartment), new NameValueCollection
                {
                    { "Add", "True" },
                    { "DepartmentID", departmentInfo.Id.ToString() }
                });
                string downLink = $@"<a href=""{urlDown}""><img src=""../Pic/icon/down.gif"" border=""0"" alt=""下降"" /></a>";

                string checkBoxHtml = $"<input type='checkbox' name='DepartmentIDCollection' value='{departmentInfo.Id}' />";

                rowHtml = $@"
<tr treeItemLevel=""{departmentInfo.ParentsCount + 1}"">
    <td>{title}</td>
    <td>&nbsp;{departmentInfo.Code}</td>
    <td class=""text-center"">{departmentInfo.CountOfAdmin}</td>
    <td class=""text-center"">{upLink}</td>
    <td class=""text-center"">{downLink}</td>
    <td class=""text-center"">{editUrl}</td>
    <td class=""text-center"">{checkBoxHtml}</td>
</tr>
";
            }
            return(rowHtml);
        }
Beispiel #2
0
        private string GetTitle(DepartmentInfo departmentInfo)
        {
            var treeItem = DepartmentTreeItem.CreateInstance(departmentInfo);

            return(treeItem.GetItemHtml(EDepartmentLoadingType.List, null, true));
        }