-
Notifications
You must be signed in to change notification settings - Fork 0
/
EditProducts.ascx.vb
executable file
·115 lines (75 loc) · 3.65 KB
/
EditProducts.ascx.vb
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
Imports DotNetNuke.Common
Imports DotNetNuke.Common.Utilities
Imports DotNetNuke.Services.Exceptions
Imports DotNetNuke.Services.Localization
Imports Ventrian.FeedbackCenter.Entities
Namespace Ventrian.FeedbackCenter
Partial Public Class EditProducts
Inherits FeedbackCenterBase
#Region " Private Methods "
Private Sub BindProducts()
Dim objProductController As New ProductController
lstChildCategories.DataSource = objProductController.List(ModuleId, False, Convert.ToInt32(drpParentCategory.SelectedValue))
lstChildCategories.DataBind()
If (lstChildCategories.Items.Count = 0) Then
pnlSortOrder.Visible = False
lblNoCategories.Visible = True
Else
pnlSortOrder.Visible = True
lblNoCategories.Visible = False
End If
End Sub
Private Sub BindParentCategories()
Dim objProductController As New ProductController
drpParentCategory.DataSource = objProductController.ListAll(ModuleId)
drpParentCategory.DataBind()
drpParentCategory.Items.Insert(0, New ListItem(Localization.GetString("NoParentProduct", Me.LocalResourceFile), "-1"))
End Sub
#End Region
#Region " Event Handlers "
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Try
If (IsPostBack = False) Then
BindParentCategories()
BindProducts()
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Private Sub cmdAddNewCategory_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdAddNewProduct.Click
Try
If (drpParentCategory.SelectedValue <> "-1") Then
Response.Redirect(EditUrl("ParentID", drpParentCategory.SelectedValue, "EditProduct"), True)
Else
Response.Redirect(EditUrl("EditProduct"), True)
End If
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Protected Sub drpParentCategory_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs) Handles drpParentCategory.SelectedIndexChanged
Try
BindProducts()
Catch exc As Exception 'Module failed to load
ProcessModuleLoadException(Me, exc)
End Try
End Sub
Protected Sub cmdEdit_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles cmdEdit.Click
If (lstChildCategories.Items.Count > 0) Then
If Not (lstChildCategories.SelectedItem Is Nothing) Then
Response.Redirect(EditUrl("ProductID", lstChildCategories.SelectedValue, "EditProduct"), True)
End If
End If
End Sub
Protected Sub cmdView_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles cmdView.Click
If (lstChildCategories.Items.Count > 0) Then
If Not (lstChildCategories.SelectedItem Is Nothing) Then
Response.Redirect(NavigateURl(), True)
' (Convert.ToInt32(lstChildCategories.SelectedValue))
End If
End If
End Sub
#End Region
End Class
End Namespace