📄 showdownload.aspx.cs
字号:
namespace PowerEasy.WebSite.User.Shop
{
using PowerEasy.Components;
using PowerEasy.Controls;
using PowerEasy.Enumerations;
using PowerEasy.Model.Shop;
using PowerEasy.Shop;
using PowerEasy.Web.UI;
using PowerEasy.WebSite.Controls;
using System;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
public class ShowDownload : DynamicPage
{
protected HtmlForm form1;
protected HyperLink HlnkDownUrl;
protected Label LblAmount;
protected Label LblBeginDate;
protected Label LblProductName;
protected Label LblRemark;
protected Label LblServiceTerm;
protected Label LblTimeOut;
protected UserNavigation UserCenterNavigation;
protected ExtendedSiteMapPath YourPosition;
protected void Page_Load(object sender, EventArgs e)
{
if (!this.Page.IsPostBack)
{
int orderItemId = BasePage.RequestInt32("ItemId");
UserOrderCommonInfo downloadInfo = Order.GetDownloadInfo(PEContext.Current.User.UserName, orderItemId);
if (downloadInfo.IsNull)
{
DynamicPage.WriteErrMsg("<li>对应的软件已经停止下载</li>");
}
this.LblProductName.Text = downloadInfo.ProductName;
this.LblAmount.Text = downloadInfo.Amount.ToString() + downloadInfo.Unit;
this.LblBeginDate.Text = downloadInfo.BeginDate.ToString("yyyy-MM-dd");
bool flag = true;
if (downloadInfo.ServiceTerm <= 0)
{
this.LblServiceTerm.Text = "无";
}
else
{
DateTime time;
this.LblServiceTerm.Text = downloadInfo.ServiceTerm.ToString() + BasePage.EnumToHtml<ServiceTermUnit>(downloadInfo.ServiceTermUnit);
switch (downloadInfo.ServiceTermUnit)
{
case ServiceTermUnit.Year:
time = downloadInfo.BeginDate.AddYears(downloadInfo.ServiceTerm);
break;
case ServiceTermUnit.Month:
time = downloadInfo.BeginDate.AddMonths(downloadInfo.ServiceTerm);
break;
case ServiceTermUnit.Day:
time = downloadInfo.BeginDate.AddDays((double) downloadInfo.ServiceTerm);
break;
default:
time = downloadInfo.BeginDate.AddDays((double) downloadInfo.ServiceTerm);
break;
}
if (time < DateTime.Today)
{
flag = false;
this.LblTimeOut.Text = "已到期";
}
}
if (flag)
{
this.HlnkDownUrl.NavigateUrl = downloadInfo.DownloadUrl;
this.HlnkDownUrl.Text = "点此下载";
}
else
{
this.HlnkDownUrl.Visible = false;
}
this.LblRemark.Text = downloadInfo.Remark;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -