This commit is contained in:
gaofei
2022-04-14 11:15:34 +08:00
parent 274010da92
commit 8e73412eb6
49 changed files with 1609 additions and 2301 deletions
@@ -51,6 +51,11 @@
SortField="RoleType" FieldType="String" HeaderText="级别" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:TemplateField Width="200px" ColumnID="CNProfessionalIds" HeaderText="专业" TextAlign="Left" HeaderTextAlign="Center">
<ItemTemplate>
<asp:Label ID="lbtnPro" runat="server" Text='<%# ConvertCN(Eval("CNProfessionalIds")) %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:CheckBoxField Width="100px" RenderAsStaticField="true" TextAlign="Center" DataField="IsSystemBuilt" HeaderText="内置" />
<f:RenderField ColumnID="Def" DataField="Def" SortField="Def" FieldType="String" Width="150px"
HeaderText="备注" HeaderTextAlign="Center" TextAlign="Left" >
+40 -18
View File
@@ -15,7 +15,7 @@
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
{
if (!IsPostBack)
{
////权限按钮方法
@@ -37,16 +37,16 @@
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT Roles.RoleId,Roles.RoleName,Roles.RoleCode,Roles.Def,Roles.IsSystemBuilt"
string strSql = @"SELECT Roles.RoleId,Roles.RoleName,Roles.RoleCode,Roles.Def,Roles.RoleType,Roles.CNProfessionalIds,Roles.IsSystemBuilt"
+ @" ,(CASE WHEN IsOffice=1 THEN '本部角色' ELSE '项目角色' END) AS IsOfficeName"
+ @" FROM dbo.Sys_Role AS Roles "
+ @" FROM dbo.Sys_Role AS Roles "
+ @" WHERE 1=1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtRoleName.Text.Trim()))
{
strSql += " AND RoleName LIKE @RoleName";
listStr.Add(new SqlParameter("@RoleName", "%" + this.txtRoleName.Text.Trim() + "%"));
}
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
@@ -55,7 +55,7 @@
Grid1.DataSource = table;
Grid1.DataBind();
}
#region
/// <summary>
/// 右键删除事件
@@ -84,7 +84,7 @@
{
BLL.LogService.AddSys_Log(this.CurrUser, roles.RoleCode, roles.RoleId, Const.RoleMenuId, Const.BtnDelete);
BLL.RoleService.DeleteRole(rowID);
}
}
}
@@ -102,7 +102,7 @@
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
{
BindGrid();
}
@@ -128,6 +128,28 @@
}
#endregion
protected string ConvertCN(object CNProfessionalIds)
{
string cnName = string.Empty;
if (CNProfessionalIds != null)
{
var strs = CNProfessionalIds.ToString().Split(',');
foreach (var item in strs)
{
var cn = BLL.CNProfessionalService.GetCNProfessional(item);
if (cn != null)
{
cnName += cn.ProfessionalName + ",";
}
}
if (!string.IsNullOrEmpty(cnName))
{
cnName = cnName.Substring(0, cnName.Length - 1);
}
}
return cnName;
}
/// <summary>
/// Grid行双击事件
/// </summary>
@@ -160,15 +182,15 @@
}
string Id = Grid1.SelectedRowID;
var roles = BLL.RoleService.GetRoleByRoleId(Id);
if (roles != null && (!roles.IsSystemBuilt.HasValue || roles.IsSystemBuilt == false || this.CurrUser.UserId == BLL.Const.sysglyId ))
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RoleListEdit.aspx?roleId={0}", Id, "编辑 - ")));
}
else
{
Alert.ShowInParent("系统内置角色不允许再修改!", MessageBoxIcon.Warning);
return;
}
//if (roles != null && (!roles.IsSystemBuilt.HasValue || roles.IsSystemBuilt == false || this.CurrUser.UserId == BLL.Const.sysglyId ))
//{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RoleListEdit.aspx?roleId={0}", Id, "编辑 - ")));
//}
//else
//{
// Alert.ShowInParent("系统内置角色不允许再修改!", MessageBoxIcon.Warning);
// return;
//}
}
#region
@@ -188,7 +210,7 @@
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
this.btnMenuEdit.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
@@ -222,7 +244,7 @@
{
content = "该角色已在【用户信息】中使用,不能删除!";
}
if (string.IsNullOrEmpty(content))
{
return true;
+9
View File
@@ -93,6 +93,15 @@ namespace FineUIPro.Web.SysManage {
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// lbtnPro 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lbtnPro;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@@ -37,6 +37,8 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList runat="server" ID="drpCNProfessional" Label="专业" LabelWidth="90px" EnableMultiSelect="true">
</f:DropDownList>
<f:TextBox ID="txtDef" runat="server" Label="备注" MaxLength="100" LabelWidth="90px"></f:TextBox>
</Items>
</f:FormRow>
@@ -35,6 +35,7 @@ namespace FineUIPro.Web.SysManage
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.RoleId = Request.Params["roleId"];
Funs.FineUIPleaseSelect(this.drpRoleType);
BLL.CNProfessionalService.InitCNProfessionalDownList(this.drpCNProfessional, true);
///权限
this.GetButtonPower();
if (!string.IsNullOrEmpty(this.RoleId))
@@ -43,7 +44,7 @@ namespace FineUIPro.Web.SysManage
if (role != null)
{
this.txtRoleCode.Text = role.RoleCode;
this.txtRoleName.Text = role.RoleName;
this.txtRoleName.Text = role.RoleName;
this.txtDef.Text = role.Def;
if (role.IsOffice == true)
{
@@ -53,6 +54,10 @@ namespace FineUIPro.Web.SysManage
{
this.drpRoleType.SelectedValue = role.RoleType;
}
if (!string.IsNullOrEmpty(role.CNProfessionalIds))
{
this.drpCNProfessional.SelectedValueArray = role.CNProfessionalIds.Split(',');
}
}
}
else
@@ -76,7 +81,7 @@ namespace FineUIPro.Web.SysManage
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnSave.Hidden = false;
}
}
}
}
#endregion
@@ -106,6 +111,19 @@ namespace FineUIPro.Web.SysManage
{
newRole.RoleType = this.drpRoleType.SelectedValue;
}
string cnProfessionalIds = string.Empty;
foreach (var item in this.drpCNProfessional.SelectedValueArray)
{
if (item != BLL.Const._Null)
{
cnProfessionalIds += item + ",";
}
}
if (!string.IsNullOrEmpty(cnProfessionalIds))
{
cnProfessionalIds = cnProfessionalIds.Substring(0, cnProfessionalIds.Length-1);
}
newRole.CNProfessionalIds = cnProfessionalIds;
if (string.IsNullOrEmpty(this.RoleId))
{
newRole.RoleId = SQLHelper.GetNewID(typeof(Model.Sys_Role));
@@ -75,6 +75,15 @@ namespace FineUIPro.Web.SysManage {
/// </remarks>
protected global::FineUIPro.DropDownList drpRoleType;
/// <summary>
/// drpCNProfessional 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCNProfessional;
/// <summary>
/// txtDef 控件。
/// </summary>