/// <summary> /// 优惠券回滚 /// </summary> /// <param name="orderId"></param> public void couponUnUse(string orderId) { LVWEIBA.DAL.MemberCoupon DalCoupon = new LVWEIBA.DAL.MemberCoupon(); LVWEIBA.Model.MemberCoupon couponModel = DalCoupon.GetModel(" Order_Id='" + orderId + "'"); //是否使用了优惠券 if (couponModel != null) { couponModel.Order_Id = ""; couponModel.ZT = "0"; DalCoupon.Update(couponModel); } }
private void OnQuery() { var bllCoupon = new LVWEIBA.DAL.MemberCoupon(); printLog("openid is" + openid); DataTable list = bllCoupon.GetMemberCouponList(" openid='" + openid + "'").Tables[0]; StringBuilder strYsy = new StringBuilder(); StringBuilder strWsy = new StringBuilder(); string yhq = ""; printLog(list.Rows.Count.ToString()); foreach (DataRow dr in list.Rows) { printLog(DateTime.Parse(dr["Timeout"].ToString()).ToString("yyyy - MM - dd") + " " + dr["OrderCount"].ToString() + " " + dr["Price"].ToString() + " " + dr["zt"].ToString()); yhq = string.Format(@" <div class='stamp'> <div class='divLeft'> <span class='divYhq'>优惠券</span><br /> <span class='divYxq'>有效期至{0}</span> <table class='tabMj'> <tr> <td> 满{1}元使用 </td> </tr> <tr> <td> 单次消费使用一张 </td> </tr> </table> </div> <div class='divRight'> ¥<font class='divMoney'>{2}</font></div> </div>", DateTime.Parse(dr["Timeout"].ToString()).ToString("yyyy-MM-dd"), dr["OrderCount"], dr["Price"]); if (dr["zt"].ToString().Equals("0")) { strWsy.Append(yhq); } else { strYsy.Append(yhq); } } this.lit_wsy.Text = strWsy.ToString(); this.lit_ysy.Text = strYsy.ToString(); }