private void ShowInfo(int id) { var model = bll.GetAppInfo(id); lblId.Text = model.Id.ToString(); this.txtwxName.Text = model.WxName; this.txtwxId.Text = model.WxId; this.txtweixinCode.Text = model.WxCode; this.txtImgUrl.Text = model.Headerpic; this.txtapiurl.Text = MyCommFun.getWebSite() + "/api/weixin/api.aspx?apiid=" + model.Id; this.txtwxToken.Text = model.WxToken; if (model.WStatus) { this.rblwStatus.SelectedValue = "0"; } this.txtAppId.Text = model.AppId; this.txtAppSecret.Text = model.AppSecret; // txtEndTime.Text = model.endDate.Value.ToString("yyyy-MM-dd"); lblEndDate.Text = model.EndDate.Value.ToString("yyyy-MM-dd"); lblAddDate.Text = model.CreateDate.ToString("yyyy-MM-dd"); lblEndDate.Font.Bold = true; if (model.EndDate < DateTime.Now) { //过期 lblEndDate.ForeColor = System.Drawing.Color.Red; lblEndDate.Text += "[已过期]"; } else if (model.EndDate <= DateTime.Now.AddDays(20)) { //快到期 TimeSpan ts = model.EndDate.Value - DateTime.Now; int sub = ts.Days; lblEndDate.ForeColor = System.Drawing.Color.Red; lblEndDate.Text += " [还有" + sub + "天到期]"; } else { } //代理商信息 if (agent != null) { lblremainMony.Text = agent.RemainMony.Value.ToString(); lblagentPrice.Text = agent.AgentPrice.Value.ToString(); } }
/// <summary> /// 选择某一个微信公众帐号,并且将其保存到session里 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { switch (e.CommandName) { case "toIndex": { int wid = int.Parse(e.CommandArgument.ToString()); var weixin = bll.GetAppInfo(wid); if (weixin.WStatus) { MessageBox.Show(this, "账号已被禁用,无法进入"); return; } if (weixin.EndDate != null) { if (weixin.EndDate < DateTime.Now) { MessageBox.Show(this, "账号已过期,无法进入"); return; } } Session["nowweixin"] = weixin; Utils.WriteCookie("nowweixinId", "WeiXinPF", e.CommandArgument.ToString()); Response.Write("<script>parent.location.href='../../../../index.aspx'</script>"); } break; } }
private void ShowInfo(int id) { var model = _appInfoService.GetAppInfo(id); this.Id = model.Id; this.txtwxName.Text = model.WxName; this.txtwxId.Text = model.WxId; this.txtweixinCode.Text = model.WxCode; this.txtImgUrl.Text = model.Headerpic; //this.txtapiurl.Text = model.apiurl; this.txtwxToken.Text = model.WxToken; this.txtAppId.Text = model.AppId; this.txtAppSecret.Text = model.AppSecret; txtapiurl.Text = MyCommFun.getWebSite() + "/api/weixin/api.aspx?apiid=" + model.Id; //todo: 改地址 this.txtEncodingAESKey.Text = model.ExtStr; rblweixintype.SelectedValue = model.WxType == null ? "3" : model.WxType.Value.ToString(); }