initFCL
This commit is contained in:
@@ -0,0 +1,67 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Data;
|
||||
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
public partial class SelectUserToEMail : PageBase
|
||||
{
|
||||
#region 加载
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT Users.UserId,
|
||||
Users.UserName,
|
||||
Users.Email,
|
||||
Roles.RoleName,
|
||||
Depart.DepartName"
|
||||
+ @" FROM Sys_User as Users"
|
||||
+ @" LEFT JOIN dbo.Sys_Role AS Roles ON Roles.RoleId = Users.RoleId"
|
||||
+ @" LEFT JOIN dbo.Base_Depart AS Depart ON Depart.DepartId = Users.DepartId"
|
||||
+ @" WHERE Account!='gly' AND Users.UserId NOT IN(select UserId from Sys_UserToEMial)"
|
||||
+ @" ORDER BY UserName ASC ";
|
||||
|
||||
DataTable table = SQLHelper.GetDataTableRunText(strSql, null);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 提交按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
Model.Sys_UserToEMial newUserToEMial = new Model.Sys_UserToEMial();
|
||||
newUserToEMial.UserToEmailId = SQLHelper.GetNewID(typeof(Model.Sys_UserToEMial));
|
||||
newUserToEMial.UserId = rowID;
|
||||
CheckBoxField isLeader = (CheckBoxField)Grid1.FindColumn("IsLeader");
|
||||
if(isLeader!=null)
|
||||
{
|
||||
newUserToEMial.IsLeader = isLeader.GetCheckedState(rowIndex);
|
||||
}
|
||||
BLL.Sys_UserToEMialService.AddUserToEMial(newUserToEMial);
|
||||
}
|
||||
}
|
||||
ShowNotify("Save successfully!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user