-
Notifications
You must be signed in to change notification settings - Fork 0
/
product.aspx.cs
92 lines (73 loc) · 2.56 KB
/
product.aspx.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using unity;
using System.Collections.Specialized;
using System.Text.RegularExpressions;
using System.Web.Routing;
public partial class product : System.Web.UI.Page
{
public Unitlib.MainData s = new Unitlib.MainData();
public string shippingKind = "";
public int ship_price = 0;
public int p_id = 0;
public int price = 0;
public int amount = 0;
public int freeship = 0;
public string productname = "";
public string description = "";
public string pic = "";
public string packageid = "";
public string DESCRIPTION = "";
public string HOWTOUSE = "";
public string ReMark = "";
public string Refunds = "";
protected void Page_Load(object sender, EventArgs e)
{
packageid = Request["packageid"];
Route myRoute = RouteData.Route as Route;
if (myRoute != null)
{
packageid = RouteData.Values["id"].ToString();
}
if ( packageid == null || packageid == "")
{
Response.Write("<script>alert('資料有誤');</script>");
Response.End();
}
List< productController.Package> gd = new List<productController.Package>();
productController.Package pd = new productController.Package();
pd.Packageid = int.Parse (packageid);
gd = productController.GetPackageList(pd);
string pic = "";
foreach (var g in gd)
{
if (g.Status != "Y")
{
Response.Write("<script>alert('此商品並無販售');history.back();</script>");
Response.End();
}
productname = g.Packagename;
description = g.Description;
ship_price = g.Shippingfee;
shippingKind = g.ShippingKind;
DESCRIPTION = g.Description;
freeship = g.Freeship;
Repeater1.DataSource = g.PackageItem ;
Repeater1.DataBind();
pic = g.PackageItem[0].Pic;
ReMark = g.ReMark;
Refunds = g.Refunds;
}
Session["title"] = productname + "│" + Application["site_name"];
Session["image"] = Session["websiteurl"] + pic;
Session["description"] = unity.classlib.noHTML(description);
Session["keywords"] = productname;
s = Unitlib.Get_UnitData(37, "");
}
}