温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:NetShopForge网上商店程序(VB)源码
当前文件路径:NetShopForge/Website/Admin/ContentEditor.aspx.vb

1Imports NetShopForge.Library.Ad 2
Partial Class Admin_ContentEditor 3
Inherits System.Web.UI.Page 4
Protected ContentName As String = "" 5
Protected ContentText As String = "" 6
7
8
9
Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSave.Click 10
Dim ad As New AdInfo 11
ad.AdText = txtAdText.Text 12
ad.DateExpire = dpExpire.SelectedDate 13
ad.IsValid = CBool(ddlIsValid.SelectedValue) 14
ad.PageName = hfPageName.Value 15
ad.Placement = CInt(hfPlacement.Value) 16
Dim adc As New AdController 17
If CInt(hfAdID.Value) = -1 Then 18
adc.AddAd(ad) 19
Else 20
ad.AdID = CInt(hfAdID.Value) 21
adc.UpdateAD(ad) 22
End If 23
24
25
End Sub 26
27
Protected Sub Page_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load 28
29
If (Not Page.IsPostBack) Then 30
hfAdID.Value = Request("adid") 31
hfPageName.Value = Request("pn") 32
hfPlacement.Value = Request("pl") 33
If CInt(hfAdID.Value) > -1 Then 34
35
Page.Title = String.Format("编辑广告-id:{0};pn:{1},pl;{2}", hfAdID.Value, hfPageName.Value, hfPlacement.Value) 36
Dim adc As New AdController 37
Dim ad As AdInfo = adc.GetAdInfo(CInt(hfAdID.Value)) 38
txtAdText.Text = ad.AdText 39
dpExpire.SelectedDate = ad.DateExpire 40
ddlIsValid.SelectedValue = CInt(ad.IsValid) 41
Else 42
Page.Title = String.Format("添加新的广告-pn:{0},pl;{1}", hfPageName.Value, hfPlacement.Value) 43
End If 44
End If 45
End Sub 46
End Class 47






