using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using CY.Model; using CY.Infrastructure.Common; using CY.BLL.EC; namespace CY.WebForm.Pages.front { //吴辉 //礼品详情 public partial class PrizesDetail : FrontBasePage { EC_PrizeInfoBLL bll_EC_PrizeInfoBLL = null; public string PrizeImg = ""; public int? keyid = 0; //初始化 public PrizesDetail() { bll_EC_PrizeInfoBLL = new EC_PrizeInfoBLL(); } //页面加载 protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { InitData(); } } //数据绑定 public void InitData() { EC_PrizeInfo m_EC_PrizeInfo = bll_EC_PrizeInfoBLL.getOnePrizeInfo(Request["keyid"].ToInt32()); if (m_EC_PrizeInfo == null || m_EC_PrizeInfo.IsUsed == false || m_EC_PrizeInfo.AllCount <= m_EC_PrizeInfo.ExchangedCount) { JavaScript.MessageBox("此礼品不存在或已下架", this); m_EC_PrizeInfo = new EC_PrizeInfo(); } else { keyid = m_EC_PrizeInfo.Keyid; int? nowCount = m_EC_PrizeInfo.AllCount - m_EC_PrizeInfo.ExchangedCount; this.spanTitleUrl.InnerText = m_EC_PrizeInfo.PrizeName; this.spanPrizeTitle.InnerText = m_EC_PrizeInfo.PrizeName; this.spanNum.InnerText = m_EC_PrizeInfo.Commoditycode; this.spanAddress.InnerText = m_EC_PrizeInfo.PrizeReciveAddress.Address; this.spanNeedScore.InnerText = m_EC_PrizeInfo.NeedIntegral.Value.ToString("0"); this.spanMyScore.InnerText = CurrentUser ==null ?"0": CurrentPayAccount.Score.Value.ToString("0"); this.spanNowQuality.InnerText = ((nowCount == null || nowCount<0)?0:nowCount).Value.ToString(); this.divPrizeContent.InnerText = " 礼品介绍:"+m_EC_PrizeInfo.Remark; PrizeImg = m_EC_PrizeInfo.FileId; } } } }