-
Notifications
You must be signed in to change notification settings - Fork 0
/
issues.aspx.vb
87 lines (80 loc) · 4.59 KB
/
issues.aspx.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
Partial Class issues
Inherits System.Web.UI.Page
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
SqlDataSource1.SelectParameters("ItemType").DefaultValue = DropDownList1.SelectedValue
End Sub
Protected Sub GridView1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GridView1.SelectedIndexChanged
SqlDataSource2.SelectParameters("varID").DefaultValue = GridView1.SelectedRow.Cells(1).Text
MultiView1.ActiveViewIndex = 1
End Sub
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Me.IsPostBack = False Then
MultiView1.ActiveViewIndex = 0
End If
End Sub
Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button2.Click
If User.Identity.IsAuthenticated = True Then
SqlDataSource2.InsertParameters("varSummary").DefaultValue = TextBox1.Text
SqlDataSource2.InsertParameters("varDescription").DefaultValue = TextBox2.Text
SqlDataSource2.InsertParameters("varUserName").DefaultValue = User.Identity.Name
SqlDataSource2.InsertParameters("varCategory").DefaultValue = Label2.Text
SqlDataSource2.InsertParameters("varParent").DefaultValue = Label1.Text
If FileUpload1.HasFile Then
Dim extension As String = System.IO.Path.GetExtension(FileUpload1.FileName).ToLower
If extension = ".jpg" Then
'Uncomment this line to Save the uploaded file
FileUpload1.SaveAs("D:\vhosts\\httpdocs\img\" & FileUpload1.FileName)
SqlDataSource2.InsertParameters("varFile").DefaultValue = FileUpload1.FileName
End If
If extension = ".jpeg" Then
'Uncomment this line to Save the uploaded file
FileUpload1.SaveAs("D:\vhosts\\httpdocs\img\" & FileUpload1.FileName)
SqlDataSource2.InsertParameters("varFile").DefaultValue = FileUpload1.FileName
End If
If extension = ".gif" Then
'Uncomment this line to Save the uploaded file
FileUpload1.SaveAs("D:\vhosts\\httpdocs\img\" & FileUpload1.FileName)
SqlDataSource2.InsertParameters("varFile").DefaultValue = FileUpload1.FileName
End If
If extension = ".png" Then
'Uncomment this line to Save the uploaded file
FileUpload1.SaveAs("D:\vhosts\\httpdocs\img\" & FileUpload1.FileName)
SqlDataSource2.InsertParameters("varFile").DefaultValue = FileUpload1.FileName
End If
SqlDataSource2.Insert()
Label3.Text = "Thank you. Your response should be approved within twenty-four hours."
MultiView1.ActiveViewIndex = 3
Else
Label3.Text = "Sorry. You are not currently logged in. You must be logged in to add information to an item."
MultiView1.ActiveViewIndex = 3
End If
End If
End Sub
Protected Sub Button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button3.Click
Label1.Text = GridView1.SelectedRow.Cells(1).Text
Label2.Text = GridView1.SelectedRow.Cells(3).Text
MultiView1.ActiveViewIndex = 2
End Sub
Protected Sub Button4_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button4.Click
If User.Identity.IsAuthenticated = True Then
SqlDataSource1.InsertParameters("varCloser").DefaultValue = User.Identity.Name
SqlDataSource1.InsertParameters("varItem").DefaultValue = GridView1.SelectedRow.Cells(1).Text
SqlDataSource1.Insert()
MultiView1.ActiveViewIndex = 3
Label3.Text = "Thank you. Your request for closure has been submitted."
Else
MultiView1.ActiveViewIndex = 3
Label3.Text = "Sorry. You must login to request an item's closure."
End If
End Sub
Protected Sub GridView2_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView2.RowDataBound
Dim row As GridViewRow
For Each row In GridView2.Rows
If row.Cells(6).Text <> " " Then
row.Cells(6).Text = "<a href='http://www./img/" & row.Cells(6).Text & "' target='_new'>Click Here.</a>"
Else
row.Cells(6).Text = "None Available."
End If
Next
End Sub
End Class