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 frmMainMenuPass words_Load(ByVa l sender As System.Object,
ByVal e As System.EventArg s) Handles MyBase.Load
cmDsCentrexLine s = BindingContext( dsCentrexLines, "Centrexlin es")
cmDsCentrexLine s = BindingContext( dsMobiles, "MobilePhon es")
cmDsISDNLines = BindingContext( dsISDNLines, "ISDNLines" )
cmDsBTLines = BindingContext( dsBTLines, "BTLines")
mlLoading = True
'Start of Fill Datasets
Try
dsCentrexLines. EnforceConstrai nts = False
Try
Me.odcPhones.Op en()
'Fill CentrexLines Copier Datasets
Me.odaCommsType .Fill(dsCentrex Lines)
Me.odaSites.Fil l(dsCentrexLine s)
Me.odaDepartmen ts.Fill(dsCentr exLines)
Me.odaPrimaryUs er.Fill(dsCentr exLines)
Me.odaCentrexLi nes.Fill(dsCent rexLines)
'Fill Mobile Phone Datasets
Me.odaGPRSTarri f.Fill(dsMobile s)
Me.odaDepartmen ts.Fill(dsMobil es)
Me.odaPrimaryUs er.Fill(dsMobil es)
Me.odaMobiles.F ill(dsMobiles)
'Fill ISDN Line Datasets
Me.odaSites.Fil l(dsISDNLines)
Me.odaDepartmen ts.Fill(dsISDNL ines)
Me.odaPrimaryUs er.Fill(dsISDNL ines)
Me.odaCommsType .Fill(dsISDNLin es)
Me.odaCommsCarr ier.Fill(dsISDN Lines)
Me.odaISDNLines .Fill(dsISDNLin es)
'Fill BT Line Datasets
Me.odaSites.Fil l(dsBTLines)
Me.odaPrimaryUs er.Fill(dsBTLin es)
Me.odaCommsType .Fill(dsBTLines )
Me.odaBTLines.F ill(dsBTLines)
Catch fillException As System.Exceptio n
Throw fillException
Finally
'To be enabled if Dataset Bindings Fail - Enabling will
cause BIG Datasets
'dsCentrexLines .EnforceConstra ints = True
'dsMobiles.Enfo rceConstraints = True
'dsISDNLines.En forceConstraint s = True
'dsBTLines.Enfo rceConstraints = True
Me.odcPhones.Cl ose()
End Try
Catch eLoad As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eLoad.Me ssage)
Finally
mlLoading = False
End Try
'End of Fill Datasets
End Sub
'Start of Position Changed Code - Centrexlines
Private Sub cmdsCentrexLine s_PositionChang ed(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cmDsCentrexLine s.PositionChang ed
dsCentrexLines_ PositionChanged ()
End Sub
Private Sub cboCentrexlines Type_SelectedIn dexChanged(ByVa l sender As
Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
And Not mlLoading Then
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("CommsTypeI D") =
Me.cboCentrexLi nesType.Selecte dValue
End If
End Sub
Private Sub cboCentrexLines PrimaryUser_Sel ectedIndexChang ed(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboCentrexLines PrimaryUser.Sel ectedIndexChang ed
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
And Not mlLoading Then
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("UsersID") =
Me.cboCentrexLi nesPrimaryUser. SelectedValue
End If
End Sub
Private Sub cboCentrexlines Department_Sele ctedIndexChange d(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Department.Sele ctedIndexChange d
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
And Not mlLoading Then
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("DepartmentID" ) =
Me.cboCentrexLi nesDepartment.S electedValue
End If
End Sub
Private Sub cboCentrexLines ite_SelectedInd exChanged(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboCentrexLines Site.SelectedIn dexChanged
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
And Not mlLoading Then
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("SitesID") =
Me.cboCentrexLi nesSite.Selecte dValue
End If
End Sub
Private Sub dsCentrexLines_ PositionChanged ()
If Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .Position <> -1
Then
Me.cboCentrexLi nesType.Selecte dValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("CommsTypeI D")
Me.cboCentrexLi nesPrimaryUser. SelectedValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("UsersID")
Me.cboCentrexLi nesDepartment.S electedValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("DepartmentID" )
Me.cboCentrexLi nesSite.Selecte dValue =
dsCentrexLines. CentrexLines.Ro ws(Me.BindingCo ntext(dsCentrex Lines,
"Centrexlines") .Position).Item ("SitesID")
End If
End Sub
'End of Position Changed Code - Centrexlines
'Start of Position Changed Code - Mobile Phones
Private Sub cmdsMobiles_Pos itionChanged(By Val sender As Object, ByVal e
As System.EventArg s) Handles cmdsMobilePhone s.PositionChang ed
dsMobiles_Posit ionChanged()
End Sub
Private Sub cboMobilePhones PrimaryUser_Sel ectedIndexChang ed(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboMobilePhones PrimaryUser.Sel ectedIndexChang ed
If Me.BindingConte xt(dsMobiles, "MobilePhones") .Position <> -1 And
Not mlLoading Then
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("UsersID") =
Me.cboMobilePho nesPrimaryUser. SelectedValue
End If
End Sub
Private Sub cboMobilePhones Department_Sele ctedIndexChange d(ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboMobilePhones Department.Sele ctedIndexChange d
If Me.BindingConte xt(dsMobiles, "MobilePhones") .Position <> -1 And
Not mlLoading Then
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("DepartmentID" ) =
Me.cboMobilePho nesDepartment.S electedValue
End If
End Sub
Private Sub cboMobilePhoneG PRSTarrif_Selec tedIndexChanged (ByVal sender
As Object, ByVal e As System.EventArg s) Handles
cboMobilePhones GPRSTariff.Sele ctedIndexChange d
If Me.BindingConte xt(dsMobiles, "MobilePhones") .Position <> -1 And
Not mlLoading Then
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("GPRSTarrifID" ) =
Me.cboMobilePho nesGPRSTariff.S electedValue
End If
End Sub
Private Sub dsMobiles_Posit ionChanged()
If Me.BindingConte xt(dsMobiles, "MobilePhones") .Position <> -1 Then
Me.cboMobilePho nesPrimaryUser. SelectedValue =
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("UsersID")
Me.cboMobilePho nesDepartment.S electedValue =
dsMobiles.Mobil ePhones.Rows(Me .BindingContext (dsMobiles,
"MobilePhones") .Position).Item ("DepartmentID" )
Me.cboMobilePho nesGPRSTariff.S electedValue =
dsMobiles.Mobil ePhones.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_P ositionChanged( ByVal sender As Object, ByVal
e As System.EventArg s) Handles cmDsISDNLines.P ositionChanged
dsISDNLines_Pos itionChanged()
End Sub
Private Sub cboISDNLinesPri maryUser_Select edIndexChanged( ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesPri maryUser.Select edIndexChanged
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("U sersID") =
Me.cboISDNLines PrimaryUser.Sel ectedValue
End If
End Sub
Private Sub cboISDNLinesDep artment_Selecte dIndexChanged(B yVal sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesDep artment.Selecte dIndexChanged
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("D epartmentID") =
Me.cboISDNLines Department.Sele ctedValue
End If
End Sub
Private Sub cboIDSNLinesTyp e_SelectedIndex Changed(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesTyp e.SelectedIndex Changed
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("C ommsTypeID") =
Me.cboISDNLines Type.SelectedVa lue
End If
End Sub
Private Sub cboIDSNLinesSit e_SelectedIndex Changed(ByVal sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesSit e.SelectedIndex Changed
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("S itesID") = Me.cboISDNLines Site.SelectedVa lue
End If
End Sub
Private Sub cboIDSNLinesCar rier_SelectedIn dexChanged(ByVa l sender As
Object, ByVal e As System.EventArg s) Handles
cboISDNLinesCar rier.SelectedIn dexChanged
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 And
Not mlLoading Then
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("C ommsCarrierID") =
Me.cboISDNLines Carrier.Selecte dValue
End If
End Sub
Private Sub dsISDNLines_Pos itionChanged()
If Me.BindingConte xt(dsISDNLines, "ISDNLines").Po sition <> -1 Then
Me.cboISDNLines PrimaryUser.Sel ectedValue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("U sersID")
Me.cboISDNLines Department.Sele ctedValue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("D epartmentID")
Me.cboISDNLines Carrier.Selecte dValue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("L ineCarrierID")
Me.cboISDNLines Site.SelectedVa lue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("S iteID")
Me.cboISDNLines Carrier.Selecte dValue =
dsISDNLines.ISD NLines.Rows(Me. BindingContext( dsISDNLines,
"ISDNLines").Po sition).Item("C ommsCarrierID")
End If
End Sub
'End of Position Changed Code - ISDN Lines
'Start of Position Changed Code - BT Lines
Private Sub cmdsBTLines_Pos itionChanged(By Val sender As Object, ByVal e
As System.EventArg s) Handles cmDsBTLines.Pos itionChanged
dsBTLines_Posit ionChanged()
End Sub
Private Sub cboBTLinesPrima ryUser_Selected IndexChanged(By Val sender As
Object, ByVal e As System.EventArg s) Handles
cboBTLinesPrima ryUser.Selected IndexChanged
If Me.BindingConte xt(dsBTLines, "BTLines").Posi tion <> -1 And Not
mlLoading Then
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Use rsID") =
Me.cboBTLinesPr imaryUser.Selec tedValue
End If
End Sub
Private Sub cboBTLinesType_ SelectedIndexCh anged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cboBTLinesType. SelectedIndexCh anged
If Me.BindingConte xt(dsBTLines, "BTLines").Posi tion <> -1 And Not
mlLoading Then
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Typ eID") = Me.cboBTLinesTy pe.SelectedValu e
End If
End Sub
Private Sub cboBTLinesSite_ SelectedIndexCh anged(ByVal sender As Object,
ByVal e As System.EventArg s) Handles cboBTLinesSite. SelectedIndexCh anged
If Me.BindingConte xt(dsBTLines, "BTLines").Posi tion <> -1 And Not
mlLoading Then
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Sit eID") = Me.cboBTLinesSi te.SelectedValu e
End If
End Sub
Private Sub dsBTLines_Posit ionChanged()
If Me.BindingConte xt(dsBTLines, "BTLines").Posi tion <> -1 Then
Me.cboBTLinesPr imaryUser.Selec tedValue =
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Use rsID")
Me.cboBTLinesTy pe.SelectedValu e =
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Lin eCarrierID")
Me.cboBTLinesSi te.SelectedValu e =
dsBTLines.BTLin es.Rows(Me.Bind ingContext(dsBT Lines,
"BTLines").Posi tion).Item("Sit eID")
End If
End Sub
'End of Position Changed Code - BT Lines
'CentrexLines Code Start
Private Sub btnCentrexlines Delete_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Delete.Click
If (Me.BindingCont ext(dsCentrexLi nes, "Centrexlines") .Count > 0)
Then
Me.BindingConte xt(dsCentrexLin es,
"Centrexlines") .RemoveAt(Me.Bi ndingContext(ds CentrexLines,
"Centrexlines") .Position)
End If
End Sub
Private Sub btnCentrexlines Add_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Add.Click
txtCentrexLines ID.Enabled = True
txtCentrexLines Extension.Enabl ed = True
txtCentrexLines PublicDialNumbe r.Enabled = True
txtCentrexLines Notes.Enabled = True
txtCentrexLines CabNumber.Enabl ed = True
txtCentrexLines PatchPoint.Enab led = True
txtCentrexLines DP.Enabled = True
txtCentrexLines Pair.Enabled = True
txtCentrexLines Exchange.Enable d = True
txtCentrexLines PatchPanel.Enab led = True
dtpCentrexLines InstallationDat e.Enabled = True
cboCentrexLines DDI.Enabled = True
cboCentrexLines Type.Enabled = True
cboCentrexLines Department.Enab led = True
cboCentrexLines Site.Enabled = True
cboCentrexLines PrimaryUser.Ena bled = True
Try
Me.BindingConte xt(dsCentrexLin es,
"Centrexlines") .EndCurrentEdit ()
Me.BindingConte xt(dsCentrexLin es, "Centrexlines") .AddNew()
Catch eEndEdit As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eEndEdit .Message)
End Try
End Sub
Private Sub btnCentrexlines Cancel_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Cancel.Click
Me.BindingConte xt(dsCentrexLin es,
"Centrexlines") .CancelCurrentE dit()
txtCentrexLines ID.Enabled = False
txtCentrexLines Extension.Enabl ed = False
txtCentrexLines PublicDialNumbe r.Enabled = False
txtCentrexLines Notes.Enabled = False
txtCentrexLines CabNumber.Enabl ed = False
txtCentrexLines PatchPoint.Enab led = False
txtCentrexLines DP.Enabled = False
txtCentrexLines Pair.Enabled = False
txtCentrexLines Exchange.Enable d = False
txtCentrexLines PatchPanel.Enab led = False
dtpCentrexLines InstallationDat e.Enabled = False
cboCentrexLines DDI.Enabled = False
cboCentrexLines Type.Enabled = False
cboCentrexLines Department.Enab led = False
cboCentrexLines Site.Enabled = False
cboCentrexLines PrimaryUser.Ena bled = False
End Sub
Private Sub btnCentrexlines Update_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Update.Click
Try
Dim objDataSetChang es As Excellence.NET. dsCentrexLines = New
Excellence.NET. dsCentrexLines( )
Me.BindingConte xt(dsCentrexLin es,
"Centrexlines") .EndCurrentEdit ()
objDataSetChang es = CType(dsCentrex Lines.GetChange s,
Excellence.NET. dsCentrexLines)
If (Not (objDataSetChan ges) Is Nothing) Then
Try
If (Not (dsCentrexLines ) Is Nothing) Then
Me.odcPhones.Op en()
Me.odaCommsType .Fill(dsCentrex Lines)
Me.odaSites.Fil l(dsCentrexLine s)
Me.odaDepartmen ts.Fill(dsCentr exLines)
Me.odaPrimaryUs er.Fill(dsCentr exLines)
Me.odaCentrexLi nes.Fill(dsCent rexLines)
End If
Catch updateException As System.Exceptio n
Throw updateException
Finally
Me.odcPhones.Cl ose()
End Try
End If
dsCentrexLines. Merge(objDataSe tChanges)
dsCentrexLines. AcceptChanges()
Catch eUpdate As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eUpdate. Message)
End Try
txtCentrexLines ID.Enabled = False
txtCentrexLines Extension.Enabl ed = False
txtCentrexLines PublicDialNumbe r.Enabled = False
txtCentrexLines Notes.Enabled = False
txtCentrexLines CabNumber.Enabl ed = False
txtCentrexLines PatchPoint.Enab led = False
txtCentrexLines DP.Enabled = False
txtCentrexLines Pair.Enabled = False
txtCentrexLines Exchange.Enable d = False
txtCentrexLines PatchPanel.Enab led = False
dtpCentrexLines InstallationDat e.Enabled = False
cboCentrexLines DDI.Enabled = False
cboCentrexLines Type.Enabled = False
cboCentrexLines Department.Enab led = False
cboCentrexLines Site.Enabled = False
cboCentrexLines PrimaryUser.Ena bled = False
End Sub
Private Sub btnCentrexlines Edit_Click(ByVa l sender As System.Object,
ByVal e As System.EventArg s) Handles btnCentrexLines Edit.Click
txtCentrexLines ID.Enabled = True
txtCentrexLines Extension.Enabl ed = True
txtCentrexLines PublicDialNumbe r.Enabled = True
txtCentrexLines Notes.Enabled = True
txtCentrexLines CabNumber.Enabl ed = True
txtCentrexLines PatchPoint.Enab led = True
txtCentrexLines DP.Enabled = True
txtCentrexLines Pair.Enabled = True
txtCentrexLines Exchange.Enable d = True
txtCentrexLines PatchPanel.Enab led = True
dtpCentrexLines InstallationDat e.Enabled = True
cboCentrexLines DDI.Enabled = True
cboCentrexLines Type.Enabled = True
cboCentrexLines Department.Enab led = True
cboCentrexLines Site.Enabled = True
cboCentrexLines PrimaryUser.Ena bled = True
End Sub
'Centrexlines Code Finish
'Mobile Phones Code Start
Private Sub btnMobilePhones Delete_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Delete.Click
If (Me.BindingCont ext(dsMobiles, "MobilePhones") .Count > 0) Then
Me.BindingConte xt(dsMobiles,
"MobilePhones") .RemoveAt(Me.Bi ndingContext(ds Mobiles,
"MobilePhones") .Position)
End If
End Sub
Private Sub btnMobilePhones Add_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Add.Click
txtMobilePhones ID.Enabled = True
txtMobilePhones MobileNumber.En abled = True
txtMobilePhones Data.Enabled = True
txtMobilePhones Fax.Enabled = True
txtMobilePhones SDC.Enabled = True
dtpMobilePhones ContractStartDa te.Enabled = True
cboMobilePhones Department.Enab led = True
cboMobilePhones PrimaryUser.Ena bled = True
cboMobilePhones GPRSTariff.Enab led = True
Try
Me.BindingConte xt(dsMobiles, "MobilePhones") .EndCurrentEdit ()
Me.BindingConte xt(dsMobiles, "MobilePhones") .AddNew()
Catch eEndEdit As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eEndEdit .Message)
End Try
End Sub
Private Sub btnMobilePhones Cancel_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Cancel.Click
Me.BindingConte xt(dsMobiles, "MobilePhones") .CancelCurrentE dit()
txtMobilePhones ID.Enabled = False
txtMobilePhones MobileNumber.En abled = False
txtMobilePhones Data.Enabled = False
txtMobilePhones Fax.Enabled = False
txtMobilePhones SDC.Enabled = False
dtpMobilePhones ContractStartDa te.Enabled = False
cboMobilePhones Department.Enab led = False
cboMobilePhones PrimaryUser.Ena bled = False
cboMobilePhones GPRSTariff.Enab led = False
End Sub
Private Sub btnMobilePhones Update_Click(By Val sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Update.Click
Try
Dim objDataSetChang es As Excellence.NET. dsMobiles = New
Excellence.NET. dsMobiles()
Me.BindingConte xt(dsMobiles, "MobilePhones") .EndCurrentEdit ()
objDataSetChang es = CType(dsMobiles .GetChanges,
Excellence.NET. dsMobiles)
If (Not (objDataSetChan ges) Is Nothing) Then
Try
If (Not (dsMobiles) Is Nothing) Then
Me.odcPhones.Op en()
Me.odaDepartmen ts.Fill(dsMobil es)
Me.odaPrimaryUs er.Fill(dsMobil es)
Me.odaGPRSTarri f.Fill(dsMobile s)
Me.odaMobiles.F ill(dsMobiles)
End If
Catch updateException As System.Exceptio n
Throw updateException
Finally
Me.odcPhones.Cl ose()
End Try
End If
dsMobiles.Merge (objDataSetChan ges)
dsMobiles.Accep tChanges()
Catch eUpdate As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eUpdate. Message)
End Try
txtMobilePhones ID.Enabled = False
txtMobilePhones MobileNumber.En abled = False
txtMobilePhones Data.Enabled = False
txtMobilePhones Fax.Enabled = False
txtMobilePhones SDC.Enabled = False
dtpMobilePhones ContractStartDa te.Enabled = False
cboMobilePhones Department.Enab led = False
cboMobilePhones PrimaryUser.Ena bled = False
cboMobilePhones GPRSTariff.Enab led = False
End Sub
Private Sub btnMobilePhones Edit_Click(ByVa l sender As System.Object,
ByVal e As System.EventArg s) Handles btnMobilePhones Edit.Click
txtMobilePhones ID.Enabled = True
txtMobilePhones MobileNumber.En abled = True
txtMobilePhones Data.Enabled = True
txtMobilePhones Fax.Enabled = True
txtMobilePhones SDC.Enabled = True
dtpMobilePhones ContractStartDa te.Enabled = True
cboMobilePhones Department.Enab led = True
cboMobilePhones PrimaryUser.Ena bled = True
cboMobilePhones GPRSTariff.Enab led = True
End Sub
'Mobile Phones Code Finish
'ISDN Lines Code Start
Private Sub btnISDNLinesDel ete_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnISDNLinesDel ete.Click
If (Me.BindingCont ext(dsISDNLines , "ISDNLines").Co unt > 0) Then
Me.BindingConte xt(dsISDNLines,
"ISDNLines").Re moveAt(Me.Bindi ngContext(dsISD NLines, "ISDNLines").Po sition)
End If
End Sub
Private Sub btnISDNLinesAdd _Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnISDNLinesAdd .Click
txtISDNLinesID. Enabled = True
txtISDNLinesPri maryNumber.Enab led = True
txtISDNLinesSec ondaryNumber.En abled = True
txtISDNLinesNot es.Enabled = True
txtISDNLinesCab .Enabled = True
txtISDNLinesPat ch.Enabled = True
txtISDNLinesPoi nt.Enabled = True
txtISDNLinesDP. Enabled = True
txtISDNLinesPai r.Enabled = True
txtISDNLinesExc hange.Enabled = True
cboISDNLinesPri maryUser.Enable d = True
cboISDNLinesDep artment.Enabled = True
cboISDNLinesTyp e.Enabled = True
cboISDNLinesCar rier.Enabled = True
cboISDNLinesSit e.Enabled = True
dtpISDNLinesIns tallationDate.E nabled = True
Try
Me.BindingConte xt(dsISDNLines, "ISDNLines").En dCurrentEdit()
Me.BindingConte xt(dsISDNLines, "ISDNLines").Ad dNew()
Catch eEndEdit As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eEndEdit .Message)
End Try
End Sub
Private Sub btnISDNLinesCan cel_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnISDNLinesCan cel.Click
Me.BindingConte xt(dsISDNLines, "ISDNLines").Ca ncelCurrentEdit ()
txtISDNLinesID. Enabled = False
txtISDNLinesPri maryNumber.Enab led = False
txtISDNLinesSec ondaryNumber.En abled = False
txtISDNLinesNot es.Enabled = False
txtISDNLinesCab .Enabled = False
txtISDNLinesPat ch.Enabled = False
txtISDNLinesPoi nt.Enabled = False
txtISDNLinesDP. Enabled = False
txtISDNLinesPai r.Enabled = False
txtISDNLinesExc hange.Enabled = False
cboISDNLinesPri maryUser.Enable d = False
cboISDNLinesDep artment.Enabled = False
cboISDNLinesTyp e.Enabled = False
cboISDNLinesCar rier.Enabled = False
cboISDNLinesSit e.Enabled = False
dtpISDNLinesIns tallationDate.E nabled = False
End Sub
Private Sub btnISDNLinesUpd ate_Click(ByVal sender As System.Object,
ByVal e As System.EventArg s) Handles btnISDNLinesUpd ate.Click
Try
Dim objDataSetChang es As Excellence.NET. dsISDNLines = New
Excellence.NET. dsISDNLines()
Me.BindingConte xt(dsISDNLines, "ISDNLines").En dCurrentEdit()
objDataSetChang es = CType(dsISDNLin es.GetChanges,
Excellence.NET. dsISDNLines)
If (Not (objDataSetChan ges) Is Nothing) Then
Try
If (Not (dsISDNLines) Is Nothing) Then
Me.odcPhones.Op en()
Me.odaDepartmen ts.Fill(dsISDNL ines)
Me.odaCommsType .Fill(dsISDNLin es)
Me.odaDepartmen ts.Fill(dsISDNL ines)
Me.odaPrimaryUs er.Fill(dsISDNL ines)
Me.odaCommsCarr ier.Fill(dsISDN Lines)
Me.odaISDNLines .Fill(dsISDNLin es)
End If
Catch updateException As System.Exceptio n
Throw updateException
Finally
Me.odcPhones.Cl ose()
End Try
End If
dsISDNLines.Mer ge(objDataSetCh anges)
dsISDNLines.Acc eptChanges()
Catch eUpdate As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eUpdate. Message)
End Try
txtISDNLinesID. Enabled = False
txtISDNLinesPri maryNumber.Enab led = False
txtISDNLinesSec ondaryNumber.En abled = False
txtISDNLinesNot es.Enabled = False
txtISDNLinesCab .Enabled = False
txtISDNLinesPat ch.Enabled = False
txtISDNLinesPoi nt.Enabled = False
txtISDNLinesDP. Enabled = False
txtISDNLinesPai r.Enabled = False
txtISDNLinesExc hange.Enabled = False
cboISDNLinesPri maryUser.Enable d = False
cboISDNLinesDep artment.Enabled = False
cboISDNLinesTyp e.Enabled = False
cboISDNLinesCar rier.Enabled = False
cboISDNLinesSit e.Enabled = False
dtpISDNLinesIns tallationDate.E nabled = False
End Sub
Private Sub btnISDNLinesEdi t_Click(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles btnISDNLinesEdi t.Click
txtISDNLinesID. Enabled = True
txtISDNLinesPri maryNumber.Enab led = True
txtISDNLinesSec ondaryNumber.En abled = True
txtISDNLinesNot es.Enabled = True
txtISDNLinesCab .Enabled = True
txtISDNLinesPat ch.Enabled = True
txtISDNLinesPoi nt.Enabled = True
txtISDNLinesDP. Enabled = True
txtISDNLinesPai r.Enabled = True
txtISDNLinesExc hange.Enabled = True
cboISDNLinesPri maryUser.Enable d = True
cboISDNLinesDep artment.Enabled = True
cboISDNLinesTyp e.Enabled = True
cboISDNLinesCar rier.Enabled = True
cboISDNLinesSit e.Enabled = True
dtpISDNLinesIns tallationDate.E nabled = True
End Sub
'ISDN Lines Code Finish
'BT Lines Code Start
Private Sub btnBTLinesDelet e_Click(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles btnBTLinesDelet e.Click
If (Me.BindingCont ext(dsBTLines, "BTLines").Coun t > 0) Then
Me.BindingConte xt(dsBTLines,
"BTLines").Remo veAt(Me.Binding Context(dsBTLin es, "BTLines").Posi tion)
End If
End Sub
Private Sub btnBTLinesAdd_C lick(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnBTLinesAdd.C lick
txtBTLinesID.En abled = True
txtBTLinesNumbe r.Enabled = True
txtBTLinesAccou ntNumber.Enable d = True
txtBTLinesNotes .Enabled = True
txtBTLinesDP.En abled = True
txtBTLinesPair. Enabled = True
txtBTLinesExcha nge.Enabled = True
cboBTLinesPrima ryUser.Enabled = True
cboBTLinesType. Enabled = True
cboBTLinesSite. Enabled = True
dtpBTLinesInsta llationDate.Ena bled = True
Try
Me.BindingConte xt(dsBTLines, "BTLines").EndC urrentEdit()
Me.BindingConte xt(dsBTLines, "BTLines").AddN ew()
Catch eEndEdit As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eEndEdit .Message)
End Try
End Sub
Private Sub btnBTLinesCance l_Click(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles btnBTLinesCance l.Click
Me.BindingConte xt(dsBTLines, "BTLines").Canc elCurrentEdit()
txtBTLinesID.En abled = False
txtBTLinesNumbe r.Enabled = False
txtBTLinesAccou ntNumber.Enable d = False
txtBTLinesNotes .Enabled = False
txtBTLinesDP.En abled = False
txtBTLinesPair. Enabled = False
txtBTLinesExcha nge.Enabled = False
cboBTLinesPrima ryUser.Enabled = False
cboBTLinesType. Enabled = False
cboBTLinesSite. Enabled = False
dtpBTLinesInsta llationDate.Ena bled = False
End Sub
Private Sub btnBTLinesUpdat e_Click(ByVal sender As System.Object, ByVal
e As System.EventArg s) Handles btnBTLinesUpdat e.Click
Try
Dim objDataSetChang es As Excellence.NET. dsBTLines = New
Excellence.NET. dsBTLines()
Me.BindingConte xt(dsBTLines, "BTLines").EndC urrentEdit()
objDataSetChang es = CType(dsBTLines .GetChanges,
Excellence.NET. dsBTLines)
If (Not (objDataSetChan ges) Is Nothing) Then
Try
If (Not (dsBTLines) Is Nothing) Then
Me.odcPhones.Op en()
Me.odaSites.Fil l(dsBTLines)
Me.odaPrimaryUs er.Fill(dsBTLin es)
Me.odaCommsType .Fill(dsBTLines )
Me.odaBTLines.F ill(dsBTLines)
End If
Catch updateException As System.Exceptio n
Throw updateException
Finally
Me.odcPhones.Cl ose()
End Try
End If
dsBTLines.Merge (objDataSetChan ges)
dsBTLines.Accep tChanges()
Catch eUpdate As System.Exceptio n
System.Windows. Forms.MessageBo x.Show(eUpdate. Message)
End Try
txtBTLinesID.En abled = False
txtBTLinesNumbe r.Enabled = False
txtBTLinesAccou ntNumber.Enable d = False
txtBTLinesNotes .Enabled = False
txtBTLinesDP.En abled = False
txtBTLinesPair. Enabled = False
txtBTLinesExcha nge.Enabled = False
cboBTLinesPrima ryUser.Enabled = False
cboBTLinesType. Enabled = False
cboBTLinesSite. Enabled = False
dtpBTLinesInsta llationDate.Ena bled = True
End Sub
Private Sub btnBTLinesEdit_ Click(ByVal sender As System.Object, ByVal e
As System.EventArg s) Handles btnBTLinesEdit. Click
txtBTLinesID.En abled = True
txtBTLinesNumbe r.Enabled = True
txtBTLinesAccou ntNumber.Enable d = True
txtBTLinesNotes .Enabled = True
txtBTLinesDP.En abled = True
txtBTLinesPair. Enabled = True
txtBTLinesExcha nge.Enabled = True
cboBTLinesPrima ryUser.Enabled = True
cboBTLinesType. Enabled = True
cboBTLinesSite. Enabled = True
dtpBTLinesInsta llationDate.Ena bled = True
End Sub
'BT Lines Code Finish
"Cor Ligthert" <no**********@p lanet.nl> wrote in message
news:ec******** ******@TK2MSFTN GP10.phx.gbl...
Hi Mad,
This is not knowing, this is guessing.
Can you do a BindingContext( ds.Tables"yourt able").EndCurre ntEdit() before
that row.
Maybe did you create a new row with the BindingContext and is it not yet
in your table.
Just a gues do not shoot when it is wrong
Cor