/e_desk/viewproblem_user.aspx.vb

http://github.com/shafiqissani/eDesk-Systems · Visual Basic · 55 lines · 38 code · 13 blank · 4 comment · 0 complexity · a3de546f41543c293ecd32c21aea8b13 MD5 · raw file

  1. Imports System.Data
  2. Imports System.Data.SqlClient
  3. Namespace e_desk
  4. Partial Class viewproblem_user
  5. Inherits System.Web.UI.Page
  6. #Region " Web Form Designer Generated Code "
  7. 'This call is required by the Web Form Designer.
  8. <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
  9. End Sub
  10. Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
  11. 'CODEGEN: This method call is required by the Web Form Designer
  12. 'Do not modify it using the code editor.
  13. InitializeComponent()
  14. End Sub
  15. #End Region
  16. Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
  17. 'Put user code to initialize the page here
  18. Dim con As SqlConnection = New SqlConnection("Server=(local);uid=sa;database=eDesk")
  19. con.Open()
  20. If Not IsPostBack Then
  21. Dim str As String
  22. str = "select distinct(problemid) from problem_solution where userid='" + Session("username") + "' and status='Open' "
  23. Dim cmd1 As SqlCommand = New SqlCommand(str, con)
  24. Dim dr As SqlDataReader
  25. dr = cmd1.ExecuteReader()
  26. t5.DataSource = dr
  27. t5.DataBind()
  28. End If
  29. End Sub
  30. Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
  31. Dim con As SqlConnection = New SqlConnection("Server=(local);uid=sa;database=eDesk")
  32. con.Open()
  33. Dim s1, str As String
  34. s1 = t5.SelectedItem.Value
  35. DataGrid1.Visible = True
  36. str = "select m.problemid,m.problem,s.solution,s.solutionby from problem_solution s, problems_master m where m.problemid=" + s1 + " and s.problemid='" + s1 + "' and m.userid = '" + Session("username") + "'"
  37. Dim cmd As New SqlCommand(str, con)
  38. DataGrid1.DataSource = cmd.ExecuteReader
  39. DataGrid1.DataBind()
  40. End Sub
  41. End Class
  42. End Namespace