public ActionResult PraiseScheduleList(DataPage dp) { List <PraiseSchedule> lists = new List <PraiseSchedule>(); if (Request["btnExportExcel"] == null)//导出Excel { lists = _adminBLL.PraiseScheduleGetList(ref dp); GetDataPage(dp); } else { dp.PageSize = 0; lists = _adminBLL.PraiseScheduleGetList(ref dp); string fileName = "nothing"; if (lists.Count() > 0) { fileName = "PraiseScheduleList" + lists.Count() + "_Item"; } Dictionary <string, Func <PraiseSchedule, string> > showFields = new Dictionary <string, Func <PraiseSchedule, string> >(); showFields.Add(PraiseSchedule.IDField, z => "'" + z.ID.ToString()); showFields.Add(PraiseSchedule.StartTSField, z => "'" + z.StartTS.ToString()); showFields.Add(PraiseSchedule.EndTSField, z => "'" + z.EndTS.ToString()); showFields.Add(PraiseSchedule.StatusField, z => "'" + z.Status.ToString()); showFields.Add(PraiseSchedule.MinField, z => "'" + z.Min.ToString()); showFields.Add(PraiseSchedule.MaxField, z => "'" + z.Max.ToString()); showFields.Add(PraiseSchedule.WeaponIDField, z => "'" + z.WeaponID.ToString()); showFields.Add(PraiseSchedule.RandNumField, z => "'" + z.RandNum.ToString()); ObjectUtil.Common.ExcelHelper2 <PraiseSchedule> elh = new ObjectUtil.Common.ExcelHelper2 <PraiseSchedule>(lists, null, showFields); elh.FileWebSaveAs(Response, fileName); } return(View(lists)); }
/// <summary> /// 列表 /// </summary> /// <param name="searchSort">用来搜索的实例</param> /// <returns></returns> public ActionResult PraiseLogList(DataPage dp, PraiseLog model) { List <PraiseLog> lists = new List <PraiseLog>(); if (Request["btnExportExcel"] == null)//导出Excel { lists = _adminBLL.GetPraiseLogList(ref dp, model); GetDataPage(dp); } else { dp.PageSize = 0; lists = _adminBLL.GetPraiseLogList(ref dp, model); string fileName = "nothing"; if (lists.Count() > 0) { fileName = "PraiseLogList" + lists.Count() + "_Item"; } Dictionary <string, Func <PraiseLog, string> > showFields = new Dictionary <string, Func <PraiseLog, string> >(); showFields.Add(PraiseLog.WeaponIDField, z => "'" + z.WeaponID.ToString()); showFields.Add(PraiseLog.PraiseNumberField, z => "'" + z.PraiseNumber.ToString()); showFields.Add(PraiseLog.PraiseIPField, z => "'" + z.PraiseIP.ToString()); showFields.Add(PraiseLog.CreateTSField, z => "'" + z.CreateTS.ToString()); showFields.Add(PraiseLog.SourceField, z => "'" + z.Source.ToString()); showFields.Add(PraiseLog.UserIDField, z => "'" + z.UserID.ToString()); showFields.Add(PraiseLog.AreaNameField, z => "'" + z.AreaName.ToString()); showFields.Add(PraiseLog.AvatarIDField, z => "'" + z.AvatarID.ToString()); ObjectUtil.Common.ExcelHelper2 <PraiseLog> elh = new ObjectUtil.Common.ExcelHelper2 <PraiseLog>(lists, null, showFields); elh.FileWebSaveAs(Response, fileName); } //记录日志 Log(string.Format("查看[PraiseLog]列表页面 搜索数据:{0}", model.ToString())); return(View(lists)); }
/// <summary> /// 列表 /// </summary> /// <param name="searchSort">用来搜索的实例</param> /// <returns></returns> public ActionResult WeaponAllUserList(CommonLibs.Common.DataPage dp, WeaponUserList model, int?AreaID) { ViewBag.AreaID = GetGameAreaList(); ViewBag.StatusID = GetWeaponStatusList(); model.AreaID = AreaID ?? -1; List <WeaponUserList> lists = new List <WeaponUserList>(); if (Request["btnExportExcel"] == null)//导出Excel { lists = _adminBLL.GetWeaponAllUserList(ref dp, model); GetDataPage(dp); } else { dp.PageSize = 0; lists = _adminBLL.GetWeaponAllUserList(ref dp, model); string fileName = "nothing"; if (lists.Count() > 0) { fileName = "WeaponAllUserList" + lists.Count() + "_Item"; } Dictionary <string, Func <WeaponUserList, string> > showFields = new Dictionary <string, Func <WeaponUserList, string> >(); showFields.Add(WeaponUserList.WeaponIDField, z => "'" + z.WeaponID.ToString()); showFields.Add(WeaponUserList.WeaponNameField, z => "'" + z.WeaponName.ToString()); showFields.Add(WeaponUserList.WeaTypeField, z => "'" + z.WeaType.ToString()); showFields.Add(WeaponUserList.WeaponDescField, z => "'" + z.WeaponDesc.ToString()); showFields.Add(WeaponUserList.UserIDField, z => "'" + z.UserID.ToString()); showFields.Add(WeaponUserList.LoginNameField, z => "'" + z.LoginName.ToString()); showFields.Add(WeaponUserList.AreaNameField, z => "'" + z.AreaName.ToString()); showFields.Add(WeaponUserList.AvatarNameField, z => "'" + z.AvatarName.ToString()); showFields.Add(WeaponUserList.ShowPraiseField, z => "'" + z.ShowPraise.ToString()); showFields.Add(WeaponUserList.CreateTSField, z => "'" + z.CreateTS.ToString()); showFields.Add(WeaponUserList.UpdateTSField, z => "'" + z.UpdateTS.ToString()); showFields.Add(WeaponUserList.StatusTypeField, z => "'" + z.StatusType.ToString()); showFields.Add(WeaponUserList.ReasonField, z => "'" + z.Reason.ToString()); showFields.Add(WeaponUserList.FirstNameField, z => "'" + z.FirstName.ToString()); showFields.Add(WeaponUserList.GenderField, z => "'" + z.Gender.ToString()); showFields.Add(WeaponUserList.ContactMethodField, z => "'" + z.ContactMethod.ToString()); ObjectUtil.Common.ExcelHelper2 <WeaponUserList> elh = new ObjectUtil.Common.ExcelHelper2 <WeaponUserList>(lists, null, showFields); elh.FileWebSaveAs(Response, fileName); } //记录日志 Log(string.Format("查看[WeaponUserList]列表页面 搜索数据:{0}", model.ToString())); return(View(lists)); }
//public ActionResult CommentsListList(DataPage dp, int wid) //{ // ViewBag.WeaponID = wid; // ViewBag.AreaID = GetGameAreaList(); // CommentsList model = new CommentsList(); // model.WeaponID = wid; // List<CommentsList> lists = new List<CommentsList>(); // lists = _adminBLL.GetCommentsListList(ref dp, model); // GetDataPage(dp); // //记录日志 // Log(string.Format("查看[CommentsList]列表页面 搜索数据:{0}", model.ToString())); // return View(lists); //} /// <summary> /// 列表 /// </summary> /// <param name="searchSort">用来搜索的实例</param> /// <returns></returns> public ActionResult CommentsListList(DataPage dp, CommentsList model, int?AreaID) { ViewBag.AreaID = GetGameAreaList(); ViewBag.WeaponID = model.WeaponID; model.AreaID = AreaID ?? -1; List <CommentsList> lists = new List <CommentsList>(); if (Request["btnExportExcel"] == null)//导出Excel { CommentsList model1 = new CommentsList(); model1.WeaponID = model.WeaponID; lists = _adminBLL.GetCommentsListList(ref dp, model); GetDataPage(dp); } else { dp.PageSize = 0; lists = _adminBLL.GetCommentsListList(ref dp, model); string fileName = "nothing"; if (lists.Count() > 0) { fileName = "CommentsListList" + lists.Count() + "_Item"; } Dictionary <string, Func <CommentsList, string> > showFields = new Dictionary <string, Func <CommentsList, string> >(); showFields.Add(CommentsList.IDField, z => "'" + z.ID.ToString()); showFields.Add(CommentsList.WeaponIDField, z => "'" + z.WeaponID.ToString()); showFields.Add(CommentsList.CommentsField, z => "'" + z.Comments.ToString()); showFields.Add(CommentsList.CreateTSField, z => "'" + z.CreateTS.ToString()); showFields.Add(CommentsList.UserIDField, z => "'" + z.UserID.ToString()); showFields.Add(CommentsList.AreaNameField, z => "'" + z.AreaName.ToString()); showFields.Add(CommentsList.LoginNameField, z => "'" + z.LoginName.ToString()); showFields.Add(CommentsList.AvatarNameField, z => "'" + z.AvatarName.ToString()); ObjectUtil.Common.ExcelHelper2 <CommentsList> elh = new ObjectUtil.Common.ExcelHelper2 <CommentsList>(lists, null, showFields); elh.FileWebSaveAs(Response, fileName); } //记录日志 Log(string.Format("查看[CommentsList]列表页面 搜索数据:{0}", model.ToString())); return(View(lists)); }