protected string GetHtml(string Style) { StringBuilder bodyText = new StringBuilder(); string DateStamp = DateTime.Now.ToString("yyyyMMdd"); bodyText.Append("活动概况:" + "\r\n" + Style + Style); bodyText.Append("活动描述:参与活动上传生成二次元照,先中奖后上传小票" + "\r\n" + Style); bodyText.Append("活动时间:2017年6月28日-2017年7月25日" + "\r\n" + Style); bodyText.Append("活动参与情况:截止" + DateTime.Now.ToShortDateString() + " 23:59:59 \r\n"); bodyText.Append("今日参与活动:" + GetCount(0, "") + "\r\n" + Style); bodyText.Append("今日通过审核:" + GetCount(0, " and States=1") + "\r\n" + Style); bodyText.Append("昨日参与活动:" + GetCount(1, "") + "\r\n" + Style); bodyText.Append("昨日通过审核:" + GetCount(1, " and States=1") + "\r\n" + Style); bodyText.Append("总参与:" + GetCount(2, "") + "\r\n" + Style); bodyText.Append("总审核通过:" + GetCount(2, " and States=1") + "\r\n" + Style); List <Model.AwardsStatisticsModel> list = new Db.AwardsStatisticsDal().GetModelTopList(3, " and AwardsType=1 and (id=1 or id=2 or id=7)"); foreach (Model.AwardsStatisticsModel model in list) { bodyText.Append(model.AwardsName + "发放总数:" + model.AllTotal + ",今日" + model.AwardsName + "发放数:" + model.TodayTotal + ",昨日" + model.AwardsName + "发放数:" + model.YesterdayTotal + "\r\n" + Style); } bodyText.Append("\r\n \r\n " + Style + Style); #region 参与总数排名 DataTable IpRepeaterList = orderDal.GetGroupByTypeList(5, "Ip"); for (int i = 0; i < IpRepeaterList.Rows.Count; i++) { bodyText.Append("Ip参与总数排名:" + IpRepeaterList.Rows[i]["Ip"] + " 总数:" + IpRepeaterList.Rows[i]["Total"] + "\r\n" + Style); } bodyText.Append("\r\n " + Style); DataTable MobRepeaterList = orderDal.GetGroupByTypeList(5, "Mob"); for (int i = 0; i < MobRepeaterList.Rows.Count; i++) { bodyText.Append("手机号参与总数排名:" + MobRepeaterList.Rows[i]["Mob"] + " 总数:" + MobRepeaterList.Rows[i]["Total"] + "\r\n" + Style); } bodyText.Append("\r\n" + Style); DataTable OpenIdRepeaterList = orderDal.GetGroupByTypeList(5, "OpenId"); for (int i = 0; i < OpenIdRepeaterList.Rows.Count; i++) { bodyText.Append("OpenId参与总数排名:" + OpenIdRepeaterList.Rows[i]["OpenId"] + " 总数:" + OpenIdRepeaterList.Rows[i]["Total"] + "\r\n" + Style); } #endregion bodyText.Append("\r\n \r\n " + Style + Style); bodyText.Append("项目体检结果: " + WebFramework.OrderService.OrderMethod.OrderInstance.ObjectPhysical()); return(bodyText.ToString()); }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { //上传小票项目 如有作废原因 cancelReason = "[\"作废原因1\",\"作废原因2\"]"; //云审核的作废按钮点击会调用vm.MessageBox('Fail', config.orderid, Num, Reason); num:数组序号 Reason:作废原因 #region 获取奖项 Db.AwardsStatisticsDal AwardDal = new Db.AwardsStatisticsDal(); DataTable AwardList = AwardDal.GetByColumnList("AwardsName as value,AwardsName as label", " and AwardsType=1 and len(PrizeName)>0"); AwardsOptions = Common.JsonHelper.DataTableToJson(AwardList); #endregion } orderQty = dal.CheckCount(" "); orderQty1 = dal.CheckCount(" and States=1"); //已完成 orderQty2 = dal.CheckCount(" and States=-1"); //作废 orderQty0 = dal.CheckCount(" and States=0"); //待审核 }
public Model.ReturnValue Recovery() { int id = Common.TypeHelper.ObjectToInt(Request["OrderId"], 0); model = OrderDal.GetModel(id); if (model.Id <= 0) { returnValue.ErrMessage = "订单不存在"; returnValue.Success = false; return(returnValue); } if (UserSession.GroupId != 2) { returnValue.Success = false; returnValue.ErrMessage = "请联系管理员执行此操作"; return(returnValue); } if (model.States != -1) { returnValue.Success = false; returnValue.ErrMessage = "订单未作废无法恢复"; return(returnValue); } model.States = 0; model.UpdateTime = DateTime.Now; mdlog.Status = model.States; mdlog.OperationType = "恢复订单状态"; mdlog.OrderCode = model.OrderCode; mdlog.Mobile = model.Mob; int i = 0; if (IsBack) { #region Check中奖数是否已满 List <Model.AwardsStatisticsModel> AwardsList = new Db.AwardsStatisticsDal().GetModelList().Where(w => (w.AwardsId == model.AwardId && w.AwardsType == 1) || (w.AwardsId == model.RedAwardId && w.AwardsType == 2)).ToList(); if (AwardsList.Count == 0) { returnValue.Success = false; returnValue.ErrMessage = "系统错误,请联系管理员"; return(returnValue); } foreach (var AwardsModel in AwardsList) { string sqlwhere = ""; if (AwardsModel.AwardsType == 1) { sqlwhere = string.Format(" and AwardId={0} and IsBack=0", model.AwardId); } if (AwardsModel.AwardsType == 2) { sqlwhere = string.Format(" and RedAwardId={0} and IsBack=0", model.RedAwardId); } if (OrderDal.CheckCount(sqlwhere) >= GetPrizeCount(AwardsModel.AwardsType, AwardsModel.AwardsName)) { returnValue.Success = false; returnValue.ErrMessage = "奖项总数已达上限,无法恢复订单"; return(returnValue); } } #endregion i = OrderDal.Recovery(model, mdlog); } else { i = OrderDal.EditOrder(model, mdlog); } if (i > 0) { returnValue.Success = true; return(returnValue); } returnValue.Success = false; returnValue.ErrMessage = "修改失败"; return(returnValue); }