Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- If UpdateInsDelRecord("INSERT INTO EMPGROUP_TBL (MASTERID, BUSINESS_UNIT, " & _
- "DIVISION, SUB_DIVISION, CLASSIFICATION, SUB_CLASSIFICATION) VALUES " & _
- "('" & HandleQuote(Me.lblval_Empid.Text) & "', " & _
- "'" & Me.ddl_BusinessUnit.SelectedValue.ToString() & "' ," & _
- "'" & val_division & "' ," & _
- "'" & val_subdivision & "' ," & _
- "'" & Me.ddl_Classification.SelectedValue.ToString() & "' ," & _
- "'" & Me.ddl_SubClassification.SelectedValue.ToString() & "')" & _
- ";" & _
- "UPDATE EMP_MASTERTBL SET JOBTITLE = '" & Me.txtJobtitle.Text & "' " & _
- "WHERE MASTERID = '" & Me.lblval_Empid.Text & "'") = True Then
- Return True
- Response.Redirect("eHR_EmpMaintenance.aspx")
- Else
- Return False
- End If
- Function SaveUserGroup() As Boolean
- Try
- Dim jobtitle As String = Me.txtJobtitle.Text
- Dim businessunit As String = Me.ddl_BusinessUnit.SelectedValue
- Dim division As String = Me.ddl_Division.SelectedValue
- Dim subdivision As String = Me.ddl_SubDivision.SelectedValue
- Dim classification As String = Me.ddl_Classification.SelectedValue
- Dim subclassification As String = Me.ddl_SubClassification.SelectedValue
- Dim CheckMasterTblIfExist As Boolean
- Dim CheckGroupTblIfExist As Boolean
- Dim insrtResult As Boolean
- Dim seqid As String = Me.lblSEQID.Text
- Dim emp_id As String = Request.QueryString("emp_id")
- If jobtitle <> "" And businessunit <> "Please Select" And division <> "Please Select" And subdivision <> "Please Select" And classification <> "Please Select" And subclassification <> "Please Select" Then
- CheckMasterTblIfExist = CheckRecord("SELECT MASTERID, JOBTITLE FROM EMP_MASTERTBL WHERE JOBTITLE = '" & jobtitle & "' AND MASTERID = '" & emp_id & "' ")
- 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 & "'")
- If Not CheckMasterTblIfExist And CheckGroupTblIfExist Then
- insrtResult = UpdateInsDelRecord("UPDATE EMP_MASTERTBL SET JOBTITLE = '" & jobtitle & "' " & _
- "WHERE MASTERID = '" + Me.lblval_Empid.Text + "'" & _
- ";" & _
- "INSERT INTO EMPGROUP_TBL(MASTERID, BUSINESS_UNIT, " & _
- "DIVISION, SUB_DIVISION, CLASSIFICATION, SUB_CLASSIFICATION) VALUES " & _
- "('" & HandleQuote(Me.lblval_Empid.Text) & "', " & _
- "'" & businessunit & "' ," & _
- "'" & division & "' ," & _
- "'" & subdivision & "' ," & _
- "'" & classification & "' ," & _
- "'" & subclassification & "')")
- If Not insrtResult Then
- MessageBox("alert('Error Ocurred While Inserting a Data.')")
- Else
- MessageBox("alert('Successfully Added.')")
- End If
- Else
- MessageBox("alert('Data Already Exist.')")
- End If
- End If
- Catch ex As Exception
- MessageBox("Error Ocurred while Inserting a data")
- Throw
- End Try
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement