Advertisement
Guest User

Untitled

a guest
Dec 8th, 2016
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.76 KB | None | 0 0
  1. If UpdateInsDelRecord("INSERT INTO EMPGROUP_TBL (MASTERID, BUSINESS_UNIT, " & _
  2. "DIVISION, SUB_DIVISION, CLASSIFICATION, SUB_CLASSIFICATION) VALUES " & _
  3. "('" & HandleQuote(Me.lblval_Empid.Text) & "', " & _
  4. "'" & Me.ddl_BusinessUnit.SelectedValue.ToString() & "' ," & _
  5. "'" & val_division & "' ," & _
  6. "'" & val_subdivision & "' ," & _
  7. "'" & Me.ddl_Classification.SelectedValue.ToString() & "' ," & _
  8. "'" & Me.ddl_SubClassification.SelectedValue.ToString() & "')" & _
  9. ";" & _
  10. "UPDATE EMP_MASTERTBL SET JOBTITLE = '" & Me.txtJobtitle.Text & "' " & _
  11. "WHERE MASTERID = '" & Me.lblval_Empid.Text & "'") = True Then
  12. Return True
  13. Response.Redirect("eHR_EmpMaintenance.aspx")
  14. Else
  15. Return False
  16. End If
  17.  
  18. Function SaveUserGroup() As Boolean
  19. Try
  20. Dim jobtitle As String = Me.txtJobtitle.Text
  21. Dim businessunit As String = Me.ddl_BusinessUnit.SelectedValue
  22. Dim division As String = Me.ddl_Division.SelectedValue
  23. Dim subdivision As String = Me.ddl_SubDivision.SelectedValue
  24. Dim classification As String = Me.ddl_Classification.SelectedValue
  25. Dim subclassification As String = Me.ddl_SubClassification.SelectedValue
  26. Dim CheckMasterTblIfExist As Boolean
  27. Dim CheckGroupTblIfExist As Boolean
  28. Dim insrtResult As Boolean
  29. Dim seqid As String = Me.lblSEQID.Text
  30. Dim emp_id As String = Request.QueryString("emp_id")
  31.  
  32. If jobtitle <> "" And businessunit <> "Please Select" And division <> "Please Select" And subdivision <> "Please Select" And classification <> "Please Select" And subclassification <> "Please Select" Then
  33. CheckMasterTblIfExist = CheckRecord("SELECT MASTERID, JOBTITLE FROM EMP_MASTERTBL WHERE JOBTITLE = '" & jobtitle & "' AND MASTERID = '" & emp_id & "' ")
  34. CheckGroupTblIfExist = CheckRecord("SELECT * FROM EMPGROUP_TBL WHERE BUSINESS_UNIT = '" & businessunit & "' AND DIVISION = '" & division & "' AND SUB_DIVISION = '" & subdivision & "' AND CLASSIFICATION = '" & classification & "' AND SUB_CLASSIFICATION = '" & subclassification & "' AND MASTERID = '" & emp_id & "' AND SEQID = '" & seqid & "'")
  35. If Not CheckMasterTblIfExist And CheckGroupTblIfExist Then
  36. insrtResult = UpdateInsDelRecord("UPDATE EMP_MASTERTBL SET JOBTITLE = '" & jobtitle & "' " & _
  37. "WHERE MASTERID = '" + Me.lblval_Empid.Text + "'" & _
  38. ";" & _
  39. "INSERT INTO EMPGROUP_TBL(MASTERID, BUSINESS_UNIT, " & _
  40. "DIVISION, SUB_DIVISION, CLASSIFICATION, SUB_CLASSIFICATION) VALUES " & _
  41. "('" & HandleQuote(Me.lblval_Empid.Text) & "', " & _
  42. "'" & businessunit & "' ," & _
  43. "'" & division & "' ," & _
  44. "'" & subdivision & "' ," & _
  45. "'" & classification & "' ," & _
  46. "'" & subclassification & "')")
  47.  
  48. If Not insrtResult Then
  49. MessageBox("alert('Error Ocurred While Inserting a Data.')")
  50. Else
  51. MessageBox("alert('Successfully Added.')")
  52. End If
  53. Else
  54. MessageBox("alert('Data Already Exist.')")
  55. End If
  56. End If
  57. Catch ex As Exception
  58. MessageBox("Error Ocurred while Inserting a data")
  59. Throw
  60. End Try
  61. End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement