Cor,
I know theres a fair bit but i`ve attached my code incase it might help?
Also any suggestions anybody has would be welcomed for any area of code? im
not sure wether im still classed as a newbie or not now
Many Thanks
MCN
Private Sub frmMainMenuPasswords_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
cmDsCentrexLines = BindingContext(dsCentrexLines, "Centrexlines")
cmDsCentrexLines = BindingContext(dsMobiles, "MobilePhones")
cmDsISDNLines = BindingContext(dsISDNLines, "ISDNLines")
cmDsBTLines = BindingContext(dsBTLines, "BTLines")
mlLoading = True
'Start of Fill Datasets
Try
dsCentrexLines.EnforceConstraints = False
Try
Me.odcPhones.Open()
'Fill CentrexLines Copier Datasets
Me.odaCommsType.Fill(dsCentrexLines)
Me.odaSites.Fill(dsCentrexLines)
Me.odaDepartments.Fill(dsCentrexLines)
Me.odaPrimaryUser.Fill(dsCentrexLines)
Me.odaCentrexLines.Fill(dsCentrexLines)
'Fill Mobile Phone Datasets
Me.odaGPRSTarrif.Fill(dsMobiles)
Me.odaDepartments.Fill(dsMobiles)
Me.odaPrimaryUser.Fill(dsMobiles)
Me.odaMobiles.Fill(dsMobiles)
'Fill ISDN Line Datasets
Me.odaSites.Fill(dsISDNLines)
Me.odaDepartments.Fill(dsISDNLines)
Me.odaPrimaryUser.Fill(dsISDNLines)
Me.odaCommsType.Fill(dsISDNLines)
Me.odaCommsCarrier.Fill(dsISDNLines)
Me.odaISDNLines.Fill(dsISDNLines)
'Fill BT Line Datasets
Me.odaSites.Fill(dsBTLines)
Me.odaPrimaryUser.Fill(dsBTLines)
Me.odaCommsType.Fill(dsBTLines)
Me.odaBTLines.Fill(dsBTLines)
Catch fillException As System.Exception
Throw fillException
Finally
'To be enabled if Dataset Bindings Fail - Enabling will
cause BIG Datasets
'dsCentrexLines.EnforceConstraints = True
'dsMobiles.EnforceConstraints = True
'dsISDNLines.EnforceConstraints = True
'dsBTLines.EnforceConstraints = True
Me.odcPhones.Close()
End Try
Catch eLoad As System.Exception
System.Windows.Forms.MessageBox.Show(eLoad.Message)
Finally
mlLoading = False
End Try
'End of Fill Datasets
End Sub
'Start of Position Changed Code - Centrexlines
Private Sub cmdsCentrexLines_PositionChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cmDsCentrexLines.PositionChanged
dsCentrexLines_PositionChanged()
End Sub
Private Sub cboCentrexlinesType_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
cboCentrexLinesDepartment.SelectedIndexChanged
If Me.BindingContext(dsCentrexLines, "Centrexlines").Position <> -1
And Not mlLoading Then
dsCentrexLines.CentrexLines.Rows(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position).Item("CommsTypeID") =
Me.cboCentrexLinesType.SelectedValue
End If
End Sub
Private Sub cboCentrexLinesPrimaryUser_SelectedIndexChanged(ByVal sender
As Object, ByVal e As System.EventArgs) Handles
cboCentrexLinesPrimaryUser.SelectedIndexChanged
If Me.BindingContext(dsCentrexLines, "Centrexlines").Position <> -1
And Not mlLoading Then
dsCentrexLines.CentrexLines.Rows(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position).Item("UsersID") =
Me.cboCentrexLinesPrimaryUser.SelectedValue
End If
End Sub
Private Sub cboCentrexlinesDepartment_SelectedIndexChanged(ByVal sender
As Object, ByVal e As System.EventArgs) Handles
cboCentrexLinesDepartment.SelectedIndexChanged
If Me.BindingContext(dsCentrexLines, "Centrexlines").Position <> -1
And Not mlLoading Then
dsCentrexLines.CentrexLines.Rows(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position).Item("DepartmentID") =
Me.cboCentrexLinesDepartment.SelectedValue
End If
End Sub
Private Sub cboCentrexLinesite_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
cboCentrexLinesSite.SelectedIndexChanged
If Me.BindingContext(dsCentrexLines, "Centrexlines").Position <> -1
And Not mlLoading Then
dsCentrexLines.CentrexLines.Rows(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position).Item("SitesID") =
Me.cboCentrexLinesSite.SelectedValue
End If
End Sub
Private Sub dsCentrexLines_PositionChanged()
If Me.BindingContext(dsCentrexLines, "Centrexlines").Position <> -1
Then
Me.cboCentrexLinesType.SelectedValue =
dsCentrexLines.CentrexLines.Rows(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position).Item("CommsTypeID")
Me.cboCentrexLinesPrimaryUser.SelectedValue =
dsCentrexLines.CentrexLines.Rows(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position).Item("UsersID")
Me.cboCentrexLinesDepartment.SelectedValue =
dsCentrexLines.CentrexLines.Rows(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position).Item("DepartmentID")
Me.cboCentrexLinesSite.SelectedValue =
dsCentrexLines.CentrexLines.Rows(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position).Item("SitesID")
End If
End Sub
'End of Position Changed Code - Centrexlines
'Start of Position Changed Code - Mobile Phones
Private Sub cmdsMobiles_PositionChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles cmdsMobilePhones.PositionChanged
dsMobiles_PositionChanged()
End Sub
Private Sub cboMobilePhonesPrimaryUser_SelectedIndexChanged(ByVal sender
As Object, ByVal e As System.EventArgs) Handles
cboMobilePhonesPrimaryUser.SelectedIndexChanged
If Me.BindingContext(dsMobiles, "MobilePhones").Position <> -1 And
Not mlLoading Then
dsMobiles.MobilePhones.Rows(Me.BindingContext(dsMobiles,
"MobilePhones").Position).Item("UsersID") =
Me.cboMobilePhonesPrimaryUser.SelectedValue
End If
End Sub
Private Sub cboMobilePhonesDepartment_SelectedIndexChanged(ByVal sender
As Object, ByVal e As System.EventArgs) Handles
cboMobilePhonesDepartment.SelectedIndexChanged
If Me.BindingContext(dsMobiles, "MobilePhones").Position <> -1 And
Not mlLoading Then
dsMobiles.MobilePhones.Rows(Me.BindingContext(dsMobiles,
"MobilePhones").Position).Item("DepartmentID") =
Me.cboMobilePhonesDepartment.SelectedValue
End If
End Sub
Private Sub cboMobilePhoneGPRSTarrif_SelectedIndexChanged(ByVal sender
As Object, ByVal e As System.EventArgs) Handles
cboMobilePhonesGPRSTariff.SelectedIndexChanged
If Me.BindingContext(dsMobiles, "MobilePhones").Position <> -1 And
Not mlLoading Then
dsMobiles.MobilePhones.Rows(Me.BindingContext(dsMobiles,
"MobilePhones").Position).Item("GPRSTarrifID") =
Me.cboMobilePhonesGPRSTariff.SelectedValue
End If
End Sub
Private Sub dsMobiles_PositionChanged()
If Me.BindingContext(dsMobiles, "MobilePhones").Position <> -1 Then
Me.cboMobilePhonesPrimaryUser.SelectedValue =
dsMobiles.MobilePhones.Rows(Me.BindingContext(dsMobiles,
"MobilePhones").Position).Item("UsersID")
Me.cboMobilePhonesDepartment.SelectedValue =
dsMobiles.MobilePhones.Rows(Me.BindingContext(dsMobiles,
"MobilePhones").Position).Item("DepartmentID")
Me.cboMobilePhonesGPRSTariff.SelectedValue =
dsMobiles.MobilePhones.Rows(Me.BindingContext(dsMobiles,
"MobilePhones").Position).Item("GPRSTariffID")
End If
End Sub
'End of Position Changed Code - Mobile Phones
'Start of Position Changed Code - ISDN Lines
Private Sub cmdsISDNLines_PositionChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles cmDsISDNLines.PositionChanged
dsISDNLines_PositionChanged()
End Sub
Private Sub cboISDNLinesPrimaryUser_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
cboISDNLinesPrimaryUser.SelectedIndexChanged
If Me.BindingContext(dsISDNLines, "ISDNLines").Position <> -1 And
Not mlLoading Then
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("UsersID") =
Me.cboISDNLinesPrimaryUser.SelectedValue
End If
End Sub
Private Sub cboISDNLinesDepartment_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
cboISDNLinesDepartment.SelectedIndexChanged
If Me.BindingContext(dsISDNLines, "ISDNLines").Position <> -1 And
Not mlLoading Then
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("DepartmentID") =
Me.cboISDNLinesDepartment.SelectedValue
End If
End Sub
Private Sub cboIDSNLinesType_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
cboISDNLinesType.SelectedIndexChanged
If Me.BindingContext(dsISDNLines, "ISDNLines").Position <> -1 And
Not mlLoading Then
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("CommsTypeID") =
Me.cboISDNLinesType.SelectedValue
End If
End Sub
Private Sub cboIDSNLinesSite_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
cboISDNLinesSite.SelectedIndexChanged
If Me.BindingContext(dsISDNLines, "ISDNLines").Position <> -1 And
Not mlLoading Then
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("SitesID") = Me.cboISDNLinesSite.SelectedValue
End If
End Sub
Private Sub cboIDSNLinesCarrier_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
cboISDNLinesCarrier.SelectedIndexChanged
If Me.BindingContext(dsISDNLines, "ISDNLines").Position <> -1 And
Not mlLoading Then
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("CommsCarrierID") =
Me.cboISDNLinesCarrier.SelectedValue
End If
End Sub
Private Sub dsISDNLines_PositionChanged()
If Me.BindingContext(dsISDNLines, "ISDNLines").Position <> -1 Then
Me.cboISDNLinesPrimaryUser.SelectedValue =
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("UsersID")
Me.cboISDNLinesDepartment.SelectedValue =
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("DepartmentID")
Me.cboISDNLinesCarrier.SelectedValue =
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("LineCarrierID")
Me.cboISDNLinesSite.SelectedValue =
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("SiteID")
Me.cboISDNLinesCarrier.SelectedValue =
dsISDNLines.ISDNLines.Rows(Me.BindingContext(dsISDNLines,
"ISDNLines").Position).Item("CommsCarrierID")
End If
End Sub
'End of Position Changed Code - ISDN Lines
'Start of Position Changed Code - BT Lines
Private Sub cmdsBTLines_PositionChanged(ByVal sender As Object, ByVal e
As System.EventArgs) Handles cmDsBTLines.PositionChanged
dsBTLines_PositionChanged()
End Sub
Private Sub cboBTLinesPrimaryUser_SelectedIndexChanged(ByVal sender As
Object, ByVal e As System.EventArgs) Handles
cboBTLinesPrimaryUser.SelectedIndexChanged
If Me.BindingContext(dsBTLines, "BTLines").Position <> -1 And Not
mlLoading Then
dsBTLines.BTLines.Rows(Me.BindingContext(dsBTLines,
"BTLines").Position).Item("UsersID") =
Me.cboBTLinesPrimaryUser.SelectedValue
End If
End Sub
Private Sub cboBTLinesType_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cboBTLinesType.SelectedIndexChanged
If Me.BindingContext(dsBTLines, "BTLines").Position <> -1 And Not
mlLoading Then
dsBTLines.BTLines.Rows(Me.BindingContext(dsBTLines,
"BTLines").Position).Item("TypeID") = Me.cboBTLinesType.SelectedValue
End If
End Sub
Private Sub cboBTLinesSite_SelectedIndexChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles cboBTLinesSite.SelectedIndexChanged
If Me.BindingContext(dsBTLines, "BTLines").Position <> -1 And Not
mlLoading Then
dsBTLines.BTLines.Rows(Me.BindingContext(dsBTLines,
"BTLines").Position).Item("SiteID") = Me.cboBTLinesSite.SelectedValue
End If
End Sub
Private Sub dsBTLines_PositionChanged()
If Me.BindingContext(dsBTLines, "BTLines").Position <> -1 Then
Me.cboBTLinesPrimaryUser.SelectedValue =
dsBTLines.BTLines.Rows(Me.BindingContext(dsBTLines,
"BTLines").Position).Item("UsersID")
Me.cboBTLinesType.SelectedValue =
dsBTLines.BTLines.Rows(Me.BindingContext(dsBTLines,
"BTLines").Position).Item("LineCarrierID")
Me.cboBTLinesSite.SelectedValue =
dsBTLines.BTLines.Rows(Me.BindingContext(dsBTLines,
"BTLines").Position).Item("SiteID")
End If
End Sub
'End of Position Changed Code - BT Lines
'CentrexLines Code Start
Private Sub btnCentrexlinesDelete_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCentrexLinesDelete.Click
If (Me.BindingContext(dsCentrexLines, "Centrexlines").Count > 0)
Then
Me.BindingContext(dsCentrexLines,
"Centrexlines").RemoveAt(Me.BindingContext(dsCentrexLines,
"Centrexlines").Position)
End If
End Sub
Private Sub btnCentrexlinesAdd_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCentrexLinesAdd.Click
txtCentrexLinesID.Enabled = True
txtCentrexLinesExtension.Enabled = True
txtCentrexLinesPublicDialNumber.Enabled = True
txtCentrexLinesNotes.Enabled = True
txtCentrexLinesCabNumber.Enabled = True
txtCentrexLinesPatchPoint.Enabled = True
txtCentrexLinesDP.Enabled = True
txtCentrexLinesPair.Enabled = True
txtCentrexLinesExchange.Enabled = True
txtCentrexLinesPatchPanel.Enabled = True
dtpCentrexLinesInstallationDate.Enabled = True
cboCentrexLinesDDI.Enabled = True
cboCentrexLinesType.Enabled = True
cboCentrexLinesDepartment.Enabled = True
cboCentrexLinesSite.Enabled = True
cboCentrexLinesPrimaryUser.Enabled = True
Try
Me.BindingContext(dsCentrexLines,
"Centrexlines").EndCurrentEdit()
Me.BindingContext(dsCentrexLines, "Centrexlines").AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
Private Sub btnCentrexlinesCancel_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCentrexLinesCancel.Click
Me.BindingContext(dsCentrexLines,
"Centrexlines").CancelCurrentEdit()
txtCentrexLinesID.Enabled = False
txtCentrexLinesExtension.Enabled = False
txtCentrexLinesPublicDialNumber.Enabled = False
txtCentrexLinesNotes.Enabled = False
txtCentrexLinesCabNumber.Enabled = False
txtCentrexLinesPatchPoint.Enabled = False
txtCentrexLinesDP.Enabled = False
txtCentrexLinesPair.Enabled = False
txtCentrexLinesExchange.Enabled = False
txtCentrexLinesPatchPanel.Enabled = False
dtpCentrexLinesInstallationDate.Enabled = False
cboCentrexLinesDDI.Enabled = False
cboCentrexLinesType.Enabled = False
cboCentrexLinesDepartment.Enabled = False
cboCentrexLinesSite.Enabled = False
cboCentrexLinesPrimaryUser.Enabled = False
End Sub
Private Sub btnCentrexlinesUpdate_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCentrexLinesUpdate.Click
Try
Dim objDataSetChanges As Excellence.NET.dsCentrexLines = New
Excellence.NET.dsCentrexLines()
Me.BindingContext(dsCentrexLines,
"Centrexlines").EndCurrentEdit()
objDataSetChanges = CType(dsCentrexLines.GetChanges,
Excellence.NET.dsCentrexLines)
If (Not (objDataSetChanges) Is Nothing) Then
Try
If (Not (dsCentrexLines) Is Nothing) Then
Me.odcPhones.Open()
Me.odaCommsType.Fill(dsCentrexLines)
Me.odaSites.Fill(dsCentrexLines)
Me.odaDepartments.Fill(dsCentrexLines)
Me.odaPrimaryUser.Fill(dsCentrexLines)
Me.odaCentrexLines.Fill(dsCentrexLines)
End If
Catch updateException As System.Exception
Throw updateException
Finally
Me.odcPhones.Close()
End Try
End If
dsCentrexLines.Merge(objDataSetChanges)
dsCentrexLines.AcceptChanges()
Catch eUpdate As System.Exception
System.Windows.Forms.MessageBox.Show(eUpdate.Message)
End Try
txtCentrexLinesID.Enabled = False
txtCentrexLinesExtension.Enabled = False
txtCentrexLinesPublicDialNumber.Enabled = False
txtCentrexLinesNotes.Enabled = False
txtCentrexLinesCabNumber.Enabled = False
txtCentrexLinesPatchPoint.Enabled = False
txtCentrexLinesDP.Enabled = False
txtCentrexLinesPair.Enabled = False
txtCentrexLinesExchange.Enabled = False
txtCentrexLinesPatchPanel.Enabled = False
dtpCentrexLinesInstallationDate.Enabled = False
cboCentrexLinesDDI.Enabled = False
cboCentrexLinesType.Enabled = False
cboCentrexLinesDepartment.Enabled = False
cboCentrexLinesSite.Enabled = False
cboCentrexLinesPrimaryUser.Enabled = False
End Sub
Private Sub btnCentrexlinesEdit_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnCentrexLinesEdit.Click
txtCentrexLinesID.Enabled = True
txtCentrexLinesExtension.Enabled = True
txtCentrexLinesPublicDialNumber.Enabled = True
txtCentrexLinesNotes.Enabled = True
txtCentrexLinesCabNumber.Enabled = True
txtCentrexLinesPatchPoint.Enabled = True
txtCentrexLinesDP.Enabled = True
txtCentrexLinesPair.Enabled = True
txtCentrexLinesExchange.Enabled = True
txtCentrexLinesPatchPanel.Enabled = True
dtpCentrexLinesInstallationDate.Enabled = True
cboCentrexLinesDDI.Enabled = True
cboCentrexLinesType.Enabled = True
cboCentrexLinesDepartment.Enabled = True
cboCentrexLinesSite.Enabled = True
cboCentrexLinesPrimaryUser.Enabled = True
End Sub
'Centrexlines Code Finish
'Mobile Phones Code Start
Private Sub btnMobilePhonesDelete_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnMobilePhonesDelete.Click
If (Me.BindingContext(dsMobiles, "MobilePhones").Count > 0) Then
Me.BindingContext(dsMobiles,
"MobilePhones").RemoveAt(Me.BindingContext(dsMobiles,
"MobilePhones").Position)
End If
End Sub
Private Sub btnMobilePhonesAdd_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnMobilePhonesAdd.Click
txtMobilePhonesID.Enabled = True
txtMobilePhonesMobileNumber.Enabled = True
txtMobilePhonesData.Enabled = True
txtMobilePhonesFax.Enabled = True
txtMobilePhonesSDC.Enabled = True
dtpMobilePhonesContractStartDate.Enabled = True
cboMobilePhonesDepartment.Enabled = True
cboMobilePhonesPrimaryUser.Enabled = True
cboMobilePhonesGPRSTariff.Enabled = True
Try
Me.BindingContext(dsMobiles, "MobilePhones").EndCurrentEdit()
Me.BindingContext(dsMobiles, "MobilePhones").AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
Private Sub btnMobilePhonesCancel_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnMobilePhonesCancel.Click
Me.BindingContext(dsMobiles, "MobilePhones").CancelCurrentEdit()
txtMobilePhonesID.Enabled = False
txtMobilePhonesMobileNumber.Enabled = False
txtMobilePhonesData.Enabled = False
txtMobilePhonesFax.Enabled = False
txtMobilePhonesSDC.Enabled = False
dtpMobilePhonesContractStartDate.Enabled = False
cboMobilePhonesDepartment.Enabled = False
cboMobilePhonesPrimaryUser.Enabled = False
cboMobilePhonesGPRSTariff.Enabled = False
End Sub
Private Sub btnMobilePhonesUpdate_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnMobilePhonesUpdate.Click
Try
Dim objDataSetChanges As Excellence.NET.dsMobiles = New
Excellence.NET.dsMobiles()
Me.BindingContext(dsMobiles, "MobilePhones").EndCurrentEdit()
objDataSetChanges = CType(dsMobiles.GetChanges,
Excellence.NET.dsMobiles)
If (Not (objDataSetChanges) Is Nothing) Then
Try
If (Not (dsMobiles) Is Nothing) Then
Me.odcPhones.Open()
Me.odaDepartments.Fill(dsMobiles)
Me.odaPrimaryUser.Fill(dsMobiles)
Me.odaGPRSTarrif.Fill(dsMobiles)
Me.odaMobiles.Fill(dsMobiles)
End If
Catch updateException As System.Exception
Throw updateException
Finally
Me.odcPhones.Close()
End Try
End If
dsMobiles.Merge(objDataSetChanges)
dsMobiles.AcceptChanges()
Catch eUpdate As System.Exception
System.Windows.Forms.MessageBox.Show(eUpdate.Message)
End Try
txtMobilePhonesID.Enabled = False
txtMobilePhonesMobileNumber.Enabled = False
txtMobilePhonesData.Enabled = False
txtMobilePhonesFax.Enabled = False
txtMobilePhonesSDC.Enabled = False
dtpMobilePhonesContractStartDate.Enabled = False
cboMobilePhonesDepartment.Enabled = False
cboMobilePhonesPrimaryUser.Enabled = False
cboMobilePhonesGPRSTariff.Enabled = False
End Sub
Private Sub btnMobilePhonesEdit_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnMobilePhonesEdit.Click
txtMobilePhonesID.Enabled = True
txtMobilePhonesMobileNumber.Enabled = True
txtMobilePhonesData.Enabled = True
txtMobilePhonesFax.Enabled = True
txtMobilePhonesSDC.Enabled = True
dtpMobilePhonesContractStartDate.Enabled = True
cboMobilePhonesDepartment.Enabled = True
cboMobilePhonesPrimaryUser.Enabled = True
cboMobilePhonesGPRSTariff.Enabled = True
End Sub
'Mobile Phones Code Finish
'ISDN Lines Code Start
Private Sub btnISDNLinesDelete_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnISDNLinesDelete.Click
If (Me.BindingContext(dsISDNLines, "ISDNLines").Count > 0) Then
Me.BindingContext(dsISDNLines,
"ISDNLines").RemoveAt(Me.BindingContext(dsISDNLines, "ISDNLines").Position)
End If
End Sub
Private Sub btnISDNLinesAdd_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnISDNLinesAdd.Click
txtISDNLinesID.Enabled = True
txtISDNLinesPrimaryNumber.Enabled = True
txtISDNLinesSecondaryNumber.Enabled = True
txtISDNLinesNotes.Enabled = True
txtISDNLinesCab.Enabled = True
txtISDNLinesPatch.Enabled = True
txtISDNLinesPoint.Enabled = True
txtISDNLinesDP.Enabled = True
txtISDNLinesPair.Enabled = True
txtISDNLinesExchange.Enabled = True
cboISDNLinesPrimaryUser.Enabled = True
cboISDNLinesDepartment.Enabled = True
cboISDNLinesType.Enabled = True
cboISDNLinesCarrier.Enabled = True
cboISDNLinesSite.Enabled = True
dtpISDNLinesInstallationDate.Enabled = True
Try
Me.BindingContext(dsISDNLines, "ISDNLines").EndCurrentEdit()
Me.BindingContext(dsISDNLines, "ISDNLines").AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
Private Sub btnISDNLinesCancel_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnISDNLinesCancel.Click
Me.BindingContext(dsISDNLines, "ISDNLines").CancelCurrentEdit()
txtISDNLinesID.Enabled = False
txtISDNLinesPrimaryNumber.Enabled = False
txtISDNLinesSecondaryNumber.Enabled = False
txtISDNLinesNotes.Enabled = False
txtISDNLinesCab.Enabled = False
txtISDNLinesPatch.Enabled = False
txtISDNLinesPoint.Enabled = False
txtISDNLinesDP.Enabled = False
txtISDNLinesPair.Enabled = False
txtISDNLinesExchange.Enabled = False
cboISDNLinesPrimaryUser.Enabled = False
cboISDNLinesDepartment.Enabled = False
cboISDNLinesType.Enabled = False
cboISDNLinesCarrier.Enabled = False
cboISDNLinesSite.Enabled = False
dtpISDNLinesInstallationDate.Enabled = False
End Sub
Private Sub btnISDNLinesUpdate_Click(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles btnISDNLinesUpdate.Click
Try
Dim objDataSetChanges As Excellence.NET.dsISDNLines = New
Excellence.NET.dsISDNLines()
Me.BindingContext(dsISDNLines, "ISDNLines").EndCurrentEdit()
objDataSetChanges = CType(dsISDNLines.GetChanges,
Excellence.NET.dsISDNLines)
If (Not (objDataSetChanges) Is Nothing) Then
Try
If (Not (dsISDNLines) Is Nothing) Then
Me.odcPhones.Open()
Me.odaDepartments.Fill(dsISDNLines)
Me.odaCommsType.Fill(dsISDNLines)
Me.odaDepartments.Fill(dsISDNLines)
Me.odaPrimaryUser.Fill(dsISDNLines)
Me.odaCommsCarrier.Fill(dsISDNLines)
Me.odaISDNLines.Fill(dsISDNLines)
End If
Catch updateException As System.Exception
Throw updateException
Finally
Me.odcPhones.Close()
End Try
End If
dsISDNLines.Merge(objDataSetChanges)
dsISDNLines.AcceptChanges()
Catch eUpdate As System.Exception
System.Windows.Forms.MessageBox.Show(eUpdate.Message)
End Try
txtISDNLinesID.Enabled = False
txtISDNLinesPrimaryNumber.Enabled = False
txtISDNLinesSecondaryNumber.Enabled = False
txtISDNLinesNotes.Enabled = False
txtISDNLinesCab.Enabled = False
txtISDNLinesPatch.Enabled = False
txtISDNLinesPoint.Enabled = False
txtISDNLinesDP.Enabled = False
txtISDNLinesPair.Enabled = False
txtISDNLinesExchange.Enabled = False
cboISDNLinesPrimaryUser.Enabled = False
cboISDNLinesDepartment.Enabled = False
cboISDNLinesType.Enabled = False
cboISDNLinesCarrier.Enabled = False
cboISDNLinesSite.Enabled = False
dtpISDNLinesInstallationDate.Enabled = False
End Sub
Private Sub btnISDNLinesEdit_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnISDNLinesEdit.Click
txtISDNLinesID.Enabled = True
txtISDNLinesPrimaryNumber.Enabled = True
txtISDNLinesSecondaryNumber.Enabled = True
txtISDNLinesNotes.Enabled = True
txtISDNLinesCab.Enabled = True
txtISDNLinesPatch.Enabled = True
txtISDNLinesPoint.Enabled = True
txtISDNLinesDP.Enabled = True
txtISDNLinesPair.Enabled = True
txtISDNLinesExchange.Enabled = True
cboISDNLinesPrimaryUser.Enabled = True
cboISDNLinesDepartment.Enabled = True
cboISDNLinesType.Enabled = True
cboISDNLinesCarrier.Enabled = True
cboISDNLinesSite.Enabled = True
dtpISDNLinesInstallationDate.Enabled = True
End Sub
'ISDN Lines Code Finish
'BT Lines Code Start
Private Sub btnBTLinesDelete_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnBTLinesDelete.Click
If (Me.BindingContext(dsBTLines, "BTLines").Count > 0) Then
Me.BindingContext(dsBTLines,
"BTLines").RemoveAt(Me.BindingContext(dsBTLines, "BTLines").Position)
End If
End Sub
Private Sub btnBTLinesAdd_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnBTLinesAdd.Click
txtBTLinesID.Enabled = True
txtBTLinesNumber.Enabled = True
txtBTLinesAccountNumber.Enabled = True
txtBTLinesNotes.Enabled = True
txtBTLinesDP.Enabled = True
txtBTLinesPair.Enabled = True
txtBTLinesExchange.Enabled = True
cboBTLinesPrimaryUser.Enabled = True
cboBTLinesType.Enabled = True
cboBTLinesSite.Enabled = True
dtpBTLinesInstallationDate.Enabled = True
Try
Me.BindingContext(dsBTLines, "BTLines").EndCurrentEdit()
Me.BindingContext(dsBTLines, "BTLines").AddNew()
Catch eEndEdit As System.Exception
System.Windows.Forms.MessageBox.Show(eEndEdit.Message)
End Try
End Sub
Private Sub btnBTLinesCancel_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnBTLinesCancel.Click
Me.BindingContext(dsBTLines, "BTLines").CancelCurrentEdit()
txtBTLinesID.Enabled = False
txtBTLinesNumber.Enabled = False
txtBTLinesAccountNumber.Enabled = False
txtBTLinesNotes.Enabled = False
txtBTLinesDP.Enabled = False
txtBTLinesPair.Enabled = False
txtBTLinesExchange.Enabled = False
cboBTLinesPrimaryUser.Enabled = False
cboBTLinesType.Enabled = False
cboBTLinesSite.Enabled = False
dtpBTLinesInstallationDate.Enabled = False
End Sub
Private Sub btnBTLinesUpdate_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles btnBTLinesUpdate.Click
Try
Dim objDataSetChanges As Excellence.NET.dsBTLines = New
Excellence.NET.dsBTLines()
Me.BindingContext(dsBTLines, "BTLines").EndCurrentEdit()
objDataSetChanges = CType(dsBTLines.GetChanges,
Excellence.NET.dsBTLines)
If (Not (objDataSetChanges) Is Nothing) Then
Try
If (Not (dsBTLines) Is Nothing) Then
Me.odcPhones.Open()
Me.odaSites.Fill(dsBTLines)
Me.odaPrimaryUser.Fill(dsBTLines)
Me.odaCommsType.Fill(dsBTLines)
Me.odaBTLines.Fill(dsBTLines)
End If
Catch updateException As System.Exception
Throw updateException
Finally
Me.odcPhones.Close()
End Try
End If
dsBTLines.Merge(objDataSetChanges)
dsBTLines.AcceptChanges()
Catch eUpdate As System.Exception
System.Windows.Forms.MessageBox.Show(eUpdate.Message)
End Try
txtBTLinesID.Enabled = False
txtBTLinesNumber.Enabled = False
txtBTLinesAccountNumber.Enabled = False
txtBTLinesNotes.Enabled = False
txtBTLinesDP.Enabled = False
txtBTLinesPair.Enabled = False
txtBTLinesExchange.Enabled = False
cboBTLinesPrimaryUser.Enabled = False
cboBTLinesType.Enabled = False
cboBTLinesSite.Enabled = False
dtpBTLinesInstallationDate.Enabled = True
End Sub
Private Sub btnBTLinesEdit_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles btnBTLinesEdit.Click
txtBTLinesID.Enabled = True
txtBTLinesNumber.Enabled = True
txtBTLinesAccountNumber.Enabled = True
txtBTLinesNotes.Enabled = True
txtBTLinesDP.Enabled = True
txtBTLinesPair.Enabled = True
txtBTLinesExchange.Enabled = True
cboBTLinesPrimaryUser.Enabled = True
cboBTLinesType.Enabled = True
cboBTLinesSite.Enabled = True
dtpBTLinesInstallationDate.Enabled = True
End Sub
'BT Lines Code Finish