public ContentResult UploadPrizeInfo(int ID, string Phone, string Name, string Address) { try { if (string.IsNullOrWhiteSpace(Phone)) { return(Content("手机号不能为空")); } if (Phone.Length != 11) { return(Content("手机号有误")); } if (string.IsNullOrWhiteSpace(Name)) { return(Content("姓名不能为空")); } if (string.IsNullOrWhiteSpace(Address)) { return(Content("姓名不能为空")); } LotteryRecord rec = LotteryRecord.GetEntityByID(ID); rec.Phone = Phone; rec.Name = Name; rec.RecAddress = Address; rec.UpdateByID(); return(Content("ok")); } catch (Exception ex) { return(Content("提交出错,请联系客服!")); } }
// 找回奖品 public ContentResult RetrievePrizes(string SecurityCode) { string ResultStr = ""; try { WXUserInfo userInfo = new WXUserInfo(); string UserOpenId = ""; if (Session["openid"] != null) { UserOpenId = Session["openid"].ToString(); string ACCESS_TOKEN = Session["ACCESS_TOKEN"].ToString(); WXVariousApi VariousApi = new WXVariousApi(); userInfo = GetUserInfo(UserOpenId, ACCESS_TOKEN); } LotteryRecord lotteryRecord = LotteryRecord.GetRecByIntegralCode(SecurityCode); if (lotteryRecord != null && !lotteryRecord.IsNot) { if (lotteryRecord.UserOpenId == "12345" || lotteryRecord.UserOpenId == "") { lotteryRecord.UserOpenId = Session["openid"].ToString(); lotteryRecord.UserWxName = userInfo.nickname; lotteryRecord.UserWxImg = userInfo.headimgurl; int iRet = lotteryRecord.UpdateByID(); if (iRet > 0) { ResultStr = "ok"; } else { ResultStr = "找回奖品失败,请联系管理员!"; } } else { ResultStr = "此防伪码不参与奖品找回!"; } } else { ResultStr = "此防伪码没有中奖!"; } } catch (Exception ex) { ResultStr = "找回奖品异常!error:" + ex.Message; } return(Content(ResultStr)); }
public ActionResult GetVerify(int id) { LotteryRecord r = LotteryRecord.GetEntityByID(id); if (r != null) { r.States = "已发放"; r.ID = r.UpdateByID(); } else { return(Content("数据错误!!!")); } return(Content("ok")); }