using FineUIPro; using FineUIPro.iWareWms; using iWareCommon.Common.Entity; using iWareCommon.Common.EnumType; using iWareLog.LOG.Service; using iWareWms.Code.Common.Entity; using iWareWms.Code.Excel.Service; using System; using System.Collections.Generic; namespace iWareWms.View.LOG.FailSentMessage { public partial class FailSentMessage : PageBase { protected override Grid GetGrid() { return FailSentMessageGrid; } protected override FineUIPro.DropDownList GetPageSizeDropDownList() { return ddlPageSize; } protected override List GetDataSource(int pageIndex, int pageSize, out string msg, out int totalNum, out int currentPage) { var message = FailSentMessageService.GetInstance().QueryByParam(new QueryParam { Search = new Dictionary { { "Url", tbUrl.Text.Trim() }, { "RequestStr", tbRequestStr.Text.Trim() }, { "ResMsg", tbResMsg.Text.Trim() } }, Geqd = new Dictionary { { "CreateTime", (DateTime)fromDate.SelectedDate } }, Ltd = new Dictionary { { "CreateTime", ((DateTime)toDate.SelectedDate).AddDays(1) } }, PageIndex = pageIndex, PageSize = pageSize }, out msg, out totalNum, out currentPage); var res = new List(); message.ForEach(x => res.Add(x)); return res; } protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var today = DateTime.Today; fromDate.SelectedDate = today.AddDays(-6); toDate.SelectedDate = today; Query(1); } } /// /// 改变Type显示信息 /// /// /// protected string GetYesOrNo(object obj) { return ((EYesOrNo)obj).ToString(); } protected override void GetPath(object userName) { string msg; var message = FailSentMessageService.GetInstance().QueryByParam(new QueryParam { Search = new Dictionary { { "Url", tbUrl.Text.Trim() }, { "RequestStr", tbRequestStr.Text.Trim() }, { "ResMsg", tbResMsg.Text.Trim() } }, Geqd = new Dictionary { { "CreateTime", (DateTime)fromDate.SelectedDate } }, Ltd = new Dictionary { { "CreateTime", ((DateTime)toDate.SelectedDate).AddDays(1) } }, }, out msg); var datas = new List(); message.ForEach(x => datas.Add(x)); var path = ExcelService.GetInstance().ToExcel(CacheEntity.WorkBookDict["发送失败的日志"], new Dictionary> { { "发送失败的日志", datas } }, out msg); Session["ExcelPath"] = path; } protected override Window GetWindow() { return Window2; } protected override FineUIPro.Timer GetTimer() { return timer1; } //protected override void GridRowCommand(object sender, GridCommandEventArgs e) //{ // base.GridRowCommand(sender, e); // if (e.CommandName == "ReSend") // { // string msg; // Alert.ShowInTop(FailSentMessageService.GetInstance().ReSend(Convert.ToInt32((GetGrid().DataKeys[e.RowIndex][0].ToString())), out msg) ? "重发成功" : msg); // Query(GetGrid().PageIndex + 1); // } //} } }