'------------------------------------------------------------------------------ ' ' This code was generated by a tool. ' Runtime Version:2.0.50727.4927 ' ' Changes to this file may cause incorrect behavior and will be lost if ' the code is regenerated. ' '------------------------------------------------------------------------------ Option Strict Off Option Explicit On ''' '''Represents a strongly typed in-memory cache of data. ''' _ Partial Public Class PIDataSet Inherits Global.System.Data.DataSet Private tableeh_evidencija As eh_evidencijaDataTable Private tableeh_ispiti As eh_ispitiDataTable Private tableeh_studenti As eh_studentiDataTable Private tableeh_studenti1 As eh_studenti1DataTable Private relationFK__eh_eviden__id_is__09DE7BCC As Global.System.Data.DataRelation Private relationFK__eh_eviden__id_st__08EA5793 As Global.System.Data.DataRelation Private _schemaSerializationMode As Global.System.Data.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema _ Public Sub New() MyBase.New Me.BeginInit Me.InitClass Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler MyBase.Relations.CollectionChanged, schemaChangedHandler Me.EndInit End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context, false) If (Me.IsBinarySerialized(info, context) = true) Then Me.InitVars(false) Dim schemaChangedHandler1 As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler Me.Tables.CollectionChanged, schemaChangedHandler1 AddHandler Me.Relations.CollectionChanged, schemaChangedHandler1 Return End If Dim strSchema As String = CType(info.GetValue("XmlSchema", GetType(String)),String) If (Me.DetermineSchemaSerializationMode(info, context) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet ds.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) If (Not (ds.Tables("eh_evidencija")) Is Nothing) Then MyBase.Tables.Add(New eh_evidencijaDataTable(ds.Tables("eh_evidencija"))) End If If (Not (ds.Tables("eh_ispiti")) Is Nothing) Then MyBase.Tables.Add(New eh_ispitiDataTable(ds.Tables("eh_ispiti"))) End If If (Not (ds.Tables("eh_studenti")) Is Nothing) Then MyBase.Tables.Add(New eh_studentiDataTable(ds.Tables("eh_studenti"))) End If If (Not (ds.Tables("eh_studenti1")) Is Nothing) Then MyBase.Tables.Add(New eh_studenti1DataTable(ds.Tables("eh_studenti1"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXmlSchema(New Global.System.Xml.XmlTextReader(New Global.System.IO.StringReader(strSchema))) End If Me.GetSerializationData(info, context) Dim schemaChangedHandler As Global.System.ComponentModel.CollectionChangeEventHandler = AddressOf Me.SchemaChanged AddHandler MyBase.Tables.CollectionChanged, schemaChangedHandler AddHandler Me.Relations.CollectionChanged, schemaChangedHandler End Sub _ Public ReadOnly Property eh_evidencija() As eh_evidencijaDataTable Get Return Me.tableeh_evidencija End Get End Property _ Public ReadOnly Property eh_ispiti() As eh_ispitiDataTable Get Return Me.tableeh_ispiti End Get End Property _ Public ReadOnly Property eh_studenti() As eh_studentiDataTable Get Return Me.tableeh_studenti End Get End Property _ Public ReadOnly Property eh_studenti1() As eh_studenti1DataTable Get Return Me.tableeh_studenti1 End Get End Property _ Public Overrides Property SchemaSerializationMode() As Global.System.Data.SchemaSerializationMode Get Return Me._schemaSerializationMode End Get Set Me._schemaSerializationMode = value End Set End Property _ Public Shadows ReadOnly Property Tables() As Global.System.Data.DataTableCollection Get Return MyBase.Tables End Get End Property _ Public Shadows ReadOnly Property Relations() As Global.System.Data.DataRelationCollection Get Return MyBase.Relations End Get End Property _ Protected Overrides Sub InitializeDerivedDataSet() Me.BeginInit Me.InitClass Me.EndInit End Sub _ Public Overrides Function Clone() As Global.System.Data.DataSet Dim cln As PIDataSet = CType(MyBase.Clone,PIDataSet) cln.InitVars cln.SchemaSerializationMode = Me.SchemaSerializationMode Return cln End Function _ Protected Overrides Function ShouldSerializeTables() As Boolean Return false End Function _ Protected Overrides Function ShouldSerializeRelations() As Boolean Return false End Function _ Protected Overrides Sub ReadXmlSerializable(ByVal reader As Global.System.Xml.XmlReader) If (Me.DetermineSchemaSerializationMode(reader) = Global.System.Data.SchemaSerializationMode.IncludeSchema) Then Me.Reset Dim ds As Global.System.Data.DataSet = New Global.System.Data.DataSet ds.ReadXml(reader) If (Not (ds.Tables("eh_evidencija")) Is Nothing) Then MyBase.Tables.Add(New eh_evidencijaDataTable(ds.Tables("eh_evidencija"))) End If If (Not (ds.Tables("eh_ispiti")) Is Nothing) Then MyBase.Tables.Add(New eh_ispitiDataTable(ds.Tables("eh_ispiti"))) End If If (Not (ds.Tables("eh_studenti")) Is Nothing) Then MyBase.Tables.Add(New eh_studentiDataTable(ds.Tables("eh_studenti"))) End If If (Not (ds.Tables("eh_studenti1")) Is Nothing) Then MyBase.Tables.Add(New eh_studenti1DataTable(ds.Tables("eh_studenti1"))) End If Me.DataSetName = ds.DataSetName Me.Prefix = ds.Prefix Me.Namespace = ds.Namespace Me.Locale = ds.Locale Me.CaseSensitive = ds.CaseSensitive Me.EnforceConstraints = ds.EnforceConstraints Me.Merge(ds, false, Global.System.Data.MissingSchemaAction.Add) Me.InitVars Else Me.ReadXml(reader) Me.InitVars End If End Sub _ Protected Overrides Function GetSchemaSerializable() As Global.System.Xml.Schema.XmlSchema Dim stream As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Me.WriteXmlSchema(New Global.System.Xml.XmlTextWriter(stream, Nothing)) stream.Position = 0 Return Global.System.Xml.Schema.XmlSchema.Read(New Global.System.Xml.XmlTextReader(stream), Nothing) End Function _ Friend Overloads Sub InitVars() Me.InitVars(true) End Sub _ Friend Overloads Sub InitVars(ByVal initTable As Boolean) Me.tableeh_evidencija = CType(MyBase.Tables("eh_evidencija"),eh_evidencijaDataTable) If (initTable = true) Then If (Not (Me.tableeh_evidencija) Is Nothing) Then Me.tableeh_evidencija.InitVars End If End If Me.tableeh_ispiti = CType(MyBase.Tables("eh_ispiti"),eh_ispitiDataTable) If (initTable = true) Then If (Not (Me.tableeh_ispiti) Is Nothing) Then Me.tableeh_ispiti.InitVars End If End If Me.tableeh_studenti = CType(MyBase.Tables("eh_studenti"),eh_studentiDataTable) If (initTable = true) Then If (Not (Me.tableeh_studenti) Is Nothing) Then Me.tableeh_studenti.InitVars End If End If Me.tableeh_studenti1 = CType(MyBase.Tables("eh_studenti1"),eh_studenti1DataTable) If (initTable = true) Then If (Not (Me.tableeh_studenti1) Is Nothing) Then Me.tableeh_studenti1.InitVars End If End If Me.relationFK__eh_eviden__id_is__09DE7BCC = Me.Relations("FK__eh_eviden__id_is__09DE7BCC") Me.relationFK__eh_eviden__id_st__08EA5793 = Me.Relations("FK__eh_eviden__id_st__08EA5793") End Sub _ Private Sub InitClass() Me.DataSetName = "PIDataSet" Me.Prefix = "" Me.Namespace = "http://tempuri.org/PIDataSet.xsd" Me.EnforceConstraints = true Me.SchemaSerializationMode = Global.System.Data.SchemaSerializationMode.IncludeSchema Me.tableeh_evidencija = New eh_evidencijaDataTable MyBase.Tables.Add(Me.tableeh_evidencija) Me.tableeh_ispiti = New eh_ispitiDataTable MyBase.Tables.Add(Me.tableeh_ispiti) Me.tableeh_studenti = New eh_studentiDataTable MyBase.Tables.Add(Me.tableeh_studenti) Me.tableeh_studenti1 = New eh_studenti1DataTable MyBase.Tables.Add(Me.tableeh_studenti1) Me.relationFK__eh_eviden__id_is__09DE7BCC = New Global.System.Data.DataRelation("FK__eh_eviden__id_is__09DE7BCC", New Global.System.Data.DataColumn() {Me.tableeh_ispiti.id_ispitColumn}, New Global.System.Data.DataColumn() {Me.tableeh_evidencija.id_ispitColumn}, false) Me.Relations.Add(Me.relationFK__eh_eviden__id_is__09DE7BCC) Me.relationFK__eh_eviden__id_st__08EA5793 = New Global.System.Data.DataRelation("FK__eh_eviden__id_st__08EA5793", New Global.System.Data.DataColumn() {Me.tableeh_studenti.id_studentColumn}, New Global.System.Data.DataColumn() {Me.tableeh_evidencija.id_studentColumn}, false) Me.Relations.Add(Me.relationFK__eh_eviden__id_st__08EA5793) End Sub _ Private Function ShouldSerializeeh_evidencija() As Boolean Return false End Function _ Private Function ShouldSerializeeh_ispiti() As Boolean Return false End Function _ Private Function ShouldSerializeeh_studenti() As Boolean Return false End Function _ Private Function ShouldSerializeeh_studenti1() As Boolean Return false End Function _ Private Sub SchemaChanged(ByVal sender As Object, ByVal e As Global.System.ComponentModel.CollectionChangeEventArgs) If (e.Action = Global.System.ComponentModel.CollectionChangeAction.Remove) Then Me.InitVars End If End Sub _ Public Shared Function GetTypedDataSetSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim ds As PIDataSet = New PIDataSet Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence Dim any As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any.Namespace = ds.Namespace sequence.Items.Add(any) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function Public Delegate Sub eh_evidencijaRowChangeEventHandler(ByVal sender As Object, ByVal e As eh_evidencijaRowChangeEvent) Public Delegate Sub eh_ispitiRowChangeEventHandler(ByVal sender As Object, ByVal e As eh_ispitiRowChangeEvent) Public Delegate Sub eh_studentiRowChangeEventHandler(ByVal sender As Object, ByVal e As eh_studentiRowChangeEvent) Public Delegate Sub eh_studenti1RowChangeEventHandler(ByVal sender As Object, ByVal e As eh_studenti1RowChangeEvent) ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class eh_evidencijaDataTable Inherits Global.System.Data.DataTable Implements Global.System.Collections.IEnumerable Private columnid_student As Global.System.Data.DataColumn Private columnid_ispit As Global.System.Data.DataColumn Private columnocjena As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "eh_evidencija" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property id_studentColumn() As Global.System.Data.DataColumn Get Return Me.columnid_student End Get End Property _ Public ReadOnly Property id_ispitColumn() As Global.System.Data.DataColumn Get Return Me.columnid_ispit End Get End Property _ Public ReadOnly Property ocjenaColumn() As Global.System.Data.DataColumn Get Return Me.columnocjena End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As eh_evidencijaRow Get Return CType(Me.Rows(index),eh_evidencijaRow) End Get End Property Public Event eh_evidencijaRowChanging As eh_evidencijaRowChangeEventHandler Public Event eh_evidencijaRowChanged As eh_evidencijaRowChangeEventHandler Public Event eh_evidencijaRowDeleting As eh_evidencijaRowChangeEventHandler Public Event eh_evidencijaRowDeleted As eh_evidencijaRowChangeEventHandler _ Public Overloads Sub Addeh_evidencijaRow(ByVal row As eh_evidencijaRow) Me.Rows.Add(row) End Sub _ Public Overloads Function Addeh_evidencijaRow(ByVal parenteh_studentiRowByFK__eh_eviden__id_st__08EA5793 As eh_studentiRow, ByVal parenteh_ispitiRowByFK__eh_eviden__id_is__09DE7BCC As eh_ispitiRow, ByVal ocjena As Double) As eh_evidencijaRow Dim roweh_evidencijaRow As eh_evidencijaRow = CType(Me.NewRow,eh_evidencijaRow) Dim columnValuesArray() As Object = New Object() {Nothing, Nothing, ocjena} If (Not (parenteh_studentiRowByFK__eh_eviden__id_st__08EA5793) Is Nothing) Then columnValuesArray(0) = parenteh_studentiRowByFK__eh_eviden__id_st__08EA5793(0) End If If (Not (parenteh_ispitiRowByFK__eh_eviden__id_is__09DE7BCC) Is Nothing) Then columnValuesArray(1) = parenteh_ispitiRowByFK__eh_eviden__id_is__09DE7BCC(0) End If roweh_evidencijaRow.ItemArray = columnValuesArray Me.Rows.Add(roweh_evidencijaRow) Return roweh_evidencijaRow End Function _ Public Function FindByid_studentid_ispit(ByVal id_student As Integer, ByVal id_ispit As Integer) As eh_evidencijaRow Return CType(Me.Rows.Find(New Object() {id_student, id_ispit}),eh_evidencijaRow) End Function _ Public Overridable Function GetEnumerator() As Global.System.Collections.IEnumerator Implements Global.System.Collections.IEnumerable.GetEnumerator Return Me.Rows.GetEnumerator End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As eh_evidencijaDataTable = CType(MyBase.Clone,eh_evidencijaDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New eh_evidencijaDataTable End Function _ Friend Sub InitVars() Me.columnid_student = MyBase.Columns("id_student") Me.columnid_ispit = MyBase.Columns("id_ispit") Me.columnocjena = MyBase.Columns("ocjena") End Sub _ Private Sub InitClass() Me.columnid_student = New Global.System.Data.DataColumn("id_student", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnid_student) Me.columnid_ispit = New Global.System.Data.DataColumn("id_ispit", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnid_ispit) Me.columnocjena = New Global.System.Data.DataColumn("ocjena", GetType(Double), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnocjena) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnid_student, Me.columnid_ispit}, true)) Me.columnid_student.AllowDBNull = false Me.columnid_ispit.AllowDBNull = false End Sub _ Public Function Neweh_evidencijaRow() As eh_evidencijaRow Return CType(Me.NewRow,eh_evidencijaRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New eh_evidencijaRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(eh_evidencijaRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.eh_evidencijaRowChangedEvent) Is Nothing) Then RaiseEvent eh_evidencijaRowChanged(Me, New eh_evidencijaRowChangeEvent(CType(e.Row,eh_evidencijaRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.eh_evidencijaRowChangingEvent) Is Nothing) Then RaiseEvent eh_evidencijaRowChanging(Me, New eh_evidencijaRowChangeEvent(CType(e.Row,eh_evidencijaRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.eh_evidencijaRowDeletedEvent) Is Nothing) Then RaiseEvent eh_evidencijaRowDeleted(Me, New eh_evidencijaRowChangeEvent(CType(e.Row,eh_evidencijaRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.eh_evidencijaRowDeletingEvent) Is Nothing) Then RaiseEvent eh_evidencijaRowDeleting(Me, New eh_evidencijaRowChangeEvent(CType(e.Row,eh_evidencijaRow), e.Action)) End If End Sub _ Public Sub Removeeh_evidencijaRow(ByVal row As eh_evidencijaRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence Dim ds As PIDataSet = New PIDataSet Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute attribute2.Name = "tableTypeName" attribute2.FixedValue = "eh_evidencijaDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class eh_ispitiDataTable Inherits Global.System.Data.DataTable Implements Global.System.Collections.IEnumerable Private columnid_ispit As Global.System.Data.DataColumn Private columnnaziv As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "eh_ispiti" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property id_ispitColumn() As Global.System.Data.DataColumn Get Return Me.columnid_ispit End Get End Property _ Public ReadOnly Property nazivColumn() As Global.System.Data.DataColumn Get Return Me.columnnaziv End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As eh_ispitiRow Get Return CType(Me.Rows(index),eh_ispitiRow) End Get End Property Public Event eh_ispitiRowChanging As eh_ispitiRowChangeEventHandler Public Event eh_ispitiRowChanged As eh_ispitiRowChangeEventHandler Public Event eh_ispitiRowDeleting As eh_ispitiRowChangeEventHandler Public Event eh_ispitiRowDeleted As eh_ispitiRowChangeEventHandler _ Public Overloads Sub Addeh_ispitiRow(ByVal row As eh_ispitiRow) Me.Rows.Add(row) End Sub _ Public Overloads Function Addeh_ispitiRow(ByVal id_ispit As Integer, ByVal naziv As String) As eh_ispitiRow Dim roweh_ispitiRow As eh_ispitiRow = CType(Me.NewRow,eh_ispitiRow) Dim columnValuesArray() As Object = New Object() {id_ispit, naziv} roweh_ispitiRow.ItemArray = columnValuesArray Me.Rows.Add(roweh_ispitiRow) Return roweh_ispitiRow End Function _ Public Function FindByid_ispit(ByVal id_ispit As Integer) As eh_ispitiRow Return CType(Me.Rows.Find(New Object() {id_ispit}),eh_ispitiRow) End Function _ Public Overridable Function GetEnumerator() As Global.System.Collections.IEnumerator Implements Global.System.Collections.IEnumerable.GetEnumerator Return Me.Rows.GetEnumerator End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As eh_ispitiDataTable = CType(MyBase.Clone,eh_ispitiDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New eh_ispitiDataTable End Function _ Friend Sub InitVars() Me.columnid_ispit = MyBase.Columns("id_ispit") Me.columnnaziv = MyBase.Columns("naziv") End Sub _ Private Sub InitClass() Me.columnid_ispit = New Global.System.Data.DataColumn("id_ispit", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnid_ispit) Me.columnnaziv = New Global.System.Data.DataColumn("naziv", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnnaziv) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnid_ispit}, true)) Me.columnid_ispit.AllowDBNull = false Me.columnid_ispit.Unique = true Me.columnnaziv.MaxLength = 30 End Sub _ Public Function Neweh_ispitiRow() As eh_ispitiRow Return CType(Me.NewRow,eh_ispitiRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New eh_ispitiRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(eh_ispitiRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.eh_ispitiRowChangedEvent) Is Nothing) Then RaiseEvent eh_ispitiRowChanged(Me, New eh_ispitiRowChangeEvent(CType(e.Row,eh_ispitiRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.eh_ispitiRowChangingEvent) Is Nothing) Then RaiseEvent eh_ispitiRowChanging(Me, New eh_ispitiRowChangeEvent(CType(e.Row,eh_ispitiRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.eh_ispitiRowDeletedEvent) Is Nothing) Then RaiseEvent eh_ispitiRowDeleted(Me, New eh_ispitiRowChangeEvent(CType(e.Row,eh_ispitiRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.eh_ispitiRowDeletingEvent) Is Nothing) Then RaiseEvent eh_ispitiRowDeleting(Me, New eh_ispitiRowChangeEvent(CType(e.Row,eh_ispitiRow), e.Action)) End If End Sub _ Public Sub Removeeh_ispitiRow(ByVal row As eh_ispitiRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence Dim ds As PIDataSet = New PIDataSet Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute attribute2.Name = "tableTypeName" attribute2.FixedValue = "eh_ispitiDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class eh_studentiDataTable Inherits Global.System.Data.DataTable Implements Global.System.Collections.IEnumerable Private columnid_student As Global.System.Data.DataColumn Private columnime_p As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "eh_studenti" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property id_studentColumn() As Global.System.Data.DataColumn Get Return Me.columnid_student End Get End Property _ Public ReadOnly Property ime_pColumn() As Global.System.Data.DataColumn Get Return Me.columnime_p End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As eh_studentiRow Get Return CType(Me.Rows(index),eh_studentiRow) End Get End Property Public Event eh_studentiRowChanging As eh_studentiRowChangeEventHandler Public Event eh_studentiRowChanged As eh_studentiRowChangeEventHandler Public Event eh_studentiRowDeleting As eh_studentiRowChangeEventHandler Public Event eh_studentiRowDeleted As eh_studentiRowChangeEventHandler _ Public Overloads Sub Addeh_studentiRow(ByVal row As eh_studentiRow) Me.Rows.Add(row) End Sub _ Public Overloads Function Addeh_studentiRow(ByVal id_student As Integer, ByVal ime_p As String) As eh_studentiRow Dim roweh_studentiRow As eh_studentiRow = CType(Me.NewRow,eh_studentiRow) Dim columnValuesArray() As Object = New Object() {id_student, ime_p} roweh_studentiRow.ItemArray = columnValuesArray Me.Rows.Add(roweh_studentiRow) Return roweh_studentiRow End Function _ Public Function FindByid_student(ByVal id_student As Integer) As eh_studentiRow Return CType(Me.Rows.Find(New Object() {id_student}),eh_studentiRow) End Function _ Public Overridable Function GetEnumerator() As Global.System.Collections.IEnumerator Implements Global.System.Collections.IEnumerable.GetEnumerator Return Me.Rows.GetEnumerator End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As eh_studentiDataTable = CType(MyBase.Clone,eh_studentiDataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New eh_studentiDataTable End Function _ Friend Sub InitVars() Me.columnid_student = MyBase.Columns("id_student") Me.columnime_p = MyBase.Columns("ime_p") End Sub _ Private Sub InitClass() Me.columnid_student = New Global.System.Data.DataColumn("id_student", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnid_student) Me.columnime_p = New Global.System.Data.DataColumn("ime_p", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnime_p) Me.Constraints.Add(New Global.System.Data.UniqueConstraint("Constraint1", New Global.System.Data.DataColumn() {Me.columnid_student}, true)) Me.columnid_student.AllowDBNull = false Me.columnid_student.Unique = true Me.columnime_p.MaxLength = 30 End Sub _ Public Function Neweh_studentiRow() As eh_studentiRow Return CType(Me.NewRow,eh_studentiRow) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New eh_studentiRow(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(eh_studentiRow) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.eh_studentiRowChangedEvent) Is Nothing) Then RaiseEvent eh_studentiRowChanged(Me, New eh_studentiRowChangeEvent(CType(e.Row,eh_studentiRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.eh_studentiRowChangingEvent) Is Nothing) Then RaiseEvent eh_studentiRowChanging(Me, New eh_studentiRowChangeEvent(CType(e.Row,eh_studentiRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.eh_studentiRowDeletedEvent) Is Nothing) Then RaiseEvent eh_studentiRowDeleted(Me, New eh_studentiRowChangeEvent(CType(e.Row,eh_studentiRow), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.eh_studentiRowDeletingEvent) Is Nothing) Then RaiseEvent eh_studentiRowDeleting(Me, New eh_studentiRowChangeEvent(CType(e.Row,eh_studentiRow), e.Action)) End If End Sub _ Public Sub Removeeh_studentiRow(ByVal row As eh_studentiRow) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence Dim ds As PIDataSet = New PIDataSet Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute attribute2.Name = "tableTypeName" attribute2.FixedValue = "eh_studentiDataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents the strongly named DataTable class. ''' _ Partial Public Class eh_studenti1DataTable Inherits Global.System.Data.DataTable Implements Global.System.Collections.IEnumerable Private columnIme_i_prezime As Global.System.Data.DataColumn Private columnBroj_polozenih_ispita As Global.System.Data.DataColumn Private columnProsjek_ocjena As Global.System.Data.DataColumn _ Public Sub New() MyBase.New Me.TableName = "eh_studenti1" Me.BeginInit Me.InitClass Me.EndInit End Sub _ Friend Sub New(ByVal table As Global.System.Data.DataTable) MyBase.New Me.TableName = table.TableName If (table.CaseSensitive <> table.DataSet.CaseSensitive) Then Me.CaseSensitive = table.CaseSensitive End If If (table.Locale.ToString <> table.DataSet.Locale.ToString) Then Me.Locale = table.Locale End If If (table.Namespace <> table.DataSet.Namespace) Then Me.Namespace = table.Namespace End If Me.Prefix = table.Prefix Me.MinimumCapacity = table.MinimumCapacity End Sub _ Protected Sub New(ByVal info As Global.System.Runtime.Serialization.SerializationInfo, ByVal context As Global.System.Runtime.Serialization.StreamingContext) MyBase.New(info, context) Me.InitVars End Sub _ Public ReadOnly Property Ime_i_prezimeColumn() As Global.System.Data.DataColumn Get Return Me.columnIme_i_prezime End Get End Property _ Public ReadOnly Property Broj_polozenih_ispitaColumn() As Global.System.Data.DataColumn Get Return Me.columnBroj_polozenih_ispita End Get End Property _ Public ReadOnly Property Prosjek_ocjenaColumn() As Global.System.Data.DataColumn Get Return Me.columnProsjek_ocjena End Get End Property _ Public ReadOnly Property Count() As Integer Get Return Me.Rows.Count End Get End Property _ Public Default ReadOnly Property Item(ByVal index As Integer) As eh_studenti1Row Get Return CType(Me.Rows(index),eh_studenti1Row) End Get End Property Public Event eh_studenti1RowChanging As eh_studenti1RowChangeEventHandler Public Event eh_studenti1RowChanged As eh_studenti1RowChangeEventHandler Public Event eh_studenti1RowDeleting As eh_studenti1RowChangeEventHandler Public Event eh_studenti1RowDeleted As eh_studenti1RowChangeEventHandler _ Public Overloads Sub Addeh_studenti1Row(ByVal row As eh_studenti1Row) Me.Rows.Add(row) End Sub _ Public Overloads Function Addeh_studenti1Row(ByVal Ime_i_prezime As String, ByVal Broj_polozenih_ispita As Integer, ByVal Prosjek_ocjena As Double) As eh_studenti1Row Dim roweh_studenti1Row As eh_studenti1Row = CType(Me.NewRow,eh_studenti1Row) Dim columnValuesArray() As Object = New Object() {Ime_i_prezime, Broj_polozenih_ispita, Prosjek_ocjena} roweh_studenti1Row.ItemArray = columnValuesArray Me.Rows.Add(roweh_studenti1Row) Return roweh_studenti1Row End Function _ Public Overridable Function GetEnumerator() As Global.System.Collections.IEnumerator Implements Global.System.Collections.IEnumerable.GetEnumerator Return Me.Rows.GetEnumerator End Function _ Public Overrides Function Clone() As Global.System.Data.DataTable Dim cln As eh_studenti1DataTable = CType(MyBase.Clone,eh_studenti1DataTable) cln.InitVars Return cln End Function _ Protected Overrides Function CreateInstance() As Global.System.Data.DataTable Return New eh_studenti1DataTable End Function _ Friend Sub InitVars() Me.columnIme_i_prezime = MyBase.Columns("Ime i prezime") Me.columnBroj_polozenih_ispita = MyBase.Columns("Broj polozenih ispita") Me.columnProsjek_ocjena = MyBase.Columns("Prosjek ocjena") End Sub _ Private Sub InitClass() Me.columnIme_i_prezime = New Global.System.Data.DataColumn("Ime i prezime", GetType(String), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnIme_i_prezime) Me.columnBroj_polozenih_ispita = New Global.System.Data.DataColumn("Broj polozenih ispita", GetType(Integer), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnBroj_polozenih_ispita) Me.columnProsjek_ocjena = New Global.System.Data.DataColumn("Prosjek ocjena", GetType(Double), Nothing, Global.System.Data.MappingType.Element) MyBase.Columns.Add(Me.columnProsjek_ocjena) Me.columnIme_i_prezime.MaxLength = 30 Me.columnBroj_polozenih_ispita.ReadOnly = true Me.columnProsjek_ocjena.ReadOnly = true End Sub _ Public Function Neweh_studenti1Row() As eh_studenti1Row Return CType(Me.NewRow,eh_studenti1Row) End Function _ Protected Overrides Function NewRowFromBuilder(ByVal builder As Global.System.Data.DataRowBuilder) As Global.System.Data.DataRow Return New eh_studenti1Row(builder) End Function _ Protected Overrides Function GetRowType() As Global.System.Type Return GetType(eh_studenti1Row) End Function _ Protected Overrides Sub OnRowChanged(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanged(e) If (Not (Me.eh_studenti1RowChangedEvent) Is Nothing) Then RaiseEvent eh_studenti1RowChanged(Me, New eh_studenti1RowChangeEvent(CType(e.Row,eh_studenti1Row), e.Action)) End If End Sub _ Protected Overrides Sub OnRowChanging(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowChanging(e) If (Not (Me.eh_studenti1RowChangingEvent) Is Nothing) Then RaiseEvent eh_studenti1RowChanging(Me, New eh_studenti1RowChangeEvent(CType(e.Row,eh_studenti1Row), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleted(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleted(e) If (Not (Me.eh_studenti1RowDeletedEvent) Is Nothing) Then RaiseEvent eh_studenti1RowDeleted(Me, New eh_studenti1RowChangeEvent(CType(e.Row,eh_studenti1Row), e.Action)) End If End Sub _ Protected Overrides Sub OnRowDeleting(ByVal e As Global.System.Data.DataRowChangeEventArgs) MyBase.OnRowDeleting(e) If (Not (Me.eh_studenti1RowDeletingEvent) Is Nothing) Then RaiseEvent eh_studenti1RowDeleting(Me, New eh_studenti1RowChangeEvent(CType(e.Row,eh_studenti1Row), e.Action)) End If End Sub _ Public Sub Removeeh_studenti1Row(ByVal row As eh_studenti1Row) Me.Rows.Remove(row) End Sub _ Public Shared Function GetTypedTableSchema(ByVal xs As Global.System.Xml.Schema.XmlSchemaSet) As Global.System.Xml.Schema.XmlSchemaComplexType Dim type As Global.System.Xml.Schema.XmlSchemaComplexType = New Global.System.Xml.Schema.XmlSchemaComplexType Dim sequence As Global.System.Xml.Schema.XmlSchemaSequence = New Global.System.Xml.Schema.XmlSchemaSequence Dim ds As PIDataSet = New PIDataSet Dim any1 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any1.Namespace = "http://www.w3.org/2001/XMLSchema" any1.MinOccurs = New Decimal(0) any1.MaxOccurs = Decimal.MaxValue any1.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any1) Dim any2 As Global.System.Xml.Schema.XmlSchemaAny = New Global.System.Xml.Schema.XmlSchemaAny any2.Namespace = "urn:schemas-microsoft-com:xml-diffgram-v1" any2.MinOccurs = New Decimal(1) any2.ProcessContents = Global.System.Xml.Schema.XmlSchemaContentProcessing.Lax sequence.Items.Add(any2) Dim attribute1 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute attribute1.Name = "namespace" attribute1.FixedValue = ds.Namespace type.Attributes.Add(attribute1) Dim attribute2 As Global.System.Xml.Schema.XmlSchemaAttribute = New Global.System.Xml.Schema.XmlSchemaAttribute attribute2.Name = "tableTypeName" attribute2.FixedValue = "eh_studenti1DataTable" type.Attributes.Add(attribute2) type.Particle = sequence Dim dsSchema As Global.System.Xml.Schema.XmlSchema = ds.GetSchemaSerializable If xs.Contains(dsSchema.TargetNamespace) Then Dim s1 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Dim s2 As Global.System.IO.MemoryStream = New Global.System.IO.MemoryStream Try Dim schema As Global.System.Xml.Schema.XmlSchema = Nothing dsSchema.Write(s1) Dim schemas As Global.System.Collections.IEnumerator = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator Do While schemas.MoveNext schema = CType(schemas.Current,Global.System.Xml.Schema.XmlSchema) s2.SetLength(0) schema.Write(s2) If (s1.Length = s2.Length) Then s1.Position = 0 s2.Position = 0 Do While ((s1.Position <> s1.Length) _ AndAlso (s1.ReadByte = s2.ReadByte)) Loop If (s1.Position = s1.Length) Then Return type End If End If Loop Finally If (Not (s1) Is Nothing) Then s1.Close End If If (Not (s2) Is Nothing) Then s2.Close End If End Try End If xs.Add(dsSchema) Return type End Function End Class ''' '''Represents strongly named DataRow class. ''' _ Partial Public Class eh_evidencijaRow Inherits Global.System.Data.DataRow Private tableeh_evidencija As eh_evidencijaDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableeh_evidencija = CType(Me.Table,eh_evidencijaDataTable) End Sub _ Public Property id_student() As Integer Get Return CType(Me(Me.tableeh_evidencija.id_studentColumn),Integer) End Get Set Me(Me.tableeh_evidencija.id_studentColumn) = value End Set End Property _ Public Property id_ispit() As Integer Get Return CType(Me(Me.tableeh_evidencija.id_ispitColumn),Integer) End Get Set Me(Me.tableeh_evidencija.id_ispitColumn) = value End Set End Property _ Public Property ocjena() As Double Get Try Return CType(Me(Me.tableeh_evidencija.ocjenaColumn),Double) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'ocjena' in table 'eh_evidencija' is DBNull.", e) End Try End Get Set Me(Me.tableeh_evidencija.ocjenaColumn) = value End Set End Property _ Public Property eh_ispitiRow() As eh_ispitiRow Get Return CType(Me.GetParentRow(Me.Table.ParentRelations("FK__eh_eviden__id_is__09DE7BCC")),eh_ispitiRow) End Get Set Me.SetParentRow(value, Me.Table.ParentRelations("FK__eh_eviden__id_is__09DE7BCC")) End Set End Property _ Public Property eh_studentiRow() As eh_studentiRow Get Return CType(Me.GetParentRow(Me.Table.ParentRelations("FK__eh_eviden__id_st__08EA5793")),eh_studentiRow) End Get Set Me.SetParentRow(value, Me.Table.ParentRelations("FK__eh_eviden__id_st__08EA5793")) End Set End Property _ Public Function IsocjenaNull() As Boolean Return Me.IsNull(Me.tableeh_evidencija.ocjenaColumn) End Function _ Public Sub SetocjenaNull() Me(Me.tableeh_evidencija.ocjenaColumn) = Global.System.Convert.DBNull End Sub End Class ''' '''Represents strongly named DataRow class. ''' _ Partial Public Class eh_ispitiRow Inherits Global.System.Data.DataRow Private tableeh_ispiti As eh_ispitiDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableeh_ispiti = CType(Me.Table,eh_ispitiDataTable) End Sub _ Public Property id_ispit() As Integer Get Return CType(Me(Me.tableeh_ispiti.id_ispitColumn),Integer) End Get Set Me(Me.tableeh_ispiti.id_ispitColumn) = value End Set End Property _ Public Property naziv() As String Get Try Return CType(Me(Me.tableeh_ispiti.nazivColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'naziv' in table 'eh_ispiti' is DBNull.", e) End Try End Get Set Me(Me.tableeh_ispiti.nazivColumn) = value End Set End Property _ Public Function IsnazivNull() As Boolean Return Me.IsNull(Me.tableeh_ispiti.nazivColumn) End Function _ Public Sub SetnazivNull() Me(Me.tableeh_ispiti.nazivColumn) = Global.System.Convert.DBNull End Sub _ Public Function Geteh_evidencijaRows() As eh_evidencijaRow() If (Me.Table.ChildRelations("FK__eh_eviden__id_is__09DE7BCC") Is Nothing) Then Return New eh_evidencijaRow(-1) {} Else Return CType(MyBase.GetChildRows(Me.Table.ChildRelations("FK__eh_eviden__id_is__09DE7BCC")),eh_evidencijaRow()) End If End Function End Class ''' '''Represents strongly named DataRow class. ''' _ Partial Public Class eh_studentiRow Inherits Global.System.Data.DataRow Private tableeh_studenti As eh_studentiDataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableeh_studenti = CType(Me.Table,eh_studentiDataTable) End Sub _ Public Property id_student() As Integer Get Return CType(Me(Me.tableeh_studenti.id_studentColumn),Integer) End Get Set Me(Me.tableeh_studenti.id_studentColumn) = value End Set End Property _ Public Property ime_p() As String Get Try Return CType(Me(Me.tableeh_studenti.ime_pColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'ime_p' in table 'eh_studenti' is DBNull.", e) End Try End Get Set Me(Me.tableeh_studenti.ime_pColumn) = value End Set End Property _ Public Function Isime_pNull() As Boolean Return Me.IsNull(Me.tableeh_studenti.ime_pColumn) End Function _ Public Sub Setime_pNull() Me(Me.tableeh_studenti.ime_pColumn) = Global.System.Convert.DBNull End Sub _ Public Function Geteh_evidencijaRows() As eh_evidencijaRow() If (Me.Table.ChildRelations("FK__eh_eviden__id_st__08EA5793") Is Nothing) Then Return New eh_evidencijaRow(-1) {} Else Return CType(MyBase.GetChildRows(Me.Table.ChildRelations("FK__eh_eviden__id_st__08EA5793")),eh_evidencijaRow()) End If End Function End Class ''' '''Represents strongly named DataRow class. ''' _ Partial Public Class eh_studenti1Row Inherits Global.System.Data.DataRow Private tableeh_studenti1 As eh_studenti1DataTable _ Friend Sub New(ByVal rb As Global.System.Data.DataRowBuilder) MyBase.New(rb) Me.tableeh_studenti1 = CType(Me.Table,eh_studenti1DataTable) End Sub _ Public Property Ime_i_prezime() As String Get Try Return CType(Me(Me.tableeh_studenti1.Ime_i_prezimeColumn),String) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Ime i prezime' in table 'eh_studenti1' is DBNull.", e) End Try End Get Set Me(Me.tableeh_studenti1.Ime_i_prezimeColumn) = value End Set End Property _ Public Property Broj_polozenih_ispita() As Integer Get Try Return CType(Me(Me.tableeh_studenti1.Broj_polozenih_ispitaColumn),Integer) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Broj polozenih ispita' in table 'eh_studenti1' is DBNull.", e) End Try End Get Set Me(Me.tableeh_studenti1.Broj_polozenih_ispitaColumn) = value End Set End Property _ Public Property Prosjek_ocjena() As Double Get Try Return CType(Me(Me.tableeh_studenti1.Prosjek_ocjenaColumn),Double) Catch e As Global.System.InvalidCastException Throw New Global.System.Data.StrongTypingException("The value for column 'Prosjek ocjena' in table 'eh_studenti1' is DBNull.", e) End Try End Get Set Me(Me.tableeh_studenti1.Prosjek_ocjenaColumn) = value End Set End Property _ Public Function IsIme_i_prezimeNull() As Boolean Return Me.IsNull(Me.tableeh_studenti1.Ime_i_prezimeColumn) End Function _ Public Sub SetIme_i_prezimeNull() Me(Me.tableeh_studenti1.Ime_i_prezimeColumn) = Global.System.Convert.DBNull End Sub _ Public Function IsBroj_polozenih_ispitaNull() As Boolean Return Me.IsNull(Me.tableeh_studenti1.Broj_polozenih_ispitaColumn) End Function _ Public Sub SetBroj_polozenih_ispitaNull() Me(Me.tableeh_studenti1.Broj_polozenih_ispitaColumn) = Global.System.Convert.DBNull End Sub _ Public Function IsProsjek_ocjenaNull() As Boolean Return Me.IsNull(Me.tableeh_studenti1.Prosjek_ocjenaColumn) End Function _ Public Sub SetProsjek_ocjenaNull() Me(Me.tableeh_studenti1.Prosjek_ocjenaColumn) = Global.System.Convert.DBNull End Sub End Class ''' '''Row event argument class ''' _ Public Class eh_evidencijaRowChangeEvent Inherits Global.System.EventArgs Private eventRow As eh_evidencijaRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As eh_evidencijaRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As eh_evidencijaRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class ''' '''Row event argument class ''' _ Public Class eh_ispitiRowChangeEvent Inherits Global.System.EventArgs Private eventRow As eh_ispitiRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As eh_ispitiRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As eh_ispitiRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class ''' '''Row event argument class ''' _ Public Class eh_studentiRowChangeEvent Inherits Global.System.EventArgs Private eventRow As eh_studentiRow Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As eh_studentiRow, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As eh_studentiRow Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class ''' '''Row event argument class ''' _ Public Class eh_studenti1RowChangeEvent Inherits Global.System.EventArgs Private eventRow As eh_studenti1Row Private eventAction As Global.System.Data.DataRowAction _ Public Sub New(ByVal row As eh_studenti1Row, ByVal action As Global.System.Data.DataRowAction) MyBase.New Me.eventRow = row Me.eventAction = action End Sub _ Public ReadOnly Property Row() As eh_studenti1Row Get Return Me.eventRow End Get End Property _ Public ReadOnly Property Action() As Global.System.Data.DataRowAction Get Return Me.eventAction End Get End Property End Class End Class Namespace PIDataSetTableAdapters ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class eh_evidencijaTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Private ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "eh_evidencija" tableMapping.ColumnMappings.Add("id_student", "id_student") tableMapping.ColumnMappings.Add("id_ispit", "id_ispit") tableMapping.ColumnMappings.Add("ocjena", "ocjena") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[eh_evidencija] WHERE (([id_student] = @Original_id_student) AN"& _ "D ([id_ispit] = @Original_id_ispit) AND ((@IsNull_ocjena = 1 AND [ocjena] IS NUL"& _ "L) OR ([ocjena] = @Original_ocjena)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_id_student", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_student", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_id_ispit", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_ispit", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ocjena", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ocjena", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ocjena", Global.System.Data.SqlDbType.Float, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ocjena", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[eh_evidencija] ([id_student], [id_ispit], [ocjena]) VALUES (@i"& _ "d_student, @id_ispit, @ocjena);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT id_student, id_ispit, ocjena FROM eh_evi"& _ "dencija WHERE (id_ispit = @id_ispit) AND (id_student = @id_student)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@id_student", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_student", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@id_ispit", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_ispit", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ocjena", Global.System.Data.SqlDbType.Float, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ocjena", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[eh_evidencija] SET [id_student] = @id_student, [id_ispit] = @id_isp"& _ "it, [ocjena] = @ocjena WHERE (([id_student] = @Original_id_student) AND ([id_isp"& _ "it] = @Original_id_ispit) AND ((@IsNull_ocjena = 1 AND [ocjena] IS NULL) OR ([oc"& _ "jena] = @Original_ocjena)));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT id_student, id_ispit, ocjena FROM eh_eviden"& _ "cija WHERE (id_ispit = @id_ispit) AND (id_student = @id_student)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@id_student", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_student", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@id_ispit", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_ispit", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ocjena", Global.System.Data.SqlDbType.Float, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ocjena", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_id_student", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_student", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_id_ispit", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_ispit", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ocjena", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ocjena", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ocjena", Global.System.Data.SqlDbType.Float, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ocjena", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection Me._connection.ConnectionString = Global.WindowsApplication1.My.MySettings.Default.PIConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT id_student, id_ispit, ocjena FROM dbo.eh_evidencija" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As PIDataSet.eh_evidencijaDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As PIDataSet.eh_evidencijaDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As PIDataSet.eh_evidencijaDataTable = New PIDataSet.eh_evidencijaDataTable Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As PIDataSet.eh_evidencijaDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As PIDataSet) As Integer Return Me.Adapter.Update(dataSet, "eh_evidencija") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_id_student As Integer, ByVal Original_id_ispit As Integer, ByVal Original_ocjena As Global.System.Nullable(Of Double)) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_id_student,Integer) Me.Adapter.DeleteCommand.Parameters(1).Value = CType(Original_id_ispit,Integer) If (Original_ocjena.HasValue = true) Then Me.Adapter.DeleteCommand.Parameters(2).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(3).Value = CType(Original_ocjena.Value,Double) Else Me.Adapter.DeleteCommand.Parameters(2).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(3).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal id_student As Integer, ByVal id_ispit As Integer, ByVal ocjena As Global.System.Nullable(Of Double)) As Integer Me.Adapter.InsertCommand.Parameters(0).Value = CType(id_student,Integer) Me.Adapter.InsertCommand.Parameters(1).Value = CType(id_ispit,Integer) If (ocjena.HasValue = true) Then Me.Adapter.InsertCommand.Parameters(2).Value = CType(ocjena.Value,Double) Else Me.Adapter.InsertCommand.Parameters(2).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal id_student As Integer, ByVal id_ispit As Integer, ByVal ocjena As Global.System.Nullable(Of Double), ByVal Original_id_student As Integer, ByVal Original_id_ispit As Integer, ByVal Original_ocjena As Global.System.Nullable(Of Double)) As Integer Me.Adapter.UpdateCommand.Parameters(0).Value = CType(id_student,Integer) Me.Adapter.UpdateCommand.Parameters(1).Value = CType(id_ispit,Integer) If (ocjena.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(2).Value = CType(ocjena.Value,Double) Else Me.Adapter.UpdateCommand.Parameters(2).Value = Global.System.DBNull.Value End If Me.Adapter.UpdateCommand.Parameters(3).Value = CType(Original_id_student,Integer) Me.Adapter.UpdateCommand.Parameters(4).Value = CType(Original_id_ispit,Integer) If (Original_ocjena.HasValue = true) Then Me.Adapter.UpdateCommand.Parameters(5).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(6).Value = CType(Original_ocjena.Value,Double) Else Me.Adapter.UpdateCommand.Parameters(5).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(6).Value = Global.System.DBNull.Value End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal ocjena As Global.System.Nullable(Of Double), ByVal Original_id_student As Integer, ByVal Original_id_ispit As Integer, ByVal Original_ocjena As Global.System.Nullable(Of Double)) As Integer Return Me.Update(Original_id_student, Original_id_ispit, ocjena, Original_id_student, Original_id_ispit, Original_ocjena) End Function End Class ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class eh_ispitiTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Private ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "eh_ispiti" tableMapping.ColumnMappings.Add("id_ispit", "id_ispit") tableMapping.ColumnMappings.Add("naziv", "naziv") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[eh_ispiti] WHERE (([id_ispit] = @Original_id_ispit) AND ((@IsN"& _ "ull_naziv = 1 AND [naziv] IS NULL) OR ([naziv] = @Original_naziv)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_id_ispit", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_ispit", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_naziv", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "naziv", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_naziv", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "naziv", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[eh_ispiti] ([id_ispit], [naziv]) VALUES (@id_ispit, @naziv);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)& _ "SELECT id_ispit, naziv FROM eh_ispiti WHERE (id_ispit = @id_ispit)" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@id_ispit", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_ispit", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@naziv", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "naziv", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[eh_ispiti] SET [id_ispit] = @id_ispit, [naziv] = @naziv WHERE (([id"& _ "_ispit] = @Original_id_ispit) AND ((@IsNull_naziv = 1 AND [naziv] IS NULL) OR (["& _ "naziv] = @Original_naziv)));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT id_ispit, naziv FROM eh_ispiti WHERE (id_is"& _ "pit = @id_ispit)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@id_ispit", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_ispit", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@naziv", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "naziv", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_id_ispit", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_ispit", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_naziv", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "naziv", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_naziv", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "naziv", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection Me._connection.ConnectionString = Global.WindowsApplication1.My.MySettings.Default.PIConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT id_ispit, naziv FROM dbo.eh_ispiti" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As PIDataSet.eh_ispitiDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As PIDataSet.eh_ispitiDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As PIDataSet.eh_ispitiDataTable = New PIDataSet.eh_ispitiDataTable Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As PIDataSet.eh_ispitiDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As PIDataSet) As Integer Return Me.Adapter.Update(dataSet, "eh_ispiti") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_id_ispit As Integer, ByVal Original_naziv As String) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_id_ispit,Integer) If (Original_naziv Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_naziv,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal id_ispit As Integer, ByVal naziv As String) As Integer Me.Adapter.InsertCommand.Parameters(0).Value = CType(id_ispit,Integer) If (naziv Is Nothing) Then Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(naziv,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal id_ispit As Integer, ByVal naziv As String, ByVal Original_id_ispit As Integer, ByVal Original_naziv As String) As Integer Me.Adapter.UpdateCommand.Parameters(0).Value = CType(id_ispit,Integer) If (naziv Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(naziv,String) End If Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Original_id_ispit,Integer) If (Original_naziv Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(3).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(3).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(4).Value = CType(Original_naziv,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal naziv As String, ByVal Original_id_ispit As Integer, ByVal Original_naziv As String) As Integer Return Me.Update(Original_id_ispit, naziv, Original_id_ispit, Original_naziv) End Function End Class ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class eh_studentiTableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Private ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "eh_studenti" tableMapping.ColumnMappings.Add("id_student", "id_student") tableMapping.ColumnMappings.Add("ime_p", "ime_p") Me._adapter.TableMappings.Add(tableMapping) Me._adapter.DeleteCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.DeleteCommand.Connection = Me.Connection Me._adapter.DeleteCommand.CommandText = "DELETE FROM [dbo].[eh_studenti] WHERE (([id_student] = @Original_id_student) AND "& _ "((@IsNull_ime_p = 1 AND [ime_p] IS NULL) OR ([ime_p] = @Original_ime_p)))" Me._adapter.DeleteCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_id_student", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_student", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ime_p", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ime_p", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) Me._adapter.DeleteCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ime_p", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ime_p", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.InsertCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.InsertCommand.Connection = Me.Connection Me._adapter.InsertCommand.CommandText = "INSERT INTO [dbo].[eh_studenti] ([id_student], [ime_p]) VALUES (@id_student, @ime"& _ "_p);"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT id_student, ime_p FROM eh_studenti WHERE (id_student = @id_student)"& _ "" Me._adapter.InsertCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@id_student", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_student", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.InsertCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ime_p", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ime_p", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand = New Global.System.Data.SqlClient.SqlCommand Me._adapter.UpdateCommand.Connection = Me.Connection Me._adapter.UpdateCommand.CommandText = "UPDATE [dbo].[eh_studenti] SET [id_student] = @id_student, [ime_p] = @ime_p WHERE"& _ " (([id_student] = @Original_id_student) AND ((@IsNull_ime_p = 1 AND [ime_p] IS N"& _ "ULL) OR ([ime_p] = @Original_ime_p)));"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"SELECT id_student, ime_p FROM eh_student"& _ "i WHERE (id_student = @id_student)" Me._adapter.UpdateCommand.CommandType = Global.System.Data.CommandType.Text Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@id_student", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_student", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@ime_p", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ime_p", Global.System.Data.DataRowVersion.Current, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_id_student", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "id_student", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@IsNull_ime_p", Global.System.Data.SqlDbType.Int, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ime_p", Global.System.Data.DataRowVersion.Original, true, Nothing, "", "", "")) Me._adapter.UpdateCommand.Parameters.Add(New Global.System.Data.SqlClient.SqlParameter("@Original_ime_p", Global.System.Data.SqlDbType.VarChar, 0, Global.System.Data.ParameterDirection.Input, 0, 0, "ime_p", Global.System.Data.DataRowVersion.Original, false, Nothing, "", "", "")) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection Me._connection.ConnectionString = Global.WindowsApplication1.My.MySettings.Default.PIConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "SELECT id_student, ime_p FROM dbo.eh_studenti" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function Fill(ByVal dataTable As PIDataSet.eh_studentiDataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As PIDataSet.eh_studentiDataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As PIDataSet.eh_studentiDataTable = New PIDataSet.eh_studentiDataTable Me.Adapter.Fill(dataTable) Return dataTable End Function _ Public Overloads Overridable Function Update(ByVal dataTable As PIDataSet.eh_studentiDataTable) As Integer Return Me.Adapter.Update(dataTable) End Function _ Public Overloads Overridable Function Update(ByVal dataSet As PIDataSet) As Integer Return Me.Adapter.Update(dataSet, "eh_studenti") End Function _ Public Overloads Overridable Function Update(ByVal dataRow As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(New Global.System.Data.DataRow() {dataRow}) End Function _ Public Overloads Overridable Function Update(ByVal dataRows() As Global.System.Data.DataRow) As Integer Return Me.Adapter.Update(dataRows) End Function _ Public Overloads Overridable Function Delete(ByVal Original_id_student As Integer, ByVal Original_ime_p As String) As Integer Me.Adapter.DeleteCommand.Parameters(0).Value = CType(Original_id_student,Integer) If (Original_ime_p Is Nothing) Then Me.Adapter.DeleteCommand.Parameters(1).Value = CType(1,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = Global.System.DBNull.Value Else Me.Adapter.DeleteCommand.Parameters(1).Value = CType(0,Object) Me.Adapter.DeleteCommand.Parameters(2).Value = CType(Original_ime_p,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.DeleteCommand.Connection.State If ((Me.Adapter.DeleteCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.DeleteCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.DeleteCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.DeleteCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Insert(ByVal id_student As Integer, ByVal ime_p As String) As Integer Me.Adapter.InsertCommand.Parameters(0).Value = CType(id_student,Integer) If (ime_p Is Nothing) Then Me.Adapter.InsertCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.InsertCommand.Parameters(1).Value = CType(ime_p,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.InsertCommand.Connection.State If ((Me.Adapter.InsertCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.InsertCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.InsertCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.InsertCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal id_student As Integer, ByVal ime_p As String, ByVal Original_id_student As Integer, ByVal Original_ime_p As String) As Integer Me.Adapter.UpdateCommand.Parameters(0).Value = CType(id_student,Integer) If (ime_p Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(1).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(1).Value = CType(ime_p,String) End If Me.Adapter.UpdateCommand.Parameters(2).Value = CType(Original_id_student,Integer) If (Original_ime_p Is Nothing) Then Me.Adapter.UpdateCommand.Parameters(3).Value = CType(1,Object) Me.Adapter.UpdateCommand.Parameters(4).Value = Global.System.DBNull.Value Else Me.Adapter.UpdateCommand.Parameters(3).Value = CType(0,Object) Me.Adapter.UpdateCommand.Parameters(4).Value = CType(Original_ime_p,String) End If Dim previousConnectionState As Global.System.Data.ConnectionState = Me.Adapter.UpdateCommand.Connection.State If ((Me.Adapter.UpdateCommand.Connection.State And Global.System.Data.ConnectionState.Open) _ <> Global.System.Data.ConnectionState.Open) Then Me.Adapter.UpdateCommand.Connection.Open End If Try Dim returnValue As Integer = Me.Adapter.UpdateCommand.ExecuteNonQuery Return returnValue Finally If (previousConnectionState = Global.System.Data.ConnectionState.Closed) Then Me.Adapter.UpdateCommand.Connection.Close End If End Try End Function _ Public Overloads Overridable Function Update(ByVal ime_p As String, ByVal Original_id_student As Integer, ByVal Original_ime_p As String) As Integer Return Me.Update(Original_id_student, ime_p, Original_id_student, Original_ime_p) End Function End Class ''' '''Represents the connection and commands used to retrieve and save data. ''' _ Partial Public Class eh_studenti1TableAdapter Inherits Global.System.ComponentModel.Component Private WithEvents _adapter As Global.System.Data.SqlClient.SqlDataAdapter Private _connection As Global.System.Data.SqlClient.SqlConnection Private _commandCollection() As Global.System.Data.SqlClient.SqlCommand Private _clearBeforeFill As Boolean _ Public Sub New() MyBase.New Me.ClearBeforeFill = true End Sub _ Private ReadOnly Property Adapter() As Global.System.Data.SqlClient.SqlDataAdapter Get If (Me._adapter Is Nothing) Then Me.InitAdapter End If Return Me._adapter End Get End Property _ Friend Property Connection() As Global.System.Data.SqlClient.SqlConnection Get If (Me._connection Is Nothing) Then Me.InitConnection End If Return Me._connection End Get Set Me._connection = value If (Not (Me.Adapter.InsertCommand) Is Nothing) Then Me.Adapter.InsertCommand.Connection = value End If If (Not (Me.Adapter.DeleteCommand) Is Nothing) Then Me.Adapter.DeleteCommand.Connection = value End If If (Not (Me.Adapter.UpdateCommand) Is Nothing) Then Me.Adapter.UpdateCommand.Connection = value End If Dim i As Integer = 0 Do While (i < Me.CommandCollection.Length) If (Not (Me.CommandCollection(i)) Is Nothing) Then CType(Me.CommandCollection(i),Global.System.Data.SqlClient.SqlCommand).Connection = value End If i = (i + 1) Loop End Set End Property _ Protected ReadOnly Property CommandCollection() As Global.System.Data.SqlClient.SqlCommand() Get If (Me._commandCollection Is Nothing) Then Me.InitCommandCollection End If Return Me._commandCollection End Get End Property _ Public Property ClearBeforeFill() As Boolean Get Return Me._clearBeforeFill End Get Set Me._clearBeforeFill = value End Set End Property _ Private Sub InitAdapter() Me._adapter = New Global.System.Data.SqlClient.SqlDataAdapter Dim tableMapping As Global.System.Data.Common.DataTableMapping = New Global.System.Data.Common.DataTableMapping tableMapping.SourceTable = "Table" tableMapping.DataSetTable = "eh_studenti1" tableMapping.ColumnMappings.Add("Ime i prezime", "Ime i prezime") tableMapping.ColumnMappings.Add("Broj polozenih ispita", "Broj polozenih ispita") tableMapping.ColumnMappings.Add("Prosjek ocjena", "Prosjek ocjena") Me._adapter.TableMappings.Add(tableMapping) End Sub _ Private Sub InitConnection() Me._connection = New Global.System.Data.SqlClient.SqlConnection Me._connection.ConnectionString = Global.WindowsApplication1.My.MySettings.Default.PIConnectionString End Sub _ Private Sub InitCommandCollection() Me._commandCollection = New Global.System.Data.SqlClient.SqlCommand(0) {} Me._commandCollection(0) = New Global.System.Data.SqlClient.SqlCommand Me._commandCollection(0).Connection = Me.Connection Me._commandCollection(0).CommandText = "select s.ime_p as 'Ime i prezime', count (e.id_ispit) as 'Broj polozenih ispita',"& _ " avg (e.ocjena) as 'Prosjek ocjena'"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"from eh_studenti s, eh_evidencija e"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"where "& _ "e.ocjena>1 and s.id_student=e.id_student"&Global.Microsoft.VisualBasic.ChrW(13)&Global.Microsoft.VisualBasic.ChrW(10)&"group by s.ime_p" Me._commandCollection(0).CommandType = Global.System.Data.CommandType.Text End Sub _ Public Overloads Overridable Function nafilajme(ByVal dataTable As PIDataSet.eh_studenti1DataTable) As Integer Me.Adapter.SelectCommand = Me.CommandCollection(0) If (Me.ClearBeforeFill = true) Then dataTable.Clear End If Dim returnValue As Integer = Me.Adapter.Fill(dataTable) Return returnValue End Function _ Public Overloads Overridable Function GetData() As PIDataSet.eh_studenti1DataTable Me.Adapter.SelectCommand = Me.CommandCollection(0) Dim dataTable As PIDataSet.eh_studenti1DataTable = New PIDataSet.eh_studenti1DataTable Me.Adapter.Fill(dataTable) Return dataTable End Function End Class End Namespace