122
This commit is contained in:
parent
d5f90004f5
commit
904833ad7e
Binary file not shown.
|
@ -38,6 +38,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
string emailId = Request.Params["id"];
|
||||
pops = BLL.Email_Send.Email_ParamsService.GetEmail_ParamsPop(emailId);
|
||||
|
||||
|
||||
if (pops == null)
|
||||
{
|
||||
Email_Params pop = new Email_Params();
|
||||
|
@ -50,7 +51,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
|
||||
BLL.Email_Send.Email_ParamsService.AddEmail_Params(pop);
|
||||
//BLL.Sys_LogService.AddLog(Const.System_2, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.SendEmailPopMenuId,, "Add Parameter information",);
|
||||
ShowNotify("Send Successfully!", MessageBoxIcon.Success);
|
||||
ShowNotify("发送成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
else {
|
||||
|
@ -61,7 +62,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
pops.UpdateTime = DateTime.Now;
|
||||
BLL.Email_Send.Email_ParamsService.UpdateEmail_Params(pops);
|
||||
//BLL.Sys_LogService.AddLog(Const.System_2, this.CurrUser.LoginProjectId, this.CurrUser.UserId,Const.menuId, "Update Parameter information");
|
||||
ShowNotify("Send Successfully!", MessageBoxIcon.Success);
|
||||
ShowNotify("发送成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnAdd" ToolTip="Add" Icon="Add" Text="添加" runat="server" OnClick="btnAdd_Click" ></f:Button>
|
||||
|
||||
<f:Button ID="btnDelete" ToolTip="Delete" Text="删除" Icon="Delete" ConfirmText="Make sure to delete the current data?" OnClick="btnDelete_Click"
|
||||
<f:Button ID="btnDelete" ToolTip="Delete" Text="删除" Icon="Delete" ConfirmText="确定要删除当前数据?" OnClick="btnDelete_Click"
|
||||
runat="server" >
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
|
|
@ -72,7 +72,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
Alert.ShowInParent("请选择至少一条记录!");
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
|
@ -119,7 +119,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
|
||||
BLL.Email_Send.Email_ParamsService.DeleteEmail_ParamsById(rowID);
|
||||
ShowNotify("Deleted successfully!");
|
||||
ShowNotify("删除成功!");
|
||||
|
||||
}
|
||||
BindGrid();
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
|
||||
BLL.Email_Send.Email_PopService.UpdateEmail_Pop(pop);
|
||||
//BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Update Email information");
|
||||
ShowNotify("Save Successfully!", MessageBoxIcon.Success);
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -238,7 +238,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("Cannot Be Created Repeatedly!", MessageBoxIcon.Error);
|
||||
ShowNotify("不能重复创建!", MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -266,8 +266,8 @@ namespace FineUIPro.Web.Email_Send
|
|||
tep.EmtempID = emailId;
|
||||
tep.EmuserID = item.UserId.ToString();
|
||||
tep.EMPeopleType = BLL.Const.SenderType;
|
||||
tep.EmuserName = item.UserName.ToString();
|
||||
tep.EmuaerEmailAddress = item.Email.ToString();
|
||||
tep.EmuserName = item.UserName;
|
||||
tep.EmuaerEmailAddress = item.Email;
|
||||
tplist.Add(tep);
|
||||
}
|
||||
}
|
||||
|
@ -280,10 +280,10 @@ namespace FineUIPro.Web.Email_Send
|
|||
Model.Email_ToPeople tep = new Model.Email_ToPeople();
|
||||
tep.EmID = Guid.NewGuid().ToString();
|
||||
tep.EmtempID = temp.EmailId;
|
||||
tep.EmuserID = item.UserId.ToString();
|
||||
tep.EmuserName = item.UserName.ToString();
|
||||
tep.EmuserID = item.UserId;
|
||||
tep.EmuserName = item.UserName;
|
||||
tep.EMPeopleType = BLL.Const.CCType;
|
||||
tep.EmuaerEmailAddress = item.Email.ToString();
|
||||
tep.EmuaerEmailAddress = item.Email;
|
||||
tplist.Add(tep);
|
||||
}
|
||||
}
|
||||
|
@ -381,7 +381,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("Cannot Be Created Repeatedly!", MessageBoxIcon.Error);
|
||||
ShowNotify("不能重复创建", MessageBoxIcon.Error);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
//BLL.Sys_LogService.AddLog(this.CurrUser.UserId, "Update SendEmailTemplate!");
|
||||
}
|
||||
}
|
||||
ShowNotify("Save Successfully!", MessageBoxIcon.Success);
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
<f:Button ID="btnAdd" ToolTip="Add" Icon="Add" Text="添加" runat="server" OnClick="btnAdd_Click" ></f:Button>
|
||||
<f:Button ID="btnEdit" ToolTip="Edit" Icon="Pencil" Text="修改" runat="server" OnClick="btnEdit_Click" ></f:Button>
|
||||
|
||||
<f:Button ID="btnDelete" ToolTip="Delete" Text="删除" Icon="Delete" ConfirmText="Make sure to delete the current data?" OnClick="btnDelete_Click"
|
||||
<f:Button ID="btnDelete" ToolTip="Delete" Text="删除" Icon="Delete" ConfirmText="确定要删除当前数据?" OnClick="btnDelete_Click"
|
||||
runat="server" >
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
@ -43,26 +43,26 @@
|
|||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="120px" ColumnID="EmailParamsID" DataField="EmailParamsID" SortField="EmailParamsID"
|
||||
HeaderTextAlign="Center" TextAlign="Left" FieldType="String" HeaderText="邮件通知人">
|
||||
HeaderTextAlign="Left" TextAlign="Left" FieldType="String" HeaderText="邮件通知人">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="380px" ColumnID="EmailTitle" DataField="EmailTitle" SortField="EmailTitle" FieldType="String"
|
||||
HeaderTextAlign="Center" TextAlign="Left" HeaderText="邮件标题">
|
||||
HeaderTextAlign="Left" TextAlign="Left" HeaderText="邮件标题">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="400px" ColumnID="EailTiaoJian" DataField="EailTiaoJian" SortField="EailTiaoJian"
|
||||
HeaderTextAlign="Center" TextAlign="Left" FieldType="String" HeaderText="发送条件">
|
||||
HeaderTextAlign="Left" TextAlign="Left" FieldType="String" HeaderText="发送条件">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField Width="500px" ColumnID="EmailContext" DataField="EmailContext" SortField="EmailContext" FieldType="String"
|
||||
HeaderTextAlign="Center" TextAlign="Left" HeaderText="邮件内容">
|
||||
HeaderTextAlign="Left" TextAlign="Left" HeaderText="邮件内容">
|
||||
</f:RenderField>
|
||||
|
||||
<%-- <f:RenderField Width="120px" ColumnID="EmailDesc" DataField="EmailDesc" SortField="EmailDesc"
|
||||
HeaderTextAlign="Center" TextAlign="Left" FieldType="String" HeaderText="EmailDesc" ExpandUnusedSpace="true">
|
||||
HeaderTextAlign="Left" TextAlign="Left" FieldType="String" HeaderText="EmailDesc" ExpandUnusedSpace="true">
|
||||
</f:RenderField>--%>
|
||||
|
||||
<f:RenderField Width="100px" ColumnID="CreateTime" DataField="CreateTime" SortField="CreateTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="CreateTime"
|
||||
HeaderTextAlign="Center" TextAlign="Center" EnableFilter="true">
|
||||
HeaderTextAlign="Left" TextAlign="Center" EnableFilter="true">
|
||||
<Filter EnableMultiFilter="true" ShowMatcher="true">
|
||||
<Operator>
|
||||
<f:DropDownList ID="DropDownList4" runat="server">
|
||||
|
@ -107,7 +107,7 @@
|
|||
Icon="BulletEdit" runat="server" Text="Modify" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Icon="Delete" ConfirmText="Delete selected row?" ConfirmTarget="Top" runat="server" Text="Delete" Hidden="true">
|
||||
Icon="Delete" ConfirmText="确定要删除此数据项?" ConfirmTarget="Top" runat="server" Text="Delete" Hidden="true">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInParent("Please select at least one record!");
|
||||
Alert.ShowInParent("请选择至少一条记录!");
|
||||
return;
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
|
@ -124,7 +124,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
|
||||
BLL.Email_Send.Email_SendTemplateService.Delete(rowID);
|
||||
ShowNotify("Deleted successfully!");
|
||||
ShowNotify("成功删除!");
|
||||
|
||||
}
|
||||
BindGrid();
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
<f:Toolbar runat="server" ID="Toolbar1" Position="Bottom">
|
||||
<Items>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="Email" runat="server" CssClass="marginr" Text="Send"
|
||||
<f:Button ID="btnSave" Icon="Email" runat="server" CssClass="marginr" Text="点击发送"
|
||||
ValidateForms="SimpleForm1" OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
|
|
@ -110,6 +110,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
Email_Pop pop = new Email_Pop();
|
||||
pop = MailHelper.getEmailPop("7EC5E991-B7A0-495A-90ED-2BE15370C959");
|
||||
|
||||
|
||||
string mailFrom = pop.EmailYx;
|
||||
|
||||
string[] mailTo = null;
|
||||
|
@ -129,6 +130,11 @@ namespace FineUIPro.Web.Email_Send
|
|||
namelist.Add(tn.CommandName);
|
||||
}
|
||||
}
|
||||
if (namelist.Count == 0)
|
||||
{
|
||||
ShowNotify("请至少选择一项用户进行发送!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
mailTo = namelist.ToList().ToArray();
|
||||
mailSubject = this.txtSendTitle.Text.Trim();
|
||||
|
||||
|
|
|
@ -7,10 +7,13 @@
|
|||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TwinTriggerBox Width="300px" runat="server" EmptyText="Find in username" ShowLabel="false" ID="ttbSearch"
|
||||
|
||||
<f:DropDownList Width="300px" runat="server" OnSelectedIndexChanged="drpSearch_SelectedIndexChanged" EmptyText="请选择单位" EnableAjax="true" AutoPostBack="true" ShowLabel="false" ID="drpSearch">
|
||||
</f:DropDownList>
|
||||
<f:TwinTriggerBox Width="300px" runat="server" EmptyText="根据姓名/单位查询" ShowLabel="false" ID="ttbSearch"
|
||||
ShowTrigger1="false" OnTrigger1Click="ttbSearch_Trigger1Click" OnTrigger2Click="ttbSearch_Trigger2Click"
|
||||
Trigger1Icon="Clear" Trigger2Icon="Search">
|
||||
</f:TwinTriggerBox>
|
||||
</f:TwinTriggerBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
|
@ -24,10 +27,11 @@
|
|||
OnSort="Grid1_Sort">
|
||||
<Columns>
|
||||
<f:RowNumberField />
|
||||
<f:BoundField Width="200px" DataField="UserName" SortField="UserName" DataFormatString="{0}"
|
||||
HeaderText="姓名" />
|
||||
<f:BoundField Width="200px" SortField="Email" DataField="Email" HeaderText="Email" />
|
||||
<f:BoundField Width="260px" HeaderText="单位名称" DataField="UnitName" SortField="UnitName" DataFormatString="{0}"></f:BoundField>
|
||||
<f:BoundField DataField="UserName" SortField="UserName"
|
||||
HeaderText="姓名" />
|
||||
<f:BoundField Width="200px" SortField="Email" DataField="Email" HeaderText="Email" />
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</f:Panel>
|
||||
|
|
|
@ -17,7 +17,8 @@ namespace FineUIPro.Web.Email_Send
|
|||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
BindGrid();
|
||||
BindGrid("");
|
||||
DataBindDrpUnit();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,13 +28,13 @@ namespace FineUIPro.Web.Email_Send
|
|||
#region BindGrid
|
||||
|
||||
|
||||
private void BindGrid()
|
||||
private void BindGrid(string selectUnitId)
|
||||
{
|
||||
// 1.设置总项数(特别注意:数据库分页一定要设置总记录数RecordCount)
|
||||
Grid1.RecordCount = GetTotalCount();
|
||||
Grid1.RecordCount = GetTotalCount(selectUnitId);
|
||||
|
||||
// 2.获取当前分页数据
|
||||
DataTable table = GetPagedDataTable();
|
||||
DataTable table = GetPagedDataTable(selectUnitId);
|
||||
|
||||
// 3.绑定到Grid
|
||||
Grid1.DataSource = table;
|
||||
|
@ -44,21 +45,30 @@ namespace FineUIPro.Web.Email_Send
|
|||
/// 模拟返回总项数
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private int GetTotalCount()
|
||||
private int GetTotalCount(string selectUnitId)
|
||||
{
|
||||
return GetSource().Rows.Count;
|
||||
return GetSource(selectUnitId).Rows.Count;
|
||||
}
|
||||
|
||||
private void DataBindDrpUnit()
|
||||
{
|
||||
var data = Funs.DB.Base_Unit.ToList();
|
||||
drpSearch.DataSource = data;
|
||||
drpSearch.DataTextField = "UnitName";
|
||||
drpSearch.DataValueField = "UnitId";
|
||||
drpSearch.DataBind();
|
||||
drpSearch.Items.Insert(0,new ListItem("请选择单位",""));
|
||||
}
|
||||
/// <summary>
|
||||
/// 模拟数据库分页(实际项目中请直接使用SQL语句返回分页数据!)
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private DataTable GetPagedDataTable()
|
||||
private DataTable GetPagedDataTable(string selectUnitId)
|
||||
{
|
||||
int pageIndex = Grid1.PageIndex;
|
||||
int pageSize = Grid1.PageSize;
|
||||
|
||||
DataTable table = GetSource();
|
||||
DataTable table = GetSource(selectUnitId);
|
||||
|
||||
DataTable paged = table.Clone();
|
||||
int rowbegin = pageIndex * pageSize;
|
||||
|
@ -74,30 +84,36 @@ namespace FineUIPro.Web.Email_Send
|
|||
|
||||
return paged;
|
||||
}
|
||||
|
||||
private DataTable GetSource()
|
||||
protected void drpSearch_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
string rowId = this.drpSearch.SelectedValue;
|
||||
this.BindGrid(rowId);
|
||||
}
|
||||
private DataTable GetSource(string selectUnitId)
|
||||
{
|
||||
string sortField = Grid1.SortField;
|
||||
string sortDirection = Grid1.SortDirection;
|
||||
|
||||
string strSql = @"select UserId,UserName,Email from Sys_User where 1=1";
|
||||
string strSql = @"select a.UserId,b.UnitId,b.UserName,c.UnitName from Project_User as a inner join Sys_User as b on a.UserId=b.UserId
|
||||
inner join Base_Unit as c on b.UnitId=c.UnitId where b.IsPost=1 order by c.UnitName ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable table2 = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
|
||||
DataView view2 = table2.DefaultView;
|
||||
view2.Sort = String.Format("{0} {1}", sortField, sortDirection);
|
||||
|
||||
|
||||
List<string> filters = new List<string>();
|
||||
|
||||
string searchKeyword = ttbSearch.Text.Trim();
|
||||
if (!String.IsNullOrEmpty(searchKeyword) && ttbSearch.ShowTrigger1)
|
||||
{
|
||||
// RowFilter的用法:http://www.csharp-examples.net/dataview-rowfilter/
|
||||
filters.Add(String.Format("UserName LIKE '*{0}*'", EscapeLikeValue(searchKeyword)));
|
||||
filters.Add(String.Format("(UnitName LIKE '*{0}*' or UserName like '*{0}*')", EscapeLikeValue(searchKeyword)));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(selectUnitId))
|
||||
{
|
||||
filters.Add(string.Format(" UnitId='{0}'", selectUnitId));
|
||||
}
|
||||
|
||||
|
||||
if (filters.Count > 0)
|
||||
{
|
||||
|
@ -137,7 +153,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
{
|
||||
//Grid1.PageIndex = e.NewPageIndex;
|
||||
|
||||
BindGrid();
|
||||
BindGrid(string.Empty); ;
|
||||
}
|
||||
|
||||
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||
|
@ -145,7 +161,7 @@ namespace FineUIPro.Web.Email_Send
|
|||
//Grid1.SortDirection = e.SortDirection;
|
||||
//Grid1.SortField = e.SortField;
|
||||
|
||||
BindGrid();
|
||||
BindGrid(string.Empty);
|
||||
}
|
||||
|
||||
|
||||
|
@ -154,14 +170,14 @@ namespace FineUIPro.Web.Email_Send
|
|||
ttbSearch.Text = String.Empty;
|
||||
ttbSearch.ShowTrigger1 = false;
|
||||
|
||||
BindGrid();
|
||||
BindGrid(string.Empty);
|
||||
}
|
||||
|
||||
protected void ttbSearch_Trigger2Click(object sender, EventArgs e)
|
||||
{
|
||||
ttbSearch.ShowTrigger1 = true;
|
||||
|
||||
BindGrid();
|
||||
BindGrid(string.Empty);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,11 +7,13 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.Email_Send {
|
||||
|
||||
|
||||
public partial class SelectUserControl {
|
||||
|
||||
namespace FineUIPro.Web.Email_Send
|
||||
{
|
||||
|
||||
|
||||
public partial class SelectUserControl
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Panel7 控件。
|
||||
/// </summary>
|
||||
|
@ -20,7 +22,7 @@ namespace FineUIPro.Web.Email_Send {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel7;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Form5 控件。
|
||||
/// </summary>
|
||||
|
@ -29,7 +31,16 @@ namespace FineUIPro.Web.Email_Send {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form Form5;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// drpSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpSearch;
|
||||
|
||||
/// <summary>
|
||||
/// ttbSearch 控件。
|
||||
/// </summary>
|
||||
|
@ -38,7 +49,7 @@ namespace FineUIPro.Web.Email_Send {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TwinTriggerBox ttbSearch;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
|
|
Loading…
Reference in New Issue