合并最新
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ADomain.aspx.cs" Inherits="FineUIPro.Web.SysManage.ADomain" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title></title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtDomainName" runat="server" Label="域名" MaxLength="500"
|
||||
Required="true" ShowRedStar="true" LabelWidth="120px" Readonly="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtRootOU" runat="server" Label="根组织单位" MaxLength="500"
|
||||
LabelWidth="120px" Required="true" ShowRedStar="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtUserName" runat="server" Label="用户名" MaxLength="100"
|
||||
LabelWidth="120px" Required="true" ShowRedStar="true">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtPassword" runat="server" Label="密码" MaxLength="100"
|
||||
LabelWidth="120px" Required="true" ShowRedStar="true" TextMode="Password">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:NumberBox ID="txtIntervaltime" runat="server" Label="同步频率(分钟)" LabelWidth="120px"
|
||||
NoDecimal="true" NoNegative="true" Readonly="true">
|
||||
</f:NumberBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnConnect" Icon="Connect" runat="server" Text="连接"
|
||||
Hidden="true" OnClick="btnConnect_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="同步"
|
||||
Hidden="true" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,138 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.DirectoryServices;
|
||||
using System.Linq;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
public partial class ADomain : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 用户编辑页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
///权限
|
||||
this.GetButtonPower();
|
||||
var aDomain = BLL.ADomainService.getADomain();
|
||||
if (aDomain != null)
|
||||
{
|
||||
this.txtDomainName.Text = aDomain.DomainName;
|
||||
this.txtRootOU.Text = aDomain.RootOU;
|
||||
this.txtUserName.Text = aDomain.UserName;
|
||||
this.txtPassword.Text = aDomain.Password;
|
||||
this.txtIntervaltime.Text = aDomain.Intervaltime.ToString();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtIntervaltime.Text ="720";
|
||||
string domainAndName = Page.User.Identity.Name;
|
||||
string[] infoes = domainAndName.Split(new string[1] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
|
||||
if (infoes.Length > 1)
|
||||
{
|
||||
this.txtDomainName.Text = infoes[0];
|
||||
this.txtUserName.Text = infoes[1];
|
||||
this.txtPassword.Focus();
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtDomainName.Focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
string menuId = Const.ADomainMenuId;
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, menuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.btnConnect.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 连接测试
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnConnect_Click(object sender, EventArgs e)
|
||||
{
|
||||
////检查域名是否存在
|
||||
var admoain = ADomainService.IsConnected(this.txtDomainName.Text.Trim(), this.txtUserName.Text.Trim(), this.txtPassword.Text.Trim());
|
||||
if (admoain == null)
|
||||
{
|
||||
ShowNotify("域连接不成功,请正确输入域信息!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
////检查域组织是否存在
|
||||
if (BLL.ADomainService.IsExistOU(admoain, this.txtDomainName.Text.Trim(), this.txtRootOU.Text.Trim()) == null)
|
||||
{
|
||||
ShowNotify("域连接不成功,请正确输入域信息!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
BLL.ADomainService.DeleteADomain();
|
||||
|
||||
Model.Sys_ADomain newADomain = new Model.Sys_ADomain();
|
||||
newADomain.DomainName = this.txtDomainName.Text.Trim();
|
||||
newADomain.RootOU = this.txtRootOU.Text.Trim();
|
||||
newADomain.UserName = this.txtUserName.Text.Trim();
|
||||
newADomain.Password = this.txtPassword.Text.Trim();
|
||||
newADomain.Intervaltime = BLL.Funs.GetNewIntOrZero(this.txtIntervaltime.Text.Trim());
|
||||
BLL.ADomainService.AddADomain(newADomain);
|
||||
|
||||
}
|
||||
/// <summary>
|
||||
/// 获取AD域按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
var adomain = ADomainService.getADomain();
|
||||
if (adomain != null)
|
||||
{
|
||||
DirectoryEntry domain = BLL.ADomainService.IsConnected(adomain.DomainName, adomain.UserName, adomain.Password);
|
||||
if (domain != null)
|
||||
{
|
||||
DirectoryEntry rootOU = BLL.ADomainService.IsExistOU(domain, adomain.DomainName, adomain.RootOU);
|
||||
if (rootOU != null)
|
||||
{
|
||||
ADomainService.SyncAll(rootOU); //同步所有
|
||||
ShowNotify("导入成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("域中不存在此组织结构!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("不能连接到域,请确认输入是否正确!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请先正确设置AD域信息!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
|
||||
|
||||
public partial class ADomain
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtDomainName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtDomainName;
|
||||
|
||||
/// <summary>
|
||||
/// txtRootOU 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRootOU;
|
||||
|
||||
/// <summary>
|
||||
/// txtUserName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtUserName;
|
||||
|
||||
/// <summary>
|
||||
/// txtPassword 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtPassword;
|
||||
|
||||
/// <summary>
|
||||
/// txtIntervaltime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox txtIntervaltime;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnConnect 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnConnect;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
}
|
||||
}
|
||||
@@ -20,7 +20,7 @@
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextArea runat="server" ID="txtCustomQuery" Height="50px" Width="1000px"></f:TextArea>
|
||||
<f:TextArea runat="server" ID="txtCustomQuery" Height="90px" Width="1200px"></f:TextArea>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button runat="server" ID="btnQuery" Icon="SystemSearch" OnClick="btnQuery_Click"></f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnMenuOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
<PopPanel>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" runat="server" DataIDField="RoleId" DataTextField="RoleName"
|
||||
DataKeyNames="RoleId" AllowSorting="true" SortField="RoleCode" SortDirection="ASC" EnableColumnLines="true"
|
||||
Hidden="true" Width="600px" Height="400px" PageSize="300">
|
||||
Hidden="true" Width="700px" Height="560px" PageSize="500">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="名称" ID="txtRoleName" EmptyText="输入查询条件"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px">
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="50px">
|
||||
</f:TextBox>
|
||||
<f:RadioButtonList runat="server" ID="rbIsOfficce" Label="类型" LabelWidth="90px"
|
||||
<f:RadioButtonList runat="server" ID="rbIsOfficce" AutoColumnWidth="true"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
<f:RadioItem Text="本部角色" Value="1" />
|
||||
<f:RadioItem Text="项目角色" Value="0" Selected ="true"/>
|
||||
@@ -55,7 +55,7 @@
|
||||
</f:Grid>
|
||||
</PopPanel>
|
||||
</f:DropDownBox>
|
||||
<f:RadioButtonList ID="rbMenuType" Label="菜单类型" runat="server" LabelWidth="80px"
|
||||
<f:RadioButtonList ID="rbMenuType" runat="server" AutoColumnWidth="true"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="rbMenuType_SelectedIndexChanged">
|
||||
<f:RadioItem Selected="true" Text="本部菜单" Value="MenuType_S"/>
|
||||
<f:RadioItem Text="项目菜单" Value="MenuType_P"/>
|
||||
|
||||
Reference in New Issue
Block a user