This commit is contained in:
Thoscellen
2020-05-16 17:38:46 +02:00
parent e497ffc1e1
commit c66626ff3a
139 changed files with 9396 additions and 1 deletions

View File

@@ -0,0 +1,218 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormAddBS
Inherits System.Windows.Forms.Form
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.RBFemale = New System.Windows.Forms.RadioButton()
Me.RBMale = New System.Windows.Forms.RadioButton()
Me.LabelGender = New System.Windows.Forms.Label()
Me.TBAddress = New System.Windows.Forms.TextBox()
Me.TBLastName = New System.Windows.Forms.TextBox()
Me.TBFirstName = New System.Windows.Forms.TextBox()
Me.LabelLastName = New System.Windows.Forms.Label()
Me.LabelFirstName = New System.Windows.Forms.Label()
Me.TBPhone2 = New System.Windows.Forms.TextBox()
Me.TBPhone1 = New System.Windows.Forms.TextBox()
Me.LabelPhone2 = New System.Windows.Forms.Label()
Me.LabelPhone1 = New System.Windows.Forms.Label()
Me.LabelAddress = New System.Windows.Forms.Label()
Me.ButtonCancel = New System.Windows.Forms.Button()
Me.ButtonAdd = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'RBFemale
'
Me.RBFemale.AutoSize = True
Me.RBFemale.Location = New System.Drawing.Point(171, 68)
Me.RBFemale.Name = "RBFemale"
Me.RBFemale.Size = New System.Drawing.Size(61, 17)
Me.RBFemale.TabIndex = 3
Me.RBFemale.TabStop = True
Me.RBFemale.Text = "Female"
Me.RBFemale.UseVisualStyleBackColor = True
'
'RBMale
'
Me.RBMale.AutoSize = True
Me.RBMale.Location = New System.Drawing.Point(80, 68)
Me.RBMale.Name = "RBMale"
Me.RBMale.Size = New System.Drawing.Size(50, 17)
Me.RBMale.TabIndex = 2
Me.RBMale.TabStop = True
Me.RBMale.Text = "Male"
Me.RBMale.UseVisualStyleBackColor = True
'
'LabelGender
'
Me.LabelGender.AutoSize = True
Me.LabelGender.Location = New System.Drawing.Point(12, 70)
Me.LabelGender.Name = "LabelGender"
Me.LabelGender.Size = New System.Drawing.Size(48, 13)
Me.LabelGender.TabIndex = 20
Me.LabelGender.Text = "Gender:"
'
'TBAddress
'
Me.TBAddress.Location = New System.Drawing.Point(12, 111)
Me.TBAddress.Multiline = True
Me.TBAddress.Name = "TBAddress"
Me.TBAddress.Size = New System.Drawing.Size(258, 87)
Me.TBAddress.TabIndex = 4
'
'TBLastName
'
Me.TBLastName.Location = New System.Drawing.Point(80, 40)
Me.TBLastName.Name = "TBLastName"
Me.TBLastName.Size = New System.Drawing.Size(190, 22)
Me.TBLastName.TabIndex = 1
'
'TBFirstName
'
Me.TBFirstName.Location = New System.Drawing.Point(80, 12)
Me.TBFirstName.Name = "TBFirstName"
Me.TBFirstName.Size = New System.Drawing.Size(190, 22)
Me.TBFirstName.TabIndex = 0
'
'LabelLastName
'
Me.LabelLastName.AutoSize = True
Me.LabelLastName.Location = New System.Drawing.Point(12, 43)
Me.LabelLastName.Name = "LabelLastName"
Me.LabelLastName.Size = New System.Drawing.Size(62, 13)
Me.LabelLastName.TabIndex = 16
Me.LabelLastName.Text = "Last Name:"
'
'LabelFirstName
'
Me.LabelFirstName.AutoSize = True
Me.LabelFirstName.Location = New System.Drawing.Point(12, 15)
Me.LabelFirstName.Name = "LabelFirstName"
Me.LabelFirstName.Size = New System.Drawing.Size(63, 13)
Me.LabelFirstName.TabIndex = 15
Me.LabelFirstName.Text = "First name:"
'
'TBPhone2
'
Me.TBPhone2.Location = New System.Drawing.Point(67, 239)
Me.TBPhone2.Name = "TBPhone2"
Me.TBPhone2.Size = New System.Drawing.Size(203, 22)
Me.TBPhone2.TabIndex = 6
'
'TBPhone1
'
Me.TBPhone1.Location = New System.Drawing.Point(67, 211)
Me.TBPhone1.Name = "TBPhone1"
Me.TBPhone1.Size = New System.Drawing.Size(203, 22)
Me.TBPhone1.TabIndex = 5
'
'LabelPhone2
'
Me.LabelPhone2.AutoSize = True
Me.LabelPhone2.Location = New System.Drawing.Point(12, 242)
Me.LabelPhone2.Name = "LabelPhone2"
Me.LabelPhone2.Size = New System.Drawing.Size(52, 13)
Me.LabelPhone2.TabIndex = 25
Me.LabelPhone2.Text = "Phone 2:"
'
'LabelPhone1
'
Me.LabelPhone1.AutoSize = True
Me.LabelPhone1.Location = New System.Drawing.Point(12, 214)
Me.LabelPhone1.Name = "LabelPhone1"
Me.LabelPhone1.Size = New System.Drawing.Size(52, 13)
Me.LabelPhone1.TabIndex = 24
Me.LabelPhone1.Text = "Phone 1:"
'
'LabelAddress
'
Me.LabelAddress.AutoSize = True
Me.LabelAddress.Location = New System.Drawing.Point(12, 95)
Me.LabelAddress.Name = "LabelAddress"
Me.LabelAddress.Size = New System.Drawing.Size(51, 13)
Me.LabelAddress.TabIndex = 23
Me.LabelAddress.Text = "Address:"
'
'ButtonCancel
'
Me.ButtonCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ButtonCancel.Location = New System.Drawing.Point(196, 282)
Me.ButtonCancel.Name = "ButtonCancel"
Me.ButtonCancel.Size = New System.Drawing.Size(75, 23)
Me.ButtonCancel.TabIndex = 8
Me.ButtonCancel.Text = "Cancel"
Me.ButtonCancel.UseVisualStyleBackColor = True
'
'ButtonAdd
'
Me.ButtonAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ButtonAdd.Location = New System.Drawing.Point(115, 282)
Me.ButtonAdd.Name = "ButtonAdd"
Me.ButtonAdd.Size = New System.Drawing.Size(75, 23)
Me.ButtonAdd.TabIndex = 7
Me.ButtonAdd.Text = "Add"
Me.ButtonAdd.UseVisualStyleBackColor = True
'
'FormAddBS
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(283, 317)
Me.Controls.Add(Me.ButtonAdd)
Me.Controls.Add(Me.ButtonCancel)
Me.Controls.Add(Me.TBPhone2)
Me.Controls.Add(Me.TBPhone1)
Me.Controls.Add(Me.LabelPhone2)
Me.Controls.Add(Me.LabelPhone1)
Me.Controls.Add(Me.LabelAddress)
Me.Controls.Add(Me.RBFemale)
Me.Controls.Add(Me.RBMale)
Me.Controls.Add(Me.LabelGender)
Me.Controls.Add(Me.TBAddress)
Me.Controls.Add(Me.TBLastName)
Me.Controls.Add(Me.TBFirstName)
Me.Controls.Add(Me.LabelLastName)
Me.Controls.Add(Me.LabelFirstName)
Me.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.Name = "FormAddBS"
Me.Text = "FormAddBS"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents RBFemale As System.Windows.Forms.RadioButton
Friend WithEvents RBMale As System.Windows.Forms.RadioButton
Friend WithEvents LabelGender As System.Windows.Forms.Label
Friend WithEvents TBAddress As System.Windows.Forms.TextBox
Friend WithEvents TBLastName As System.Windows.Forms.TextBox
Friend WithEvents TBFirstName As System.Windows.Forms.TextBox
Friend WithEvents LabelLastName As System.Windows.Forms.Label
Friend WithEvents LabelFirstName As System.Windows.Forms.Label
Friend WithEvents TBPhone2 As System.Windows.Forms.TextBox
Friend WithEvents TBPhone1 As System.Windows.Forms.TextBox
Friend WithEvents LabelPhone2 As System.Windows.Forms.Label
Friend WithEvents LabelPhone1 As System.Windows.Forms.Label
Friend WithEvents LabelAddress As System.Windows.Forms.Label
Friend WithEvents ButtonCancel As System.Windows.Forms.Button
Friend WithEvents ButtonAdd As System.Windows.Forms.Button
End Class

View File

@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View File

@@ -0,0 +1,3 @@
Public Class FormAddBS
End Class

View File

@@ -0,0 +1,240 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormBabySitterID
Inherits ApplicationCrèche_1.FormID
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FormBabySitterID))
Me.LabelAddress = New System.Windows.Forms.Label()
Me.LabelPhone1 = New System.Windows.Forms.Label()
Me.LabelPhone2 = New System.Windows.Forms.Label()
Me.TBPhone1 = New System.Windows.Forms.TextBox()
Me.TBPhone2 = New System.Windows.Forms.TextBox()
Me.Label4 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.Keep3 = New System.Windows.Forms.Label()
Me.Keep2 = New System.Windows.Forms.Label()
Me.Keep1 = New System.Windows.Forms.Label()
Me.Keep4 = New System.Windows.Forms.Label()
Me.Keep7 = New System.Windows.Forms.Label()
Me.Keep6 = New System.Windows.Forms.Label()
Me.Keep5 = New System.Windows.Forms.Label()
Me.SuspendLayout()
'
'ButtonEdit
'
Me.ButtonEdit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
'
'ButtonClose
'
'
'LabelAddress
'
Me.LabelAddress.AutoSize = True
Me.LabelAddress.Location = New System.Drawing.Point(12, 166)
Me.LabelAddress.Name = "LabelAddress"
Me.LabelAddress.Size = New System.Drawing.Size(51, 13)
Me.LabelAddress.TabIndex = 15
Me.LabelAddress.Text = "Address:"
'
'LabelPhone1
'
Me.LabelPhone1.AutoSize = True
Me.LabelPhone1.Location = New System.Drawing.Point(12, 285)
Me.LabelPhone1.Name = "LabelPhone1"
Me.LabelPhone1.Size = New System.Drawing.Size(52, 13)
Me.LabelPhone1.TabIndex = 16
Me.LabelPhone1.Text = "Phone 1:"
'
'LabelPhone2
'
Me.LabelPhone2.AutoSize = True
Me.LabelPhone2.Location = New System.Drawing.Point(12, 313)
Me.LabelPhone2.Name = "LabelPhone2"
Me.LabelPhone2.Size = New System.Drawing.Size(52, 13)
Me.LabelPhone2.TabIndex = 0
Me.LabelPhone2.Text = "Phone 2:"
'
'TBPhone1
'
Me.TBPhone1.Location = New System.Drawing.Point(67, 282)
Me.TBPhone1.Name = "TBPhone1"
Me.TBPhone1.Size = New System.Drawing.Size(203, 22)
Me.TBPhone1.TabIndex = 5
'
'TBPhone2
'
Me.TBPhone2.Location = New System.Drawing.Point(67, 310)
Me.TBPhone2.Name = "TBPhone2"
Me.TBPhone2.Size = New System.Drawing.Size(203, 22)
Me.TBPhone2.TabIndex = 6
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Segoe UI", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(12, 9)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(83, 30)
Me.Label4.TabIndex = 2
Me.Label4.Text = "Identity"
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Segoe UI", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(276, 9)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(94, 30)
Me.Label5.TabIndex = 1
Me.Label5.Text = "Planning"
'
'Keep3
'
Me.Keep3.AutoSize = True
Me.Keep3.Enabled = False
Me.Keep3.Location = New System.Drawing.Point(293, 121)
Me.Keep3.Name = "Keep3"
Me.Keep3.Size = New System.Drawing.Size(67, 13)
Me.Keep3.TabIndex = 22
Me.Keep3.Text = "Wednesday"
'
'Keep2
'
Me.Keep2.AutoSize = True
Me.Keep2.Enabled = False
Me.Keep2.Location = New System.Drawing.Point(293, 89)
Me.Keep2.Name = "Keep2"
Me.Keep2.Size = New System.Drawing.Size(48, 13)
Me.Keep2.TabIndex = 23
Me.Keep2.Text = "Tuesday"
'
'Keep1
'
Me.Keep1.AutoSize = True
Me.Keep1.Enabled = False
Me.Keep1.Location = New System.Drawing.Point(293, 57)
Me.Keep1.Name = "Keep1"
Me.Keep1.Size = New System.Drawing.Size(49, 13)
Me.Keep1.TabIndex = 24
Me.Keep1.Text = "Monday"
'
'Keep4
'
Me.Keep4.AutoSize = True
Me.Keep4.Enabled = False
Me.Keep4.Location = New System.Drawing.Point(293, 153)
Me.Keep4.Name = "Keep4"
Me.Keep4.Size = New System.Drawing.Size(53, 13)
Me.Keep4.TabIndex = 25
Me.Keep4.Text = "Thursday"
'
'Keep7
'
Me.Keep7.AutoSize = True
Me.Keep7.Enabled = False
Me.Keep7.Location = New System.Drawing.Point(293, 249)
Me.Keep7.Name = "Keep7"
Me.Keep7.Size = New System.Drawing.Size(45, 13)
Me.Keep7.TabIndex = 26
Me.Keep7.Text = "Sunday"
'
'Keep6
'
Me.Keep6.AutoSize = True
Me.Keep6.Enabled = False
Me.Keep6.Location = New System.Drawing.Point(293, 217)
Me.Keep6.Name = "Keep6"
Me.Keep6.Size = New System.Drawing.Size(52, 13)
Me.Keep6.TabIndex = 27
Me.Keep6.Text = "Saturday"
'
'Keep5
'
Me.Keep5.AutoSize = True
Me.Keep5.Enabled = False
Me.Keep5.Location = New System.Drawing.Point(293, 185)
Me.Keep5.Name = "Keep5"
Me.Keep5.Size = New System.Drawing.Size(38, 13)
Me.Keep5.TabIndex = 28
Me.Keep5.Text = "Friday"
'
'FormBabySitterID
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.ClientSize = New System.Drawing.Size(544, 381)
Me.Controls.Add(Me.Keep1)
Me.Controls.Add(Me.Keep2)
Me.Controls.Add(Me.Keep3)
Me.Controls.Add(Me.Keep4)
Me.Controls.Add(Me.Keep5)
Me.Controls.Add(Me.Keep6)
Me.Controls.Add(Me.Keep7)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.TBPhone2)
Me.Controls.Add(Me.TBPhone1)
Me.Controls.Add(Me.LabelPhone2)
Me.Controls.Add(Me.LabelPhone1)
Me.Controls.Add(Me.LabelAddress)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MinimumSize = New System.Drawing.Size(550, 410)
Me.Name = "FormBabySitterID"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "BabySitter ID"
Me.Controls.SetChildIndex(Me.ButtonEdit, 0)
Me.Controls.SetChildIndex(Me.ButtonClose, 0)
Me.Controls.SetChildIndex(Me.TBFirstName, 0)
Me.Controls.SetChildIndex(Me.TBLastName, 0)
Me.Controls.SetChildIndex(Me.TBAddress, 0)
Me.Controls.SetChildIndex(Me.RBMale, 0)
Me.Controls.SetChildIndex(Me.RBFemale, 0)
Me.Controls.SetChildIndex(Me.LabelAddress, 0)
Me.Controls.SetChildIndex(Me.LabelPhone1, 0)
Me.Controls.SetChildIndex(Me.LabelPhone2, 0)
Me.Controls.SetChildIndex(Me.TBPhone1, 0)
Me.Controls.SetChildIndex(Me.TBPhone2, 0)
Me.Controls.SetChildIndex(Me.Label4, 0)
Me.Controls.SetChildIndex(Me.Label5, 0)
Me.Controls.SetChildIndex(Me.Keep7, 0)
Me.Controls.SetChildIndex(Me.Keep6, 0)
Me.Controls.SetChildIndex(Me.Keep5, 0)
Me.Controls.SetChildIndex(Me.Keep4, 0)
Me.Controls.SetChildIndex(Me.Keep3, 0)
Me.Controls.SetChildIndex(Me.Keep2, 0)
Me.Controls.SetChildIndex(Me.Keep1, 0)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents LabelAddress As System.Windows.Forms.Label
Friend WithEvents LabelPhone1 As System.Windows.Forms.Label
Friend WithEvents LabelPhone2 As System.Windows.Forms.Label
Friend WithEvents TBPhone1 As System.Windows.Forms.TextBox
Friend WithEvents TBPhone2 As System.Windows.Forms.TextBox
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Keep3 As System.Windows.Forms.Label
Friend WithEvents Keep2 As System.Windows.Forms.Label
Friend WithEvents Keep1 As System.Windows.Forms.Label
Friend WithEvents Keep4 As System.Windows.Forms.Label
Friend WithEvents Keep7 As System.Windows.Forms.Label
Friend WithEvents Keep6 As System.Windows.Forms.Label
Friend WithEvents Keep5 As System.Windows.Forms.Label
End Class

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIAB+AQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAlw
SFlzAAALEwAACxMBAJqcGAAAATBJREFUOI2dkz1Ow0AQRp+Do5QcgxZxAFquQMMB0nIBGpo0tJEQB0Di
EIgL0CPR0SChQBA4/tnMNxS7mCDHJMLSalce7/Ob2dkMGAA7QJZG3+NpGODu7gA5MARGaR78ARAQgDrN
LWD0cH/17jJwEcEeVdIaNxRKqsWcg6PJboKpNXAZe/uHPxvW2Msabm8uSabVdyQHBrjAnfFw0ut//nTC
4qMipdnWKo+m8c/TcLrWINQNs+cZZtaJ5QBZ2jQeXvQanD0ek3kXnscUY2CTAb2ArQ2673+lsNEgnlx/
CpsM+lPYsgbZmlgEyADHXSyb0PmoqQOSpePuAmTLBbKGt5dXQt0FSEZZlMgcYiF8FRCaYs7d9ZTis0RL
tS0d281xOZKQCVYuEsSWHPGP2+juAvgCwODN5kOjKQoAAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@@ -0,0 +1,242 @@
Imports ApplicationCrèche_1.IDFormMode
Public Class FormBabySitterID
' ----- Attributes -----
Private actualFormMode As IDFormMode
' ----- Initialisators -----
Private Sub FormBabySitterID_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub New(aFormMode As IDFormMode, Optional aBS As BabySitter = Nothing)
Console.WriteLine("FormBabySitterID : Begining of a new instance")
' Cet appel est requis par le concepteur.
InitializeComponent()
' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
If aFormMode = CREATOR Or aBS Is Nothing Then
ChangeMode(CREATOR)
Else
ChangeMode(aFormMode, aBS)
End If
End Sub
' ----- Methodes -----
Private Function getBSFromIntern() As BabySitter
Dim newBS As BabySitter = New BabySitter(Me.Tag)
newBS.firstname = TBFirstName.Text
newBS.lastname = TBLastName.Text
newBS.gender = RBMale.Checked
newBS.address = TBAddress.Text
newBS.phone1 = TBPhone1.Text
If Not String.IsNullOrEmpty(TBPhone2.Text) Then
newBS.phone2 = TBPhone2.Text
End If
Return newBS
End Function
Private Function updateBSFromExtern(aBS As BabySitter) As Boolean
If Not aBS Is Nothing Then
' Fill up controls with all the data we have.
Me.TBFirstName.Text = aBS.firstname 'Firstname
Me.TBLastName.Text = aBS.lastname 'Lastname
If aBS.gender Then 'Gender
Me.RBMale.Checked = True
Else
Me.RBFemale.Checked = True
End If
Me.TBAddress.Text = aBS.address
Me.TBPhone1.Text = aBS.phone1
Me.TBPhone2.Text = aBS.phone2
Me.Tag = aBS.id
If Not aBS.meet1 Is Nothing Then
Dim child1 As Child = dbdata.getChildByMeetID(aBS.meet1.id)
updateMeet(child1)
End If
If Not aBS.meet2 Is Nothing Then
Dim child2 As Child = dbdata.getChildByMeetID(aBS.meet2.id)
updateMeet(child2)
End If
If Not aBS.meet3 Is Nothing Then
Dim child3 As Child = dbdata.getChildByMeetID(aBS.meet3.id)
updateMeet(child3)
End If
Return True
End If
Return False
End Function
Private Sub updateMeet(aChild As Child)
If aChild.meet.monday Then
Keep1.Enabled = aChild.meet.monday
Keep1.Text &= " : " & aChild.firstname & " " & aChild.lastname
End If
If aChild.meet.tuesday Then
Keep2.Enabled = aChild.meet.tuesday
Keep2.Text &= " : " & aChild.firstname & " " & aChild.lastname
End If
If aChild.meet.wednesday Then
Keep3.Enabled = aChild.meet.wednesday
Keep3.Text &= " : " & aChild.firstname & " " & aChild.lastname
End If
If aChild.meet.thursday Then
Keep4.Enabled = aChild.meet.thursday
Keep4.Text &= " : " & aChild.firstname & " " & aChild.lastname
End If
If aChild.meet.friday Then
Keep5.Enabled = aChild.meet.friday
Keep5.Text &= " : " & aChild.firstname & " " & aChild.lastname
End If
If aChild.meet.saturday Then
Keep6.Enabled = aChild.meet.saturday
Keep6.Text &= " : " & aChild.firstname & " " & aChild.lastname
End If
If aChild.meet.sunday Then
Keep7.Enabled = aChild.meet.sunday
Keep7.Text &= " : " & aChild.firstname & " " & aChild.lastname
End If
End Sub
Private Sub ChangeMode(aFormMode As IDFormMode, Optional aBS As BabySitter = Nothing)
updateBSFromExtern(aBS)
If aFormMode = IDFormMode.CREATOR Then ' CREATOR MODE
Me.actualFormMode = CREATOR
Console.WriteLine("FormBabySitterID : Switch to CREATOR Mode")
'Change of the main triggers labels + title
Me.Text = "New babysitter"
Me.ButtonClose.Text = "Cancel"
Me.ButtonEdit.Text = "Save"
Me.RBMale.Checked = True
Me.Tag = 0
Me.ButtonEdit.Image = My.Resources.AddSheet2
ElseIf aFormMode = IDFormMode.VIEWER And Not aBS Is Nothing Then ' VIEW MODE
Me.actualFormMode = VIEWER
Console.WriteLine("FormBabySitterID : Switch to VIEWER Mode")
'We change the main triggers labels + title
Me.Text = aBS.firstname + " " + aBS.lastname
Me.ButtonClose.Text = "Close"
Me.ButtonEdit.Text = "Edit"
Me.ButtonEdit.Image = My.Resources.EditSheet2
'Activate most important security aspect (not show a window that can mat a save somewhere else)
TBAddress.Enabled = False
TBFirstName.Enabled = False
TBLastName.Enabled = False
TBPhone1.Enabled = False
TBPhone2.Enabled = False
RBFemale.Enabled = False
RBMale.Enabled = False
ElseIf aFormMode = IDFormMode.EDITOR Then ' EDITOR MODE WITH THE CURRENT BS
Console.WriteLine("FormBabySitterID : Switch to Editor Mode")
Me.actualFormMode = EDITOR
'We change the main triggers labels + title
Me.Text = Me.TBFirstName.Text + " " + Me.TBLastName.Text + " (Edit)"
Me.ButtonClose.Text = "Cancel"
Me.ButtonEdit.Text = "Update"
Me.ButtonEdit.Image = My.Resources.ValidedSheet
'Turn off anti edit security
TBAddress.Enabled = True
TBFirstName.Enabled = True
TBLastName.Enabled = True
TBPhone1.Enabled = True
TBPhone2.Enabled = True
RBFemale.Enabled = True
RBMale.Enabled = True
Else
Console.WriteLine("FormChildId : No correct mode has been found.")
End If
End Sub
' ----- Handles and Listeners -----
Protected Overrides Sub ButtonEdit_Click(sender As System.Object, e As System.EventArgs)
Dim Validated As Boolean = True
If Me.actualFormMode = VIEWER Then 'EDIT'
Me.ChangeMode(EDITOR)
ElseIf Me.actualFormMode = CREATOR Then 'SAVE'
' Error Provider
If String.IsNullOrEmpty(TBFirstName.Text) Then
ErrorProvider1.SetError(TBFirstName, "The first name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBLastName.Text) Then
ErrorProvider1.SetError(TBLastName, "The last name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBPhone1.Text) Then
ErrorProvider1.SetError(TBPhone1, "At least on phone number is required." & vbNewLine & "Please put a phone number here.")
Validated = False
End If
If String.IsNullOrEmpty(TBAddress.Text) Then
ErrorProvider1.SetError(LabelAddress, "The address field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If Not Validated Then
Exit Sub
End If
'Validation
Dim aBS As BabySitter = getBSFromIntern()
dbdata.addBabysitter(aBS)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Hide()
ElseIf Me.actualFormMode = EDITOR Then 'UPDATE'
' Error Provider
If String.IsNullOrEmpty(TBFirstName.Text) Then
ErrorProvider1.SetError(TBFirstName, "The first name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBLastName.Text) Then
ErrorProvider1.SetError(TBLastName, "The last name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBPhone1.Text) Then
ErrorProvider1.SetError(TBPhone1, "At least on phone number is required." & vbNewLine & "Please put a phone number here.")
Validated = False
End If
If String.IsNullOrEmpty(TBAddress.Text) Then
ErrorProvider1.SetError(LabelAddress, "The address field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If Not Validated Then
Exit Sub
End If
'Validation
Dim aBS As BabySitter = getBSFromIntern()
dbdata.editBabysitter(aBS)
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Hide()
End If
End Sub
Private Sub ButtonClose_Click_1(sender As System.Object, e As System.EventArgs) Handles ButtonClose.Click
Console.WriteLine("FormBabySitterID : Closing instance")
Me.Close()
Me.Finalize()
End Sub
End Class

View File

@@ -0,0 +1,350 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormChildID
Inherits ApplicationCrèche_1.FormID
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FormChildID))
Me.GroupBox2 = New System.Windows.Forms.GroupBox()
Me.LabelBS = New System.Windows.Forms.LinkLabel()
Me.ButtonBS = New System.Windows.Forms.Button()
Me.CBSunday = New System.Windows.Forms.CheckBox()
Me.CBSaturday = New System.Windows.Forms.CheckBox()
Me.CBFriday = New System.Windows.Forms.CheckBox()
Me.CBThursday = New System.Windows.Forms.CheckBox()
Me.CBWednesday = New System.Windows.Forms.CheckBox()
Me.CBTuesday = New System.Windows.Forms.CheckBox()
Me.CBMonday = New System.Windows.Forms.CheckBox()
Me.ButtonParent1 = New System.Windows.Forms.Button()
Me.ButtonParent2 = New System.Windows.Forms.Button()
Me.LabelAddress = New System.Windows.Forms.Label()
Me.LabelIdentity = New System.Windows.Forms.Label()
Me.LabelPlanning = New System.Windows.Forms.Label()
Me.LabelAge = New System.Windows.Forms.Label()
Me.DTPBord = New System.Windows.Forms.DateTimePicker()
Me.LabelBornDate = New System.Windows.Forms.Label()
Me.LabelParent1 = New System.Windows.Forms.LinkLabel()
Me.LabelParent2 = New System.Windows.Forms.LinkLabel()
Me.GroupBox2.SuspendLayout()
Me.SuspendLayout()
'
'ButtonEdit
'
Me.ButtonEdit.Image = Global.ApplicationCrèche_1.My.Resources.Resources.EditSheet2
Me.ButtonEdit.TabIndex = 11
Me.ButtonEdit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
'
'ButtonClose
'
Me.ButtonClose.TabIndex = 12
'
'TBAddress
'
Me.TBAddress.TabIndex = 5
'
'GroupBox2
'
Me.GroupBox2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.GroupBox2.Controls.Add(Me.LabelBS)
Me.GroupBox2.Controls.Add(Me.ButtonBS)
Me.GroupBox2.Controls.Add(Me.CBSunday)
Me.GroupBox2.Controls.Add(Me.CBSaturday)
Me.GroupBox2.Controls.Add(Me.CBFriday)
Me.GroupBox2.Controls.Add(Me.CBThursday)
Me.GroupBox2.Controls.Add(Me.CBWednesday)
Me.GroupBox2.Controls.Add(Me.CBTuesday)
Me.GroupBox2.Controls.Add(Me.CBMonday)
Me.GroupBox2.Location = New System.Drawing.Point(280, 46)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(252, 223)
Me.GroupBox2.TabIndex = 10
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "Day of week"
'
'LabelBS
'
Me.LabelBS.ActiveLinkColor = System.Drawing.SystemColors.Highlight
Me.LabelBS.DisabledLinkColor = System.Drawing.Color.Black
Me.LabelBS.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline
Me.LabelBS.LinkColor = System.Drawing.SystemColors.HotTrack
Me.LabelBS.Location = New System.Drawing.Point(6, 139)
Me.LabelBS.Name = "LabelBS"
Me.LabelBS.Size = New System.Drawing.Size(240, 37)
Me.LabelBS.TabIndex = 7
Me.LabelBS.TabStop = True
Me.LabelBS.Text = "Select a babysitter below"
Me.LabelBS.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'ButtonBS
'
Me.ButtonBS.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ButtonBS.Image = Global.ApplicationCrèche_1.My.Resources.Resources.OpenFolder2
Me.ButtonBS.Location = New System.Drawing.Point(63, 186)
Me.ButtonBS.Name = "ButtonBS"
Me.ButtonBS.Size = New System.Drawing.Size(126, 23)
Me.ButtonBS.TabIndex = 8
Me.ButtonBS.Text = "Browse..."
Me.ButtonBS.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
Me.ButtonBS.UseVisualStyleBackColor = True
'
'CBSunday
'
Me.CBSunday.AutoSize = True
Me.CBSunday.Location = New System.Drawing.Point(137, 79)
Me.CBSunday.Name = "CBSunday"
Me.CBSunday.Size = New System.Drawing.Size(64, 17)
Me.CBSunday.TabIndex = 5
Me.CBSunday.Text = "Sunday"
Me.CBSunday.UseVisualStyleBackColor = True
'
'CBSaturday
'
Me.CBSaturday.AutoSize = True
Me.CBSaturday.Location = New System.Drawing.Point(137, 50)
Me.CBSaturday.Name = "CBSaturday"
Me.CBSaturday.Size = New System.Drawing.Size(71, 17)
Me.CBSaturday.TabIndex = 3
Me.CBSaturday.Text = "Saturday"
Me.CBSaturday.UseVisualStyleBackColor = True
'
'CBFriday
'
Me.CBFriday.AutoSize = True
Me.CBFriday.Location = New System.Drawing.Point(137, 21)
Me.CBFriday.Name = "CBFriday"
Me.CBFriday.Size = New System.Drawing.Size(57, 17)
Me.CBFriday.TabIndex = 1
Me.CBFriday.Text = "Friday"
Me.CBFriday.UseVisualStyleBackColor = True
'
'CBThursday
'
Me.CBThursday.AutoSize = True
Me.CBThursday.Location = New System.Drawing.Point(6, 108)
Me.CBThursday.Name = "CBThursday"
Me.CBThursday.Size = New System.Drawing.Size(72, 17)
Me.CBThursday.TabIndex = 6
Me.CBThursday.Text = "Thursday"
Me.CBThursday.UseVisualStyleBackColor = True
'
'CBWednesday
'
Me.CBWednesday.AutoSize = True
Me.CBWednesday.Location = New System.Drawing.Point(6, 79)
Me.CBWednesday.Name = "CBWednesday"
Me.CBWednesday.Size = New System.Drawing.Size(86, 17)
Me.CBWednesday.TabIndex = 4
Me.CBWednesday.Text = "Wednesday"
Me.CBWednesday.UseVisualStyleBackColor = True
'
'CBTuesday
'
Me.CBTuesday.AutoSize = True
Me.CBTuesday.Location = New System.Drawing.Point(6, 50)
Me.CBTuesday.Name = "CBTuesday"
Me.CBTuesday.Size = New System.Drawing.Size(67, 17)
Me.CBTuesday.TabIndex = 2
Me.CBTuesday.Text = "Tuesday"
Me.CBTuesday.UseVisualStyleBackColor = True
'
'CBMonday
'
Me.CBMonday.AutoSize = True
Me.CBMonday.Location = New System.Drawing.Point(6, 21)
Me.CBMonday.Name = "CBMonday"
Me.CBMonday.Size = New System.Drawing.Size(68, 17)
Me.CBMonday.TabIndex = 0
Me.CBMonday.Text = "Monday"
Me.CBMonday.UseVisualStyleBackColor = True
'
'ButtonParent1
'
Me.ButtonParent1.Image = Global.ApplicationCrèche_1.My.Resources.Resources.OpenFolder2
Me.ButtonParent1.Location = New System.Drawing.Point(12, 282)
Me.ButtonParent1.Name = "ButtonParent1"
Me.ButtonParent1.Size = New System.Drawing.Size(125, 23)
Me.ButtonParent1.TabIndex = 6
Me.ButtonParent1.Text = "Browse parent 1..."
Me.ButtonParent1.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
Me.ButtonParent1.UseVisualStyleBackColor = True
'
'ButtonParent2
'
Me.ButtonParent2.Image = Global.ApplicationCrèche_1.My.Resources.Resources.OpenFolder2
Me.ButtonParent2.Location = New System.Drawing.Point(12, 311)
Me.ButtonParent2.Name = "ButtonParent2"
Me.ButtonParent2.Size = New System.Drawing.Size(125, 23)
Me.ButtonParent2.TabIndex = 8
Me.ButtonParent2.Text = "Browse parent 2..."
Me.ButtonParent2.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
Me.ButtonParent2.UseVisualStyleBackColor = True
'
'LabelAddress
'
Me.LabelAddress.AutoSize = True
Me.LabelAddress.Location = New System.Drawing.Point(12, 166)
Me.LabelAddress.Name = "LabelAddress"
Me.LabelAddress.Size = New System.Drawing.Size(107, 13)
Me.LabelAddress.TabIndex = 14
Me.LabelAddress.Text = "Adress of childcare:"
'
'LabelIdentity
'
Me.LabelIdentity.AutoSize = True
Me.LabelIdentity.Font = New System.Drawing.Font("Segoe UI", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelIdentity.Location = New System.Drawing.Point(12, 9)
Me.LabelIdentity.Name = "LabelIdentity"
Me.LabelIdentity.Size = New System.Drawing.Size(83, 30)
Me.LabelIdentity.TabIndex = 15
Me.LabelIdentity.Text = "Identity"
'
'LabelPlanning
'
Me.LabelPlanning.AutoSize = True
Me.LabelPlanning.Font = New System.Drawing.Font("Segoe UI", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.LabelPlanning.Location = New System.Drawing.Point(275, 9)
Me.LabelPlanning.Name = "LabelPlanning"
Me.LabelPlanning.Size = New System.Drawing.Size(94, 30)
Me.LabelPlanning.TabIndex = 16
Me.LabelPlanning.Text = "Planning"
'
'LabelAge
'
Me.LabelAge.AutoSize = True
Me.LabelAge.Location = New System.Drawing.Point(197, 140)
Me.LabelAge.Name = "LabelAge"
Me.LabelAge.Size = New System.Drawing.Size(54, 13)
Me.LabelAge.TabIndex = 5
Me.LabelAge.Text = "AgeLabel"
'
'DTPBord
'
Me.DTPBord.Format = System.Windows.Forms.DateTimePickerFormat.[Short]
Me.DTPBord.Location = New System.Drawing.Point(80, 136)
Me.DTPBord.Name = "DTPBord"
Me.DTPBord.Size = New System.Drawing.Size(96, 22)
Me.DTPBord.TabIndex = 4
'
'LabelBornDate
'
Me.LabelBornDate.AutoSize = True
Me.LabelBornDate.Location = New System.Drawing.Point(12, 140)
Me.LabelBornDate.Name = "LabelBornDate"
Me.LabelBornDate.Size = New System.Drawing.Size(58, 13)
Me.LabelBornDate.TabIndex = 17
Me.LabelBornDate.Text = "Borndate:"
'
'LabelParent1
'
Me.LabelParent1.ActiveLinkColor = System.Drawing.SystemColors.Highlight
Me.LabelParent1.DisabledLinkColor = System.Drawing.Color.Black
Me.LabelParent1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.LabelParent1.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline
Me.LabelParent1.LinkColor = System.Drawing.SystemColors.HotTrack
Me.LabelParent1.Location = New System.Drawing.Point(143, 282)
Me.LabelParent1.Name = "LabelParent1"
Me.LabelParent1.Size = New System.Drawing.Size(389, 23)
Me.LabelParent1.TabIndex = 7
Me.LabelParent1.TabStop = True
Me.LabelParent1.Text = "subscrib a new parent"
Me.LabelParent1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.LabelParent1.VisitedLinkColor = System.Drawing.SystemColors.HotTrack
'
'LabelParent2
'
Me.LabelParent2.ActiveLinkColor = System.Drawing.SystemColors.Highlight
Me.LabelParent2.DisabledLinkColor = System.Drawing.Color.Black
Me.LabelParent2.LinkBehavior = System.Windows.Forms.LinkBehavior.HoverUnderline
Me.LabelParent2.LinkColor = System.Drawing.SystemColors.HotTrack
Me.LabelParent2.Location = New System.Drawing.Point(143, 311)
Me.LabelParent2.Name = "LabelParent2"
Me.LabelParent2.Size = New System.Drawing.Size(389, 23)
Me.LabelParent2.TabIndex = 9
Me.LabelParent2.TabStop = True
Me.LabelParent2.Text = "subscrib a new parent"
Me.LabelParent2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.LabelParent2.VisitedLinkColor = System.Drawing.SystemColors.HotTrack
'
'FormChildID
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.ClientSize = New System.Drawing.Size(544, 381)
Me.Controls.Add(Me.LabelParent2)
Me.Controls.Add(Me.LabelParent1)
Me.Controls.Add(Me.DTPBord)
Me.Controls.Add(Me.LabelAge)
Me.Controls.Add(Me.LabelPlanning)
Me.Controls.Add(Me.LabelIdentity)
Me.Controls.Add(Me.LabelAddress)
Me.Controls.Add(Me.LabelBornDate)
Me.Controls.Add(Me.ButtonParent2)
Me.Controls.Add(Me.ButtonParent1)
Me.Controls.Add(Me.GroupBox2)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MinimumSize = New System.Drawing.Size(550, 410)
Me.Name = "FormChildID"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Child ID"
Me.Controls.SetChildIndex(Me.ButtonEdit, 0)
Me.Controls.SetChildIndex(Me.ButtonClose, 0)
Me.Controls.SetChildIndex(Me.TBFirstName, 0)
Me.Controls.SetChildIndex(Me.TBLastName, 0)
Me.Controls.SetChildIndex(Me.TBAddress, 0)
Me.Controls.SetChildIndex(Me.RBMale, 0)
Me.Controls.SetChildIndex(Me.RBFemale, 0)
Me.Controls.SetChildIndex(Me.GroupBox2, 0)
Me.Controls.SetChildIndex(Me.ButtonParent1, 0)
Me.Controls.SetChildIndex(Me.ButtonParent2, 0)
Me.Controls.SetChildIndex(Me.LabelBornDate, 0)
Me.Controls.SetChildIndex(Me.LabelAddress, 0)
Me.Controls.SetChildIndex(Me.LabelIdentity, 0)
Me.Controls.SetChildIndex(Me.LabelPlanning, 0)
Me.Controls.SetChildIndex(Me.LabelAge, 0)
Me.Controls.SetChildIndex(Me.DTPBord, 0)
Me.Controls.SetChildIndex(Me.LabelParent1, 0)
Me.Controls.SetChildIndex(Me.LabelParent2, 0)
Me.GroupBox2.ResumeLayout(False)
Me.GroupBox2.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents GroupBox2 As System.Windows.Forms.GroupBox
Friend WithEvents CBMonday As System.Windows.Forms.CheckBox
Friend WithEvents CBSunday As System.Windows.Forms.CheckBox
Friend WithEvents CBSaturday As System.Windows.Forms.CheckBox
Friend WithEvents CBFriday As System.Windows.Forms.CheckBox
Friend WithEvents CBThursday As System.Windows.Forms.CheckBox
Friend WithEvents CBWednesday As System.Windows.Forms.CheckBox
Friend WithEvents CBTuesday As System.Windows.Forms.CheckBox
Friend WithEvents ButtonParent1 As System.Windows.Forms.Button
Friend WithEvents ButtonParent2 As System.Windows.Forms.Button
Friend WithEvents ButtonBS As System.Windows.Forms.Button
Friend WithEvents LabelAddress As System.Windows.Forms.Label
Friend WithEvents LabelIdentity As System.Windows.Forms.Label
Friend WithEvents LabelPlanning As System.Windows.Forms.Label
Friend WithEvents LabelAge As System.Windows.Forms.Label
Friend WithEvents DTPBord As System.Windows.Forms.DateTimePicker
Friend WithEvents LabelBornDate As System.Windows.Forms.Label
Friend WithEvents LabelParent1 As System.Windows.Forms.LinkLabel
Friend WithEvents LabelParent2 As System.Windows.Forms.LinkLabel
Friend WithEvents LabelBS As System.Windows.Forms.LinkLabel
End Class

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIAB+AQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAlw
SFlzAAALEwAACxMBAJqcGAAAATBJREFUOI2dkz1Ow0AQRp+Do5QcgxZxAFquQMMB0nIBGpo0tJEQB0Di
EIgL0CPR0SChQBA4/tnMNxS7mCDHJMLSalce7/Ob2dkMGAA7QJZG3+NpGODu7gA5MARGaR78ARAQgDrN
LWD0cH/17jJwEcEeVdIaNxRKqsWcg6PJboKpNXAZe/uHPxvW2Msabm8uSabVdyQHBrjAnfFw0ut//nTC
4qMipdnWKo+m8c/TcLrWINQNs+cZZtaJ5QBZ2jQeXvQanD0ek3kXnscUY2CTAb2ArQ2673+lsNEgnlx/
CpsM+lPYsgbZmlgEyADHXSyb0PmoqQOSpePuAmTLBbKGt5dXQt0FSEZZlMgcYiF8FRCaYs7d9ZTis0RL
tS0d281xOZKQCVYuEsSWHPGP2+juAvgCwODN5kOjKQoAAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@@ -0,0 +1,517 @@
Imports ApplicationCrèche_1.IDFormMode
Public Class FormChildID
Inherits FormID
' ----- Private Attributes -----
Private actualFormMode As IDFormMode
Private meetID As Integer
Private oldBSID As Integer
Private newBSID As Integer
' ----- Initialisators -----
Private Sub FormChildID_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub New(aFormMode As IDFormMode, Optional aChild As Child = Nothing)
Console.WriteLine("FormChildID : Begining of a new instance")
' Cet appel est requis par le concepteur.
InitializeComponent()
' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
If aFormMode = CREATOR Or aChild Is Nothing Then
ChangeMode(CREATOR)
oldBSID = 0
meetID = 0
Else
ChangeMode(aFormMode, aChild)
If Not aChild.meet Is Nothing Then
oldBSID = dbdata.getBabysitterByMeetID(aChild.meet.id).id
End If
End If
End Sub
' ----- Methods ------
Private Function refreshBS(aBS As BabySitter)
If Not aBS Is Nothing Then
Me.LabelBS.Text = aBS.firstname + " " + aBS.lastname + " | " + aBS.phone1
newBSID = aBS.id
Return True
Else
LabelBS.Text = ""
newBSID = Nothing
End If
Return False
End Function
Public Function refreshParent1(aParent As Parent) As Boolean
If Not aParent Is Nothing Then
Me.LabelParent1.Text = aParent.firstname + " " + aParent.lastname + " | " + aParent.phone
Me.LabelParent1.Tag = aParent.id
Return True
Else
Me.LabelParent2.Tag = 0
Me.LabelParent2.Text = "subscrib a new parent"
End If
Return False
End Function
Public Function refreshParent2(aParent As Parent) As Boolean
If Not aParent Is Nothing Then
Me.LabelParent2.Text = aParent.firstname + " " + aParent.lastname + " | " + aParent.phone
Me.LabelParent2.Tag = aParent.id
Return True
Else
Me.LabelParent2.Tag = 0
Me.LabelParent2.Text = "subscrib a new parent"
End If
Return False
End Function
Private Sub setupCheckboxes(aMeet As Meet)
CBFriday.Checked = aMeet.friday
CBMonday.Checked = aMeet.monday
CBWednesday.Checked = aMeet.wednesday
CBSaturday.Checked = aMeet.saturday
CBSunday.Checked = aMeet.sunday
CBThursday.Checked = aMeet.thursday
CBTuesday.Checked = aMeet.tuesday
meetID = aMeet.id
End Sub
''' <summary>
''' Get the meet from the form. If the meet is loaded from the database, his ID is added. Else the meet have an id = to 0
''' </summary>
''' <returns>The current meet</returns>
''' <remarks>The meet number is based on the old recorded BabySitter ID (oldBSID)</remarks>
Private Function getMeet() As Meet
Dim aMeet As Meet = Nothing
If oldBSID = 0 Then
aMeet = New Meet(0)
Else
aMeet = New Meet(CInt(meetID))
End If
aMeet.monday = CBMonday.Checked
aMeet.tuesday = CBTuesday.Checked
aMeet.wednesday = CBWednesday.Checked
aMeet.thursday = CBThursday.Checked
aMeet.friday = CBFriday.Checked
aMeet.saturday = CBSaturday.Checked
aMeet.sunday = CBSunday.Checked
Return aMeet
End Function
''' <summary>
''' Get the Child with all informations that the user have filled up.
''' </summary>
''' <returns>a Child with the ID 0 if it is a new child or this current ID.</returns>
''' <remarks></remarks>
Public Function getChildFromIntern() As Child
Dim newChild As Child = New Child(Me.Tag)
newChild.firstname = TBFirstName.Text
newChild.lastname = TBLastName.Text
newChild.gender = RBMale.Checked
newChild.address = TBAddress.Text
newChild.bornDate = DTPBord.Value
If Not LabelParent1.Tag Is Nothing Then
newChild.parent1 = dbdata.getParentByID(LabelParent1.Tag)
End If
If Not LabelParent2.Tag Is Nothing Then
newChild.parent2 = dbdata.getParentByID(LabelParent2.Tag)
End If
newChild.meet = getMeet()
Return (newChild)
End Function
''' <summary>
''' Fill all controls with information given as a Child
''' </summary>
''' <param name="aChild">The child to load</param>
''' <returns>false is the parameter is nothing else true.</returns>
''' <remarks></remarks>
Private Function updateChildFromExtern(aChild As Child) As Boolean
' Fill up controls with all the data we have.
If Not aChild Is Nothing Then
Me.Tag = aChild.id
'Me.Text = aChild.firstname + " " + aChild.lastname
Me.TBFirstName.Text = aChild.firstname 'Firstname
Me.TBLastName.Text = aChild.lastname 'Lastname
If aChild.gender Then 'Gender
Me.RBMale.Checked = True
Else
Me.RBFemale.Checked = True
End If
Me.DTPBord.Value = aChild.bornDate 'BornDate
Me.LabelAge.Text = DateDiff(DateInterval.Year, aChild.bornDate, Date.Now).ToString + " year(s) old" 'Age
Me.TBAddress.Text = aChild.address 'Address
If Not aChild.parent1 Is Nothing Then 'Parent1 Info
Me.LabelParent1.Text = aChild.parent1.firstname + " " + aChild.parent1.lastname + " | " + aChild.parent1.phone
Me.LabelParent1.Tag = aChild.parent1.id
Else
Me.LabelParent1.Text = "subscrib a new parent"
End If
If Not aChild.parent2 Is Nothing Then 'Parent2 Info
Me.LabelParent2.Text = aChild.parent2.firstname + " " + aChild.parent2.lastname + " | " + aChild.parent2.phone
Me.LabelParent2.Tag = aChild.parent2.id
Else
Me.LabelParent2.Text = "subscrib a new parent"
End If
'Title
If actualFormMode = VIEWER Then
Me.Text = aChild.firstname + " " + aChild.lastname
Else
Me.Text = aChild.firstname + " " + aChild.lastname + " (Edit)"
End If
' A babysitter is loader only if the child have a meet
If Not aChild.meet Is Nothing Then
Dim aBS As BabySitter = dbdata.getBabysitterByMeetID(aChild.meet.id)
refreshBS(aBS) 'The babysitter id is stored with data
setupCheckboxes(aChild.meet) 'The meet id is stored with data
End If
Return True
End If
Return False
End Function
''' <summary>
''' Polyvalence Mechanism. Change the 'MODE' of the windows
''' </summary>
''' <param name="aFormMode">The new mode like EDITOR or CREATOR</param>
''' <param name="aChild">Some new info about the child.</param>
''' <remarks></remarks>
Private Sub ChangeMode(aFormMode As IDFormMode, Optional aChild As Child = Nothing)
If aFormMode = IDFormMode.CREATOR Then ' CREATOR MODE
Me.actualFormMode = CREATOR
Console.WriteLine("FormChildID : Switch to CREATOR Mode")
'Change of the main triggers labels + title
'Me.Icon
Me.Text = "New child"
Me.ButtonClose.Text = "Cancel"
Me.ButtonEdit.Text = "Save"
Me.RBMale.Checked = True
Me.LabelAge.Text = ""
Me.ButtonEdit.Image = My.Resources.AddSheet2
Me.Tag = 0
ElseIf aFormMode = IDFormMode.VIEWER And Not aChild Is Nothing Then ' VIEW MODE
Me.actualFormMode = VIEWER
Console.WriteLine("FormChildID : Switch to VIEWER Mode")
'We change the main triggers labels + title
Me.ButtonClose.Text = "Close"
Me.ButtonEdit.Text = "Edit"
Me.ButtonEdit.Image = My.Resources.EditSheet2
'Activate most important security aspect (not show a window that can mat a save somewhere else)
ButtonParent1.Enabled = False
ButtonParent2.Enabled = False
ButtonBS.Enabled = False
LabelParent1.Enabled = False
LabelParent2.Enabled = False
TBFirstName.Enabled = False
TBLastName.Enabled = False
DTPBord.Enabled = False
RBFemale.Enabled = False
RBMale.Enabled = False
TBAddress.Enabled = False
CBFriday.Enabled = False
CBMonday.Enabled = False
CBSaturday.Enabled = False
CBSunday.Enabled = False
CBThursday.Enabled = False
CBTuesday.Enabled = False
CBWednesday.Enabled = False
LabelBS.Enabled = False
ButtonBS.Enabled = False
ElseIf aFormMode = IDFormMode.EDITOR Then ' EDITOR MODE WITH THE CURRENT CHILD
Console.WriteLine("FormChildID : Switch to Editor Mode")
Me.actualFormMode = EDITOR
''We change the main triggers labels + title
Me.ButtonClose.Text = "Cancel"
Me.ButtonEdit.Text = "Update"
Me.ButtonEdit.Image = My.Resources.ValidedSheet
Me.Text = TBFirstName.Text + " " + TBLastName.Text + " (Edit)"
'Turn off anti edit security
ButtonParent1.Enabled = True
ButtonParent2.Enabled = True
ButtonBS.Enabled = True
LabelParent1.Enabled = True
LabelParent2.Enabled = True
TBFirstName.Enabled = True
TBLastName.Enabled = True
DTPBord.Enabled = True
RBFemale.Enabled = True
RBMale.Enabled = True
TBAddress.Enabled = True
CBFriday.Enabled = True
CBMonday.Enabled = True
CBSaturday.Enabled = True
CBSunday.Enabled = True
CBThursday.Enabled = True
CBTuesday.Enabled = True
CBWednesday.Enabled = True
LabelBS.Enabled = True
ButtonBS.Enabled = True
Else
Console.WriteLine("FormChildId : No correct mode has been found.")
End If
' Fill up controls with all the data we have.
updateChildFromExtern(aChild)
End Sub
' ----- Handles and Listerners -----
'Edit and click
Protected Overrides Sub ButtonEdit_Click(sender As System.Object, e As System.EventArgs)
Dim Validated As Boolean = True
If Me.actualFormMode = VIEWER Then 'EDIT'
Me.ChangeMode(EDITOR)
ElseIf Me.actualFormMode = CREATOR Then 'SAVE'
' Error Provider
If String.IsNullOrEmpty(TBFirstName.Text) Then
ErrorProvider1.SetError(TBFirstName, "The first name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBLastName.Text) Then
ErrorProvider1.SetError(TBLastName, "The last name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If Date.Compare(DTPBord.Value, Today) > 0 Then
ErrorProvider1.SetError(DTPBord, "The date of born is in the futur." & vbNewLine & "Please insert a valid born date.")
Validated = False
End If
'If Date.Compare(Today, DTPBord.Value) = 0 Then
' ErrorProvider1.SetError(DTPBord, "The date of born could not be today" & vbNewLine & "Please insert a born date in the past")
' Validated = False
'End If
If String.IsNullOrEmpty(TBAddress.Text) Then
ErrorProvider1.SetError(LabelAddress, "The address field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If (CBMonday.Checked = True Or
CBTuesday.Checked = True Or
CBWednesday.Checked = True Or
CBThursday.Checked = True Or
CBFriday.Checked = True Or
CBSunday.Checked = True Or
CBSunday.Checked = True) And
newBSID = 0 Then
ErrorProvider1.SetError(ButtonBS, "There is no babysitter for the current planning" & vbNewLine & "Please select a baysitter on the list or uncheck all the days.")
Validated = False
End If
If Not Validated Then
Exit Sub
End If
' Record
Dim aChild As Child = getChildFromIntern() ' We save the child on the database
Me.Tag = dbdata.addChild(aChild) ' The new ID of the child is stored in the Me.tag
If newBSID <> 0 Then
' save of the child
meetID = dbdata.addMeet(aChild.meet, Me.Tag)
' then update of the babysitter
dbdata.updateBabysitterMeets(meetID, newBSID, getFirstFreeMeetOf(newBSID))
End If
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Hide()
ElseIf Me.actualFormMode = EDITOR Then 'UPDATE'
' Error Provider
If String.IsNullOrEmpty(TBFirstName.Text) Then
ErrorProvider1.SetError(TBFirstName, "The first name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBLastName.Text) Then
ErrorProvider1.SetError(TBLastName, "The last name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If Date.Compare(DTPBord.Value, Today) > 0 Then
ErrorProvider1.SetError(DTPBord, "The date of born is in the futur." & vbNewLine & "Please insert a valid born date.")
Validated = False
End If
'If Date.Compare(Today, DTPBord.Value) = 0 Then
' ErrorProvider1.SetError(DTPBord, "The date of born could not be today" & vbNewLine & "Please insert a born date in the past")
' Validated = False
'End If
If String.IsNullOrEmpty(TBAddress.Text) Then
ErrorProvider1.SetError(LabelAddress, "The address field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If (CBMonday.Checked = True Or
CBTuesday.Checked = True Or
CBWednesday.Checked = True Or
CBThursday.Checked = True Or
CBFriday.Checked = True Or
CBSunday.Checked = True Or
CBSunday.Checked = True) And
newBSID = 0 Then
ErrorProvider1.SetError(ButtonBS, "There is no babysitter for the current planning" & vbNewLine & "Please select a baysitter on the list or uncheck all the days.")
Validated = False
End If
If Not Validated Then
Exit Sub
End If
' Record
Dim aChild As Child = getChildFromIntern()
dbdata.editChild(aChild) 'Update of the child data
'Case 1, there is no choosen BS
If newBSID <> oldBSID And newBSID = 0 Then
dbdata.updateBabysitterMeets(0, , , oldBSID, getFirstFreeMeetOf(oldBSID)) 'The babysitter gain a free meet space
dbdata.deleteMeet(meetID) ' No BS, no keep
ElseIf newBSID = oldBSID And oldBSID <> 0 Then
'Case 2 : The same BS is here
Dim aMeet As Meet = aChild.meet 'The meet could have change or not between the database and the form, no problem. The Id stay the same.
dbdata.editMeet(aMeet)
' No neet to update the BS, because the meet ID stay the same.
ElseIf newBSID <> oldBSID And newBSID <> 0 And oldBSID <> 0 Then
' Case 3 : There is a change between old BS and new BS
Dim aMeet As Meet = aChild.meet 'The meet have change between the database and the form but the Id stay the same.
dbdata.editMeet(aMeet)
dbdata.updateBabysitterMeets(meetID, newBSID, getFirstFreeMeetOf(newBSID), oldBSID, getFirstFreeMeetOf(oldBSID)) 'So we need to remove the id from the old BS and add it to the new BS
ElseIf newBSID <> 0 And oldBSID = 0 Then
' Case 4 : add a new BS on a existing child
Dim aMeet As Meet = aChild.meet
meetID = dbdata.addMeet(aMeet, aChild.id)
Dim aBS As BabySitter = dbdata.getBabysitterByID(newBSID)
dbdata.updateBabysitterMeets(meetID, newBSID, getFirstFreeMeetOf(newBSID))
End If
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Hide()
Else
'Don't know how to go here...
Console.WriteLine("FormChildID : Is in standart mode !")
End If
End Sub
'Cancel
Protected Overrides Sub ButtonClose_Click(sender As System.Object, e As System.EventArgs)
Console.WriteLine("FormChildID : Closing instance")
Me.DialogResult = Windows.Forms.DialogResult.Cancel
Me.Hide()
End Sub
' Parents selector
Private Sub ButtonParent1_Click(sender As System.Object, e As System.EventArgs) Handles ButtonParent1.Click
Dim listofParentForm As FormList = New FormList(PersonType.Parent, ListFormMode.Selector)
Dim conclusion As DialogResult = listofParentForm.ShowDialog()
Console.WriteLine("Returned in : " + conclusion.ToString)
If (conclusion = Windows.Forms.DialogResult.OK) Then
Dim aParent As Parent = dbdata.getParentByID(listofParentForm.Tag)
Console.WriteLine("FormChildID : receving " + aParent.toString)
refreshParent1(aParent)
Else
If dbdata.getParentByID(listofParentForm.Tag) Is Nothing Then
refreshParent2(Nothing)
End If
End If
listofParentForm.Dispose()
End Sub
Private Sub LabelParent1_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LabelParent1.LinkClicked
Dim aParentForm As FormParentID
If Me.LabelParent1.Tag <> 0 Then
Dim theParent As Parent = dbdata.getParentByID(Me.LabelParent1.Tag)
aParentForm = New FormParentID(EDITOR, theParent)
Else
aParentForm = New FormParentID(CREATOR)
End If
Dim conclusion As DialogResult = aParentForm.ShowDialog()
If (conclusion = Windows.Forms.DialogResult.OK) Then
Dim aParent As Parent = dbdata.getParentByID(aParentForm.Tag)
Console.WriteLine("FormChildID : receving " + aParent.toString)
refreshParent1(aParent)
End If
aParentForm.Dispose()
End Sub
Private Sub ButtonParent2_Click(sender As System.Object, e As System.EventArgs) Handles ButtonParent2.Click
Dim listofParentForm As FormList = New FormList(PersonType.Parent, ListFormMode.Selector)
Dim conclusion As DialogResult = listofParentForm.ShowDialog()
Console.WriteLine("Returned in : " + conclusion.ToString)
If (conclusion = Windows.Forms.DialogResult.OK) Then
Dim aParent As Parent = dbdata.getParentByID(listofParentForm.Tag)
Console.WriteLine("FormChildID : receving " + aParent.toString)
refreshParent2(aParent)
Else
If dbdata.getParentByID(listofParentForm.Tag) Is Nothing Then
refreshParent2(Nothing)
End If
End If
listofParentForm.Dispose()
End Sub
Private Sub LabelParent2_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LabelParent2.LinkClicked
Dim aParentForm As FormParentID
If Me.LabelParent1.Tag <> 0 Then
Dim theParent As Parent = dbdata.getParentByID(Me.LabelParent2.Tag)
aParentForm = New FormParentID(EDITOR, theParent)
Else
aParentForm = New FormParentID(CREATOR)
End If
Dim conclusion As DialogResult = aParentForm.ShowDialog()
Console.WriteLine("Returned in : " + conclusion.ToString)
If (conclusion = Windows.Forms.DialogResult.OK) Then
Dim aParent As Parent = dbdata.getParentByID(aParentForm.Tag)
Console.WriteLine("FormChildID : receving " + aParent.toString)
refreshParent2(aParent)
End If
aParentForm.Dispose()
End Sub
Private Sub ButtonBS_Click(sender As System.Object, e As System.EventArgs) Handles ButtonBS.Click
Dim aMeet As Meet = getMeet()
Dim listBD As FormList = New FormList(PersonType.BabySitter, ListFormMode.SelectFiltered, aMeet)
Dim conclusion As DialogResult = listBD.ShowDialog()
If conclusion = Windows.Forms.DialogResult.OK Then
Dim aBS As BabySitter = dbdata.getBabysitterByID(listBD.Tag)
Console.WriteLine("FormChildID : receving " + aBS.toString)
refreshBS(aBS)
End If
listBD.Dispose()
End Sub
Private Sub LinkLabelBS_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles LabelBS.LinkClicked
If newBSID <> 0 Then
Dim aBS As BabySitter = dbdata.getBabysitterByID(newBSID)
Dim bsForm As FormBabySitterID = New FormBabySitterID(VIEWER, aBS)
Dim conclusion As DialogResult = bsForm.ShowDialog()
End If
End Sub
Private Sub DTPBord_ValueChanged(sender As System.Object, e As System.EventArgs) Handles DTPBord.ValueChanged
Me.LabelAge.Text = DateDiff(DateInterval.Year, DTPBord.Value, Date.Now).ToString + " year(s) old" 'Age
ErrorProvider1.SetError(DTPBord, "")
End Sub
Private Sub CBWednesday_CheckedChanged(sender As System.Object, e As System.EventArgs) Handles CBMonday.CheckedChanged, CBTuesday.CheckedChanged, CBWednesday.CheckedChanged, CBThursday.CheckedChanged, CBFriday.CheckedChanged, CBSaturday.CheckedChanged, CBSunday.CheckedChanged
If Me.Visible = True Then
'On réintialise la babysitter
refreshBS(Nothing)
End If
ErrorProvider1.SetError(ButtonBS, "")
End Sub
End Class

View File

@@ -0,0 +1,173 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormID
Inherits System.Windows.Forms.Form
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.ButtonEdit = New System.Windows.Forms.Button()
Me.ButtonClose = New System.Windows.Forms.Button()
Me.LabelFirstName = New System.Windows.Forms.Label()
Me.LabelLastName = New System.Windows.Forms.Label()
Me.TBFirstName = New System.Windows.Forms.TextBox()
Me.TBLastName = New System.Windows.Forms.TextBox()
Me.TBAddress = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.RBMale = New System.Windows.Forms.RadioButton()
Me.RBFemale = New System.Windows.Forms.RadioButton()
Me.ErrorProvider1 = New System.Windows.Forms.ErrorProvider(Me.components)
CType(Me.ErrorProvider1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'ButtonEdit
'
Me.ButtonEdit.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ButtonEdit.Location = New System.Drawing.Point(376, 346)
Me.ButtonEdit.Name = "ButtonEdit"
Me.ButtonEdit.Size = New System.Drawing.Size(75, 23)
Me.ButtonEdit.TabIndex = 20
Me.ButtonEdit.Text = "Edit"
Me.ButtonEdit.UseVisualStyleBackColor = True
'
'ButtonClose
'
Me.ButtonClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ButtonClose.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.ButtonClose.Location = New System.Drawing.Point(457, 346)
Me.ButtonClose.Name = "ButtonClose"
Me.ButtonClose.Size = New System.Drawing.Size(75, 23)
Me.ButtonClose.TabIndex = 21
Me.ButtonClose.Text = "Close"
Me.ButtonClose.UseVisualStyleBackColor = True
'
'LabelFirstName
'
Me.LabelFirstName.AutoSize = True
Me.LabelFirstName.Location = New System.Drawing.Point(12, 60)
Me.LabelFirstName.Name = "LabelFirstName"
Me.LabelFirstName.Size = New System.Drawing.Size(63, 13)
Me.LabelFirstName.TabIndex = 7
Me.LabelFirstName.Text = "First name:"
'
'LabelLastName
'
Me.LabelLastName.AutoSize = True
Me.LabelLastName.Location = New System.Drawing.Point(12, 88)
Me.LabelLastName.Name = "LabelLastName"
Me.LabelLastName.Size = New System.Drawing.Size(61, 13)
Me.LabelLastName.TabIndex = 8
Me.LabelLastName.Text = "Last name:"
'
'TBFirstName
'
Me.TBFirstName.Location = New System.Drawing.Point(80, 57)
Me.TBFirstName.Name = "TBFirstName"
Me.TBFirstName.Size = New System.Drawing.Size(165, 22)
Me.TBFirstName.TabIndex = 0
'
'TBLastName
'
Me.TBLastName.Location = New System.Drawing.Point(80, 85)
Me.TBLastName.Name = "TBLastName"
Me.TBLastName.Size = New System.Drawing.Size(165, 22)
Me.TBLastName.TabIndex = 1
'
'TBAddress
'
Me.TBAddress.Location = New System.Drawing.Point(12, 182)
Me.TBAddress.Multiline = True
Me.TBAddress.Name = "TBAddress"
Me.TBAddress.Size = New System.Drawing.Size(258, 87)
Me.TBAddress.TabIndex = 4
'
'Label3
'
Me.Label3.AutoSize = True
Me.Label3.Location = New System.Drawing.Point(12, 115)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(48, 13)
Me.Label3.TabIndex = 9
Me.Label3.Text = "Gender:"
'
'RBMale
'
Me.RBMale.AutoSize = True
Me.RBMale.Location = New System.Drawing.Point(80, 113)
Me.RBMale.Name = "RBMale"
Me.RBMale.Size = New System.Drawing.Size(50, 17)
Me.RBMale.TabIndex = 2
Me.RBMale.TabStop = True
Me.RBMale.Text = "Male"
Me.RBMale.UseVisualStyleBackColor = True
'
'RBFemale
'
Me.RBFemale.AutoSize = True
Me.RBFemale.Location = New System.Drawing.Point(171, 113)
Me.RBFemale.Name = "RBFemale"
Me.RBFemale.Size = New System.Drawing.Size(61, 17)
Me.RBFemale.TabIndex = 3
Me.RBFemale.TabStop = True
Me.RBFemale.Text = "Female"
Me.RBFemale.UseVisualStyleBackColor = True
'
'ErrorProvider1
'
Me.ErrorProvider1.ContainerControl = Me
'
'FormID
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.CancelButton = Me.ButtonClose
Me.ClientSize = New System.Drawing.Size(544, 381)
Me.Controls.Add(Me.RBFemale)
Me.Controls.Add(Me.RBMale)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.TBAddress)
Me.Controls.Add(Me.TBLastName)
Me.Controls.Add(Me.TBFirstName)
Me.Controls.Add(Me.LabelLastName)
Me.Controls.Add(Me.LabelFirstName)
Me.Controls.Add(Me.ButtonClose)
Me.Controls.Add(Me.ButtonEdit)
Me.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.Name = "FormID"
Me.Text = "FormID"
CType(Me.ErrorProvider1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents LabelFirstName As System.Windows.Forms.Label
Friend WithEvents LabelLastName As System.Windows.Forms.Label
Friend WithEvents Label3 As System.Windows.Forms.Label
Protected WithEvents ButtonEdit As System.Windows.Forms.Button
Protected WithEvents ButtonClose As System.Windows.Forms.Button
Protected WithEvents TBFirstName As System.Windows.Forms.TextBox
Protected WithEvents TBLastName As System.Windows.Forms.TextBox
Protected WithEvents TBAddress As System.Windows.Forms.TextBox
Protected WithEvents RBMale As System.Windows.Forms.RadioButton
Protected WithEvents RBFemale As System.Windows.Forms.RadioButton
Friend WithEvents ErrorProvider1 As System.Windows.Forms.ErrorProvider
End Class

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ErrorProvider1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>

View File

@@ -0,0 +1,26 @@
Public Class FormID
Protected Overridable Sub ButtonEdit_Click(sender As System.Object, e As System.EventArgs) Handles ButtonEdit.Click
End Sub
Protected Overridable Sub ButtonClose_Click(sender As System.Object, e As System.EventArgs) Handles ButtonClose.Click
End Sub
Private Sub FormID_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub
Protected Overridable Sub TBFirstName_TextChanged(sender As System.Object, e As System.EventArgs) Handles TBFirstName.TextChanged
ErrorProvider1.SetError(TBAddress, "")
End Sub
Protected Overridable Sub TBLastName_TextChanged(sender As System.Object, e As System.EventArgs) Handles TBLastName.TextChanged
ErrorProvider1.SetError(TBLastName, "")
End Sub
Protected Overridable Sub TBAddress_TextChanged(sender As System.Object, e As System.EventArgs) Handles TBAddress.TextChanged
ErrorProvider1.SetError(TBAddress, "")
End Sub
End Class

View File

@@ -0,0 +1,245 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormList
Inherits System.Windows.Forms.Form
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FormList))
Me.ToolStrip = New System.Windows.Forms.ToolStrip()
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
Me.ListView = New System.Windows.Forms.ListView()
Me.ColumnHeader = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeader1 = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.CMSSep = New System.Windows.Forms.ToolStripSeparator()
Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
Me.CMSSelect = New System.Windows.Forms.ToolStripMenuItem()
Me.CMSShow = New System.Windows.Forms.ToolStripMenuItem()
Me.CMSEdit = New System.Windows.Forms.ToolStripMenuItem()
Me.CMSDelete = New System.Windows.Forms.ToolStripMenuItem()
Me.TSButtonAdd = New System.Windows.Forms.ToolStripButton()
Me.TSButtonSelect = New System.Windows.Forms.ToolStripButton()
Me.TSButtonShow = New System.Windows.Forms.ToolStripButton()
Me.TSButtonEdit = New System.Windows.Forms.ToolStripButton()
Me.TSButtonDelete = New System.Windows.Forms.ToolStripButton()
Me.TSButtonClose = New System.Windows.Forms.ToolStripButton()
Me.TSPin = New System.Windows.Forms.ToolStripButton()
Me.ToolStrip.SuspendLayout()
Me.ContextMenuStrip1.SuspendLayout()
Me.SuspendLayout()
'
'ToolStrip
'
Me.ToolStrip.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden
Me.ToolStrip.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSButtonAdd, Me.ToolStripSeparator1, Me.TSButtonSelect, Me.TSButtonShow, Me.TSButtonEdit, Me.TSButtonDelete, Me.TSButtonClose, Me.ToolStripSeparator2, Me.TSPin})
Me.ToolStrip.Location = New System.Drawing.Point(0, 0)
Me.ToolStrip.Name = "ToolStrip"
Me.ToolStrip.Size = New System.Drawing.Size(309, 25)
Me.ToolStrip.TabIndex = 0
Me.ToolStrip.Text = "ToolStrip1"
'
'ToolStripSeparator1
'
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25)
'
'ListView
'
Me.ListView.AllowColumnReorder = True
Me.ListView.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeader, Me.ColumnHeader1})
Me.ListView.ContextMenuStrip = Me.ContextMenuStrip1
Me.ListView.Dock = System.Windows.Forms.DockStyle.Fill
Me.ListView.FullRowSelect = True
Me.ListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.Nonclickable
Me.ListView.Location = New System.Drawing.Point(0, 25)
Me.ListView.MultiSelect = False
Me.ListView.Name = "ListView"
Me.ListView.Size = New System.Drawing.Size(309, 386)
Me.ListView.TabIndex = 1
Me.ListView.UseCompatibleStateImageBehavior = False
Me.ListView.View = System.Windows.Forms.View.Details
'
'ColumnHeader
'
Me.ColumnHeader.Text = "Name"
Me.ColumnHeader.Width = 300
'
'ColumnHeader1
'
Me.ColumnHeader1.Text = "Address"
Me.ColumnHeader1.Width = 161
'
'ContextMenuStrip1
'
Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.CMSSelect, Me.CMSSep, Me.CMSShow, Me.CMSEdit, Me.CMSDelete})
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
Me.ContextMenuStrip1.Size = New System.Drawing.Size(167, 98)
'
'CMSSep
'
Me.CMSSep.Name = "CMSSep"
Me.CMSSep.Size = New System.Drawing.Size(163, 6)
'
'ToolStripSeparator2
'
Me.ToolStripSeparator2.Name = "ToolStripSeparator2"
Me.ToolStripSeparator2.Size = New System.Drawing.Size(6, 25)
'
'CMSSelect
'
Me.CMSSelect.Enabled = False
Me.CMSSelect.Image = Global.ApplicationCrèche_1.My.Resources.Resources.SelectSheet
Me.CMSSelect.Name = "CMSSelect"
Me.CMSSelect.Size = New System.Drawing.Size(166, 22)
Me.CMSSelect.Text = "Select"
'
'CMSShow
'
Me.CMSShow.Enabled = False
Me.CMSShow.Image = Global.ApplicationCrèche_1.My.Resources.Resources.NormalSheetLight
Me.CMSShow.Name = "CMSShow"
Me.CMSShow.Size = New System.Drawing.Size(166, 22)
Me.CMSShow.Text = "Show selection..."
'
'CMSEdit
'
Me.CMSEdit.Enabled = False
Me.CMSEdit.Image = Global.ApplicationCrèche_1.My.Resources.Resources.EditSheet2
Me.CMSEdit.Name = "CMSEdit"
Me.CMSEdit.Size = New System.Drawing.Size(166, 22)
Me.CMSEdit.Text = "Edit selection..."
'
'CMSDelete
'
Me.CMSDelete.Enabled = False
Me.CMSDelete.Image = Global.ApplicationCrèche_1.My.Resources.Resources.DeleteSheet2
Me.CMSDelete.Name = "CMSDelete"
Me.CMSDelete.Size = New System.Drawing.Size(166, 22)
Me.CMSDelete.Text = "Delete selection..."
'
'TSButtonAdd
'
Me.TSButtonAdd.Image = Global.ApplicationCrèche_1.My.Resources.Resources.AddSheet2
Me.TSButtonAdd.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TSButtonAdd.Name = "TSButtonAdd"
Me.TSButtonAdd.Size = New System.Drawing.Size(49, 22)
Me.TSButtonAdd.Text = "Add"
'
'TSButtonSelect
'
Me.TSButtonSelect.Enabled = False
Me.TSButtonSelect.Image = Global.ApplicationCrèche_1.My.Resources.Resources.SelectSheet
Me.TSButtonSelect.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TSButtonSelect.Name = "TSButtonSelect"
Me.TSButtonSelect.Size = New System.Drawing.Size(58, 22)
Me.TSButtonSelect.Text = "Select"
'
'TSButtonShow
'
Me.TSButtonShow.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.TSButtonShow.Enabled = False
Me.TSButtonShow.Image = Global.ApplicationCrèche_1.My.Resources.Resources.NormalSheetLight
Me.TSButtonShow.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TSButtonShow.Name = "TSButtonShow"
Me.TSButtonShow.Size = New System.Drawing.Size(23, 22)
Me.TSButtonShow.Text = "Show"
'
'TSButtonEdit
'
Me.TSButtonEdit.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.TSButtonEdit.Enabled = False
Me.TSButtonEdit.Image = Global.ApplicationCrèche_1.My.Resources.Resources.EditSheet2
Me.TSButtonEdit.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TSButtonEdit.Name = "TSButtonEdit"
Me.TSButtonEdit.Size = New System.Drawing.Size(23, 22)
Me.TSButtonEdit.Text = "Edit"
'
'TSButtonDelete
'
Me.TSButtonDelete.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.TSButtonDelete.Enabled = False
Me.TSButtonDelete.Image = Global.ApplicationCrèche_1.My.Resources.Resources.DeleteSheet2
Me.TSButtonDelete.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TSButtonDelete.Name = "TSButtonDelete"
Me.TSButtonDelete.Size = New System.Drawing.Size(23, 22)
Me.TSButtonDelete.Text = "Delete"
'
'TSButtonClose
'
Me.TSButtonClose.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right
Me.TSButtonClose.Image = Global.ApplicationCrèche_1.My.Resources.Resources.CloseWindow
Me.TSButtonClose.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TSButtonClose.Name = "TSButtonClose"
Me.TSButtonClose.Size = New System.Drawing.Size(56, 22)
Me.TSButtonClose.Text = "Close"
'
'TSPin
'
Me.TSPin.Checked = True
Me.TSPin.CheckState = System.Windows.Forms.CheckState.Checked
Me.TSPin.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.TSPin.Image = Global.ApplicationCrèche_1.My.Resources.Resources.PingedWindows
Me.TSPin.ImageTransparentColor = System.Drawing.Color.Magenta
Me.TSPin.Name = "TSPin"
Me.TSPin.Size = New System.Drawing.Size(23, 22)
Me.TSPin.Text = "Pin"
'
'FormList
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(309, 411)
Me.Controls.Add(Me.ListView)
Me.Controls.Add(Me.ToolStrip)
Me.Font = New System.Drawing.Font("Segoe UI", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MinimumSize = New System.Drawing.Size(325, 450)
Me.Name = "FormList"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "List window"
Me.ToolStrip.ResumeLayout(False)
Me.ToolStrip.PerformLayout()
Me.ContextMenuStrip1.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ToolStrip As System.Windows.Forms.ToolStrip
Friend WithEvents ListView As System.Windows.Forms.ListView
Friend WithEvents TSButtonAdd As System.Windows.Forms.ToolStripButton
Friend WithEvents TSButtonEdit As System.Windows.Forms.ToolStripButton
Friend WithEvents TSButtonClose As System.Windows.Forms.ToolStripButton
Friend WithEvents TSButtonDelete As System.Windows.Forms.ToolStripButton
Friend WithEvents ColumnHeader As System.Windows.Forms.ColumnHeader
Friend WithEvents TSButtonSelect As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip
Friend WithEvents CMSSelect As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents CMSEdit As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents CMSDelete As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents CMSShow As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents TSButtonShow As System.Windows.Forms.ToolStripButton
Friend WithEvents CMSSep As System.Windows.Forms.ToolStripSeparator
Friend WithEvents ColumnHeader1 As System.Windows.Forms.ColumnHeader
Friend WithEvents TSPin As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator
End Class

View File

@@ -0,0 +1,135 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="ToolStrip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ContextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>118, 17</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIADWAAAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAlw
SFlzAAALEwAACxMBAJqcGAAAAIhJREFUOI3tkz0Lg0AMhp+TG1wEf6LQSRyu3Tu6i8O1k3D+RpcOB+nS
HlYUP27o4rPkheQlCSRKRIghiXIDCtBA+ol78MBLA6mxbtjiuDR10N3tTlsVWXKg8xgNkBvrZC/GOgHy
n+6lKniKC3qJb00YYS4x1qs7nBPgAa6PfpNhgo8+ZfX3b3wDHqZpVv32WD4AAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@@ -0,0 +1,320 @@
Public Class FormList
' ----- Privates Attributes -----
Private aTypeofPerson As PersonType
Private aFormMode As ListFormMode
' ----- Initialisators ------
Private Sub FormList_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub New(aTypeOfPerson As PersonType, aFormMode As ListFormMode, Optional aMeet As Meet = Nothing)
Console.WriteLine("FormList : Begining of a new instance")
' Cet appel est requis par le concepteur.
InitializeComponent()
' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
Me.aTypeofPerson = aTypeOfPerson
Me.aFormMode = aFormMode
' If we show the list to pick up someone and return him back to the calling window
If aFormMode = ListFormMode.Selector Then
TSButtonClose.Text = "Cancel"
TSButtonSelect.Visible = True
TSPin.Visible = False
CMSSelect.Visible = True
CMSSep.Visible = True
ListView.HeaderStyle = ColumnHeaderStyle.None
ListView.Columns(0).Width = 300
ListView.Columns(1).Width = 1
ElseIf aFormMode = ListFormMode.Viewer Then ' If we show the list to manage peoples inside
TSButtonClose.Text = "Close"
TSButtonSelect.Visible = False
CMSSelect.Visible = False
CMSSep.Visible = False
If aTypeOfPerson = PersonType.BabySitter Then TSPin.Visible = True
ListView.HeaderStyle = ColumnHeaderStyle.None
ListView.Columns(0).Width = 300
ListView.Columns(1).Width = 1
ElseIf aFormMode = ListFormMode.SelectFiltered Then ' Special mode to pick up a babysitter, without the possibility to add or delete one.
TSButtonClose.Text = "Cancel"
TSButtonAdd.Visible = False
TSButtonSelect.Visible = True
TSButtonDelete.Visible = False
TSPin.Visible = False
CMSDelete.Visible = False
ListView.HeaderStyle = ColumnHeaderStyle.None
ListView.Columns(0).Width = 300
ListView.Columns(1).Width = 1
ElseIf aFormMode = ListFormMode.SelectWithAdress Then ' Special mode to pick up a parent address
TSButtonClose.Text = "Cancel"
TSButtonAdd.Visible = False
TSButtonSelect.Visible = True
TSButtonDelete.Visible = False
TSPin.Visible = False
ListView.HeaderStyle = ColumnHeaderStyle.Nonclickable
ListView.Columns(0).Width = 140
ListView.Columns(1).Width = 160
CMSDelete.Visible = False
End If
loadList(aMeet)
If aTypeOfPerson = PersonType.BabySitter Then
Me.Text = "List of babysitters"
Me.TSButtonAdd.Text = "Add a babysitter"
ElseIf aTypeOfPerson = PersonType.Parent Then
Me.Text = "List of parent"
Me.TSButtonAdd.Text = "Add a parent"
Else
Console.WriteLine("FormList : " + aTypeOfPerson)
Me.Text = "List of " + aTypeOfPerson.ToString
End If
End Sub
' ----- Methodes -----
Private Sub ViewSelected()
If Me.aTypeofPerson = PersonType.BabySitter Then
Dim aBS As BabySitter = dbdata.getBabysitterByID(ListView.SelectedItems(0).Tag)
Dim aFormBS As FormBabySitterID = New FormBabySitterID(IDFormMode.VIEWER, aBS)
Dim conclusion As DialogResult = aFormBS.ShowDialog()
If conclusion = Windows.Forms.DialogResult.OK Then
reloadList()
End If
aFormBS.Dispose()
ElseIf Me.aTypeofPerson = PersonType.Parent Then
Dim aParent As Parent = dbdata.getParentByID(ListView.SelectedItems(0).Tag)
Dim aFormParent As FormParentID = New FormParentID(IDFormMode.VIEWER, aParent)
Dim conclusion As DialogResult = aFormParent.ShowDialog
If conclusion = Windows.Forms.DialogResult.OK Then
reloadList()
End If
aFormParent.Dispose()
End If
End Sub
''' <summary>
''' Show a window to edit the element
''' </summary>
''' <remarks></remarks>
Private Sub EditSelected()
If Me.aTypeofPerson = PersonType.BabySitter Then
Dim aBS As BabySitter = dbdata.getBabysitterByID(ListView.SelectedItems(0).Tag)
Dim aFormBS As FormBabySitterID = New FormBabySitterID(IDFormMode.EDITOR, aBS)
Dim conclusion As DialogResult = aFormBS.ShowDialog()
If conclusion = Windows.Forms.DialogResult.OK Then
reloadList()
End If
aFormBS.Dispose()
ElseIf Me.aTypeofPerson = PersonType.Parent Then
Dim aParent As Parent = dbdata.getParentByID(ListView.SelectedItems(0).Tag)
Dim aFormParent As FormParentID = New FormParentID(IDFormMode.EDITOR, aParent)
Dim conclusion As DialogResult = aFormParent.ShowDialog
If conclusion = Windows.Forms.DialogResult.OK Then
reloadList()
End If
aFormParent.Dispose()
End If
End Sub
''' <summary>
''' Return the selected element to the calling window
''' </summary>
''' <remarks></remarks>
Private Sub ReturnSelected()
If PrepareSelected() Then
Console.WriteLine("FormList : Closing instance")
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Hide()
End If
End Sub
Private Function PrepareSelected() As Boolean
If ListView.SelectedItems.Count > 0 Then
Me.Tag = ListView.SelectedItems(0).Tag
Return True
End If
Return False
End Function
Private Sub reloadList()
ListView.Items.Clear()
loadList(Nothing)
End Sub
Private Sub loadList(aMeet As Meet)
' Babysitter
If aTypeofPerson = PersonType.BabySitter Then
' Getting back babysitters
Dim BSList As List(Of BabySitter) = FilterList(aMeet)
For Each aBS As BabySitter In BSList
ListView.Items.Add(aBS.firstname + " " + aBS.lastname).Tag = aBS.id
Next
' Parent
ElseIf aTypeofPerson = PersonType.Parent Then
Dim ParentList As List(Of Parent) = dbdata.getParents()
For Each aParent As Parent In ParentList
Dim itemChild As ListViewItem = ListView.Items.Add(aParent.firstname + " " + aParent.lastname)
If aFormMode = ListFormMode.SelectWithAdress Then itemChild.SubItems.Add(aParent.address)
itemChild.Tag = aParent.id
Next
End If
End Sub
Private Function FilterList(wishedMeet As Meet) As List(Of BabySitter)
If wishedMeet Is Nothing Then
Return dbdata.getBabysitters()
End If
Dim ABSList As List(Of BabySitter) = dbdata.getAvailableBabysitters()
Dim FilteredBSList As List(Of BabySitter) = New List(Of BabySitter)
For Each aBS As BabySitter In ABSList
If Not (wishedMeet.overlap(aBS.meet1) Or
wishedMeet.overlap(aBS.meet2) Or
wishedMeet.overlap(aBS.meet3)) Then
FilteredBSList.Add(aBS)
End If
Next
Return FilteredBSList
End Function
' ----- Handles and Listerners -----
Private Sub DeleteSelected()
Dim msgResult As DialogResult = MsgBox("You are about to remove " & ListView.SelectedItems(0).Text & " from the software. Would you continue ?", MsgBoxStyle.YesNo, "Confirm deletion")
If msgResult = vbYes Then
If Me.aTypeofPerson = PersonType.BabySitter Then
dbdata.deleteBabysitterByID(ListView.SelectedItems(0).Tag)
ElseIf Me.aTypeofPerson = PersonType.Parent Then
dbdata.deleteParentByID(ListView.SelectedItems(0).Tag)
End If
reloadList()
End If
End Sub
Private Sub CMSDelete_Click(sender As System.Object, e As System.EventArgs) Handles CMSDelete.Click
DeleteSelected()
End Sub
Private Sub TSButtonDelete_Click(sender As System.Object, e As System.EventArgs) Handles TSButtonDelete.Click
DeleteSelected()
End Sub
Private Sub TSButtonAdd_Click(sender As System.Object, e As System.EventArgs) Handles TSButtonAdd.Click
If (aTypeofPerson = PersonType.Parent) Then
Dim createParent As FormParentID = New FormParentID(IDFormMode.CREATOR)
Dim conclusion As DialogResult = createParent.ShowDialog
If conclusion = Windows.Forms.DialogResult.OK Then
reloadList()
End If
createParent.Dispose()
ElseIf aTypeofPerson = PersonType.BabySitter Then
Dim createBD As FormBabySitterID = New FormBabySitterID(IDFormMode.CREATOR)
Dim conclusion As DialogResult = createBD.ShowDialog
If conclusion = Windows.Forms.DialogResult.OK Then
reloadList()
End If
createBD.Dispose()
End If
End Sub
Private Sub TSButtonEdit_Click(sender As System.Object, e As System.EventArgs) Handles TSButtonEdit.Click
EditSelected()
End Sub
Private Sub CMSEdit_Click(sender As System.Object, e As System.EventArgs) Handles CMSEdit.Click
EditSelected()
End Sub
Private Sub TSButtonSelect_Click(sender As System.Object, e As System.EventArgs) Handles TSButtonSelect.Click
ReturnSelected()
End Sub
Private Sub CMSSelect_Click(sender As System.Object, e As System.EventArgs) Handles CMSSelect.Click
ReturnSelected()
End Sub
Private Sub CMSShow_Click(sender As System.Object, e As System.EventArgs) Handles CMSShow.Click
ViewSelected()
End Sub
Private Sub TSButtonShow_Click(sender As System.Object, e As System.EventArgs) Handles TSButtonShow.Click
ViewSelected()
End Sub
Private Sub ListView_DoubleClick(sender As System.Object, e As System.EventArgs) Handles ListView.DoubleClick
If ListView.SelectedIndices.Count > 0 Then
If aFormMode = ListFormMode.Viewer Then
ViewSelected()
Else
ReturnSelected()
End If
End If
End Sub
Private Sub BeforeClose()
Console.WriteLine("FormList : Closing instance")
If aFormMode = ListFormMode.Viewer Then
Me.Dispose()
Else
Me.DialogResult = Windows.Forms.DialogResult.Cancel
Me.Hide()
End If
End Sub
'Private Sub FormList_FormClosing(sender As Object, e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
' BeforeClose()
'End Sub
Private Sub TSButtonClose_Click(sender As System.Object, e As System.EventArgs) Handles TSButtonClose.Click
BeforeClose()
End Sub
Private Sub ListView_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListView.SelectedIndexChanged
If ListView.SelectedItems.Count <= 0 Then
TSButtonDelete.Enabled = False
TSButtonEdit.Enabled = False
TSButtonSelect.Enabled = False
TSButtonShow.Enabled = False
CMSDelete.Enabled = False
CMSEdit.Enabled = False
CMSSelect.Enabled = False
CMSShow.Enabled = False
CMSDelete.Text = "Delete selection"
CMSEdit.Text = "Edit selection..."
CMSShow.Text = "Show selection..."
CMSSelect.Text = "Select"
Else
TSButtonDelete.Enabled = True
TSButtonEdit.Enabled = True
TSButtonSelect.Enabled = True
TSButtonShow.Enabled = True
CMSDelete.Enabled = True
CMSEdit.Enabled = True
CMSSelect.Enabled = True
CMSShow.Enabled = True
CMSDelete.Text = "Delete " + ListView.SelectedItems(0).Text
CMSEdit.Text = "Edit " + ListView.SelectedItems(0).Text + "..."
CMSShow.Text = "Show " + ListView.SelectedItems(0).Text + "..."
CMSSelect.Text = "Select " + ListView.SelectedItems(0).Text
End If
End Sub
Private Sub ToolStripButton1_Click(sender As System.Object, e As System.EventArgs) Handles TSPin.Click
If TSPin.Checked Then
TSPin.Text = "Pin windows"
TSPin.Image = My.Resources.UnpingedWindows
TSPin.Checked = False
Else
TSPin.Text = "Unpin windows"
TSPin.Image = My.Resources.PingedWindows
TSPin.Checked = True
Me.Top = FormMain.Top
Me.Left = FormMain.Right
End If
End Sub
End Class

View File

@@ -0,0 +1,338 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormMain
Inherits System.Windows.Forms.Form
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Me.MenuStrip1 = New System.Windows.Forms.MenuStrip()
Me.FileToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.QuitToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.EditionToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.TSNewChild = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator2 = New System.Windows.Forms.ToolStripSeparator()
Me.TSShowChild = New System.Windows.Forms.ToolStripMenuItem()
Me.TSEditChild = New System.Windows.Forms.ToolStripMenuItem()
Me.TSDeleteChild = New System.Windows.Forms.ToolStripMenuItem()
Me.ShowToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.TSBSList = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator3 = New System.Windows.Forms.ToolStripSeparator()
Me.DetailToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ListToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.SmallIconsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip()
Me.NewSubButton = New System.Windows.Forms.ToolStripButton()
Me.BSListButton = New System.Windows.Forms.ToolStripButton()
Me.ToolStripSeparator1 = New System.Windows.Forms.ToolStripSeparator()
Me.EditChildButton = New System.Windows.Forms.ToolStripButton()
Me.ListViewMain = New System.Windows.Forms.ListView()
Me.ColumnHeaderChild = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ColumnHeaderPlanning = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ContextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.CMSShowChild = New System.Windows.Forms.ToolStripMenuItem()
Me.CMSEditChild = New System.Windows.Forms.ToolStripMenuItem()
Me.CMSDeleteChild = New System.Windows.Forms.ToolStripMenuItem()
Me.ToolStripSeparator4 = New System.Windows.Forms.ToolStripSeparator()
Me.DetailToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
Me.ListToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
Me.SmallIconsToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
Me.MenuStrip1.SuspendLayout()
Me.ToolStrip1.SuspendLayout()
Me.ContextMenuStrip1.SuspendLayout()
Me.SuspendLayout()
'
'MenuStrip1
'
Me.MenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.FileToolStripMenuItem, Me.EditionToolStripMenuItem, Me.ShowToolStripMenuItem})
Me.MenuStrip1.Location = New System.Drawing.Point(0, 0)
Me.MenuStrip1.Name = "MenuStrip1"
Me.MenuStrip1.Size = New System.Drawing.Size(594, 24)
Me.MenuStrip1.TabIndex = 0
Me.MenuStrip1.Text = "MenuStrip1"
'
'FileToolStripMenuItem
'
Me.FileToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.QuitToolStripMenuItem})
Me.FileToolStripMenuItem.Name = "FileToolStripMenuItem"
Me.FileToolStripMenuItem.Size = New System.Drawing.Size(80, 20)
Me.FileToolStripMenuItem.Text = "Application"
'
'QuitToolStripMenuItem
'
Me.QuitToolStripMenuItem.Name = "QuitToolStripMenuItem"
Me.QuitToolStripMenuItem.Size = New System.Drawing.Size(97, 22)
Me.QuitToolStripMenuItem.Text = "Quit"
'
'EditionToolStripMenuItem
'
Me.EditionToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSNewChild, Me.ToolStripSeparator2, Me.TSShowChild, Me.TSEditChild, Me.TSDeleteChild})
Me.EditionToolStripMenuItem.Name = "EditionToolStripMenuItem"
Me.EditionToolStripMenuItem.Size = New System.Drawing.Size(56, 20)
Me.EditionToolStripMenuItem.Text = "Edition"
'
'TSNewChild
'
Me.TSNewChild.Image = Global.ApplicationCrèche_1.My.Resources.Resources.AddSheet2
Me.TSNewChild.Name = "TSNewChild"
Me.TSNewChild.Size = New System.Drawing.Size(197, 22)
Me.TSNewChild.Text = "Subscribe a new child..."
'
'ToolStripSeparator2
'
Me.ToolStripSeparator2.Name = "ToolStripSeparator2"
Me.ToolStripSeparator2.Size = New System.Drawing.Size(194, 6)
'
'TSShowChild
'
Me.TSShowChild.Enabled = False
Me.TSShowChild.Image = Global.ApplicationCrèche_1.My.Resources.Resources.NormalSheetLight
Me.TSShowChild.Name = "TSShowChild"
Me.TSShowChild.Size = New System.Drawing.Size(197, 22)
Me.TSShowChild.Text = "Show selected child..."
'
'TSEditChild
'
Me.TSEditChild.Enabled = False
Me.TSEditChild.Image = Global.ApplicationCrèche_1.My.Resources.Resources.EditSheet2
Me.TSEditChild.Name = "TSEditChild"
Me.TSEditChild.Size = New System.Drawing.Size(197, 22)
Me.TSEditChild.Text = "Edit selected child..."
'
'TSDeleteChild
'
Me.TSDeleteChild.Enabled = False
Me.TSDeleteChild.Image = Global.ApplicationCrèche_1.My.Resources.Resources.DeleteSheet2
Me.TSDeleteChild.Name = "TSDeleteChild"
Me.TSDeleteChild.Size = New System.Drawing.Size(197, 22)
Me.TSDeleteChild.Text = "Delete selected child..."
'
'ShowToolStripMenuItem
'
Me.ShowToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TSBSList, Me.ToolStripSeparator3, Me.DetailToolStripMenuItem, Me.ListToolStripMenuItem, Me.SmallIconsToolStripMenuItem})
Me.ShowToolStripMenuItem.Name = "ShowToolStripMenuItem"
Me.ShowToolStripMenuItem.Size = New System.Drawing.Size(48, 20)
Me.ShowToolStripMenuItem.Text = "Show"
'
'TSBSList
'
Me.TSBSList.Image = Global.ApplicationCrèche_1.My.Resources.Resources.WindowList1
Me.TSBSList.Name = "TSBSList"
Me.TSBSList.Size = New System.Drawing.Size(144, 22)
Me.TSBSList.Text = "Babysitter list"
'
'ToolStripSeparator3
'
Me.ToolStripSeparator3.Name = "ToolStripSeparator3"
Me.ToolStripSeparator3.Size = New System.Drawing.Size(141, 6)
'
'DetailToolStripMenuItem
'
Me.DetailToolStripMenuItem.Name = "DetailToolStripMenuItem"
Me.DetailToolStripMenuItem.Size = New System.Drawing.Size(144, 22)
Me.DetailToolStripMenuItem.Text = "Detail"
'
'ListToolStripMenuItem
'
Me.ListToolStripMenuItem.Name = "ListToolStripMenuItem"
Me.ListToolStripMenuItem.Size = New System.Drawing.Size(144, 22)
Me.ListToolStripMenuItem.Text = "List"
'
'SmallIconsToolStripMenuItem
'
Me.SmallIconsToolStripMenuItem.Name = "SmallIconsToolStripMenuItem"
Me.SmallIconsToolStripMenuItem.Size = New System.Drawing.Size(144, 22)
Me.SmallIconsToolStripMenuItem.Text = "Small icons"
'
'ToolStrip1
'
Me.ToolStrip1.GripStyle = System.Windows.Forms.ToolStripGripStyle.Hidden
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.NewSubButton, Me.BSListButton, Me.ToolStripSeparator1, Me.EditChildButton})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 24)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(594, 25)
Me.ToolStrip1.TabIndex = 1
Me.ToolStrip1.Text = "ToolStrip1"
'
'NewSubButton
'
Me.NewSubButton.Image = Global.ApplicationCrèche_1.My.Resources.Resources.AddSheet2
Me.NewSubButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.NewSubButton.Name = "NewSubButton"
Me.NewSubButton.Size = New System.Drawing.Size(119, 22)
Me.NewSubButton.Text = "New subscription"
'
'BSListButton
'
Me.BSListButton.Image = Global.ApplicationCrèche_1.My.Resources.Resources.WindowList1
Me.BSListButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.BSListButton.Name = "BSListButton"
Me.BSListButton.Size = New System.Drawing.Size(97, 22)
Me.BSListButton.Text = "Babysitter list"
'
'ToolStripSeparator1
'
Me.ToolStripSeparator1.Name = "ToolStripSeparator1"
Me.ToolStripSeparator1.Size = New System.Drawing.Size(6, 25)
'
'EditChildButton
'
Me.EditChildButton.Enabled = False
Me.EditChildButton.Image = Global.ApplicationCrèche_1.My.Resources.Resources.EditSheet2
Me.EditChildButton.ImageTransparentColor = System.Drawing.Color.Magenta
Me.EditChildButton.Name = "EditChildButton"
Me.EditChildButton.Size = New System.Drawing.Size(122, 22)
Me.EditChildButton.Text = "Edit selected child"
'
'ListViewMain
'
Me.ListViewMain.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.ListViewMain.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.ColumnHeaderChild, Me.ColumnHeaderPlanning})
Me.ListViewMain.ContextMenuStrip = Me.ContextMenuStrip1
Me.ListViewMain.FullRowSelect = True
Me.ListViewMain.GridLines = True
Me.ListViewMain.Location = New System.Drawing.Point(12, 52)
Me.ListViewMain.MultiSelect = False
Me.ListViewMain.Name = "ListViewMain"
Me.ListViewMain.Size = New System.Drawing.Size(570, 397)
Me.ListViewMain.TabIndex = 2
Me.ListViewMain.UseCompatibleStateImageBehavior = False
Me.ListViewMain.View = System.Windows.Forms.View.Details
'
'ColumnHeaderChild
'
Me.ColumnHeaderChild.Text = "Children"
Me.ColumnHeaderChild.Width = 199
'
'ColumnHeaderPlanning
'
Me.ColumnHeaderPlanning.Text = "Planning"
Me.ColumnHeaderPlanning.Width = 364
'
'ContextMenuStrip1
'
Me.ContextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.CMSShowChild, Me.CMSEditChild, Me.CMSDeleteChild, Me.ToolStripSeparator4, Me.DetailToolStripMenuItem1, Me.ListToolStripMenuItem1, Me.SmallIconsToolStripMenuItem1})
Me.ContextMenuStrip1.Name = "ContextMenuStrip1"
Me.ContextMenuStrip1.Size = New System.Drawing.Size(168, 142)
'
'CMSShowChild
'
Me.CMSShowChild.Enabled = False
Me.CMSShowChild.Image = Global.ApplicationCrèche_1.My.Resources.Resources.NormalSheetLight
Me.CMSShowChild.Name = "CMSShowChild"
Me.CMSShowChild.Size = New System.Drawing.Size(167, 22)
Me.CMSShowChild.Text = "Show this child..."
'
'CMSEditChild
'
Me.CMSEditChild.Enabled = False
Me.CMSEditChild.Image = Global.ApplicationCrèche_1.My.Resources.Resources.EditSheet2
Me.CMSEditChild.Name = "CMSEditChild"
Me.CMSEditChild.Size = New System.Drawing.Size(167, 22)
Me.CMSEditChild.Text = "Edit this child..."
'
'CMSDeleteChild
'
Me.CMSDeleteChild.Enabled = False
Me.CMSDeleteChild.Image = Global.ApplicationCrèche_1.My.Resources.Resources.DeleteSheet2
Me.CMSDeleteChild.Name = "CMSDeleteChild"
Me.CMSDeleteChild.Size = New System.Drawing.Size(167, 22)
Me.CMSDeleteChild.Text = "Delete this child..."
'
'ToolStripSeparator4
'
Me.ToolStripSeparator4.Name = "ToolStripSeparator4"
Me.ToolStripSeparator4.Size = New System.Drawing.Size(164, 6)
'
'DetailToolStripMenuItem1
'
Me.DetailToolStripMenuItem1.Name = "DetailToolStripMenuItem1"
Me.DetailToolStripMenuItem1.Size = New System.Drawing.Size(167, 22)
Me.DetailToolStripMenuItem1.Text = "Detail"
'
'ListToolStripMenuItem1
'
Me.ListToolStripMenuItem1.Name = "ListToolStripMenuItem1"
Me.ListToolStripMenuItem1.Size = New System.Drawing.Size(167, 22)
Me.ListToolStripMenuItem1.Text = "List"
'
'SmallIconsToolStripMenuItem1
'
Me.SmallIconsToolStripMenuItem1.Name = "SmallIconsToolStripMenuItem1"
Me.SmallIconsToolStripMenuItem1.Size = New System.Drawing.Size(167, 22)
Me.SmallIconsToolStripMenuItem1.Text = "Small icons"
'
'FormMain
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(594, 461)
Me.Controls.Add(Me.ListViewMain)
Me.Controls.Add(Me.ToolStrip1)
Me.Controls.Add(Me.MenuStrip1)
Me.Font = New System.Drawing.Font("Segoe UI", 8.25!)
Me.MainMenuStrip = Me.MenuStrip1
Me.MinimumSize = New System.Drawing.Size(500, 500)
Me.Name = "FormMain"
Me.Text = "Main Window"
Me.MenuStrip1.ResumeLayout(False)
Me.MenuStrip1.PerformLayout()
Me.ToolStrip1.ResumeLayout(False)
Me.ToolStrip1.PerformLayout()
Me.ContextMenuStrip1.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents MenuStrip1 As System.Windows.Forms.MenuStrip
Friend WithEvents FileToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents EditionToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
Friend WithEvents NewSubButton As System.Windows.Forms.ToolStripButton
Friend WithEvents BSListButton As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSeparator1 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents EditChildButton As System.Windows.Forms.ToolStripButton
Friend WithEvents ListViewMain As System.Windows.Forms.ListView
Friend WithEvents ShowToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents QuitToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ColumnHeaderChild As System.Windows.Forms.ColumnHeader
Friend WithEvents ColumnHeaderPlanning As System.Windows.Forms.ColumnHeader
Friend WithEvents TSEditChild As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents TSDeleteChild As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents TSNewChild As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator2 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents TSBSList As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents TSShowChild As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ContextMenuStrip1 As System.Windows.Forms.ContextMenuStrip
Friend WithEvents CMSEditChild As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents CMSShowChild As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents CMSDeleteChild As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator3 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents DetailToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ListToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents SmallIconsToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripSeparator4 As System.Windows.Forms.ToolStripSeparator
Friend WithEvents DetailToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ListToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents SmallIconsToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
End Class

View File

@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.Text" xml:space="preserve">
<value>Main window</value>
</data>
</root>

View File

@@ -0,0 +1,136 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="TSBSList.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 22</value>
</data>
<data name="ToolStripSeparator3.Size" type="System.Drawing.Size, System.Drawing">
<value>141, 6</value>
</data>
<data name="DetailToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 22</value>
</data>
<data name="ListToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 22</value>
</data>
<data name="SmallIconsToolStripMenuItem.Size" type="System.Drawing.Size, System.Drawing">
<value>144, 22</value>
</data>
</root>

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="MenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>132, 17</value>
</metadata>
<metadata name="ContextMenuStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>239, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>39</value>
</metadata>
</root>

View File

@@ -0,0 +1,221 @@
Imports System.IO
Public Class FormMain
' ----- Attributes -----
Private BSlist As FormList
' ----- Initialising window -----
Private Sub FormMain_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
'Try
'Catch ex As Exception
'End Try
reloadChildList()
End Sub
' ----- Methodes ------
Private Sub reloadChildList()
Dim allChildren As List(Of Child) = New List(Of Child)
allChildren = dbdata.getChildren()
'Fill ListViewMain
ListViewMain.Items.Clear()
For Each aChild As Child In allChildren
Dim childName As String
childName = aChild.firstname & " " & aChild.lastname
Dim planning As String = ""
If Not aChild.meet Is Nothing Then
For Each dico As KeyValuePair(Of String, Boolean) In aChild.meet.weekdays
If dico.Value Then
planning += dico.Key & " "
End If
planning = StrConv(planning, VbStrConv.ProperCase)
Next
End If
Dim itemChild As ListViewItem = ListViewMain.Items.Add(childName)
itemChild.SubItems.Add(planning)
itemChild.Tag = aChild.id
Next
End Sub
' ----- Handlers and Listerners -----
Private Sub ShowBSList()
If BSlist Is Nothing Then
BSlist = New FormList(PersonType.BabySitter, ListFormMode.Viewer)
BSlist.Show()
BSlist.Height = Me.Height
BSlist.Top = Me.Top
BSlist.Left = Me.Right
ElseIf BSlist.Visible = False Then
BSlist.Dispose()
BSlist = Nothing
ShowBSList()
End If
End Sub
Private Sub BSListButton_Click(sender As System.Object, e As System.EventArgs) Handles BSListButton.Click
ShowBSList()
End Sub
Private Sub TSBSList_Click(sender As System.Object, e As System.EventArgs) Handles TSBSList.Click
ShowBSList()
End Sub
' add a new child
Private Sub NewChild()
' Instanciation of a new FormChildID
Dim formAddChild As FormChildID = New FormChildID(IDFormMode.CREATOR)
' Show of the form and retrivement of the way the form close.
Dim conclusion As DialogResult = formAddChild.ShowDialog()
' If the user decide to abort the creation of a child, then we do nothing.
' But if the user validate it, we manage it
If conclusion = Windows.Forms.DialogResult.OK Then
reloadChildList()
End If
' Dispose call the garbage collector in order to free the RAM.
'The form don't have any existance anymore.
formAddChild.Dispose()
End Sub
Private Sub ToolStripButton1_Click(sender As System.Object, e As System.EventArgs) Handles NewSubButton.Click
NewChild()
End Sub
' Edit a listed child
Private Sub EditChild(Optional theFormMode As IDFormMode = IDFormMode.VIEWER)
If ListViewMain.SelectedItems.Count > 0 Then
Dim theChild As Child = dbdata.getChildByID(ListViewMain.SelectedItems(0).Tag)
Dim aFormChildID As FormChildID = New FormChildID(theFormMode, theChild)
Dim conclusion As DialogResult = aFormChildID.ShowDialog()
If conclusion = Windows.Forms.DialogResult.OK Then
reloadChildList()
End If
aFormChildID.Dispose()
End If
End Sub
Private Sub TSEditChild_Click(sender As System.Object, e As System.EventArgs) Handles TSEditChild.Click
EditChild(IDFormMode.EDITOR)
End Sub
Private Sub EditChildButton_Click(sender As System.Object, e As System.EventArgs) Handles EditChildButton.Click
EditChild(IDFormMode.EDITOR)
End Sub
Private Sub ListViewMain_DoubleClick(sender As System.Object, e As System.EventArgs) Handles ListViewMain.DoubleClick
EditChild(IDFormMode.VIEWER)
End Sub
Private Sub TSShowChild_Click(sender As System.Object, e As System.EventArgs) Handles TSShowChild.Click
EditChild(IDFormMode.VIEWER)
End Sub
Private Sub CMSEditChild_Click(sender As System.Object, e As System.EventArgs) Handles CMSEditChild.Click
EditChild(IDFormMode.EDITOR)
End Sub
Private Sub CMSShowChild_Click(sender As System.Object, e As System.EventArgs) Handles CMSShowChild.Click
EditChild(IDFormMode.VIEWER)
End Sub
Public Sub DeleteChild()
Dim msgResult As DialogResult = MsgBox("You are about to remove " & ListViewMain.SelectedItems(0).Text & " from the software. Would you continue ?", MsgBoxStyle.YesNo, "Confirm deletion")
If msgResult = vbYes Then
dbdata.deleteChildByID(ListViewMain.SelectedItems(0).Tag)
reloadChildList()
End If
End Sub
Private Sub CMSDeleteChild_Click(sender As System.Object, e As System.EventArgs) Handles CMSDeleteChild.Click
DeleteChild()
End Sub
Private Sub TSDeleteChild_Click(sender As System.Object, e As System.EventArgs) Handles TSDeleteChild.Click
DeleteChild()
End Sub
Private Sub FormMain_Move(sender As Object, e As System.EventArgs) Handles Me.Move
If Not BSlist Is Nothing Then
If BSlist.TSPin.Checked Then
BSlist.Top = Me.Top
BSlist.Left = Me.Right
End If
End If
End Sub
' On selection change
Private Sub ListViewMain_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles ListViewMain.SelectedIndexChanged
If ListViewMain.SelectedItems.Count <= 0 Then
CMSDeleteChild.Enabled = False
TSDeleteChild.Enabled = False
EditChildButton.Enabled = False
CMSEditChild.Enabled = False
TSEditChild.Enabled = False
CMSShowChild.Enabled = False
TSShowChild.Enabled = False
CMSShowChild.Text = "Show this child..."
CMSEditChild.Text = "Edit this child..."
CMSDeleteChild.Text = "Delete this child "
Else
CMSDeleteChild.Enabled = True
TSDeleteChild.Enabled = True
EditChildButton.Enabled = True
CMSEditChild.Enabled = True
TSEditChild.Enabled = True
CMSShowChild.Enabled = True
TSShowChild.Enabled = True
CMSShowChild.Text = "Show " + ListViewMain.SelectedItems(0).Text + "..."
CMSEditChild.Text = "Edit " + ListViewMain.SelectedItems(0).Text + "..."
CMSDeleteChild.Text = "Delete " + ListViewMain.SelectedItems(0).Text
End If
End Sub
' ----- Closing programme -----
Private Sub QuitToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles QuitToolStripMenuItem.Click
Me.Close()
End Sub
''' <summary>
''' Switch to Detail view the list of Children
''' </summary>
''' <remarks></remarks>
Private Sub ViewDetail()
ListViewMain.View = View.Details
End Sub
Private Sub DetailToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles DetailToolStripMenuItem.Click
ViewDetail()
End Sub
Private Sub DetailToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles DetailToolStripMenuItem1.Click
ViewDetail()
End Sub
''' <summary>
''' Switch to List view the list of Children
''' </summary>
''' <remarks></remarks>
Private Sub ViewList()
ListViewMain.View = View.List
End Sub
Private Sub ListToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ListToolStripMenuItem.Click
ViewList()
End Sub
Private Sub ListToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles ListToolStripMenuItem1.Click
ViewList()
End Sub
''' <summary>
''' Switch to Small view the list of Children
''' </summary>
''' <remarks></remarks>
Private Sub ViewSmall()
ListViewMain.View = View.SmallIcon
End Sub
Private Sub SmallIconsToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles SmallIconsToolStripMenuItem.Click
ViewSmall()
End Sub
Private Sub SmallIconsToolStripMenuItem1_Click(sender As System.Object, e As System.EventArgs) Handles SmallIconsToolStripMenuItem1.Click
ViewSmall()
End Sub
End Class

View File

@@ -0,0 +1,164 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class FormParentID
Inherits ApplicationCrèche_1.FormID
'Form remplace la méthode Dispose pour nettoyer la liste des composants.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Requise par le Concepteur Windows Form
Private components As System.ComponentModel.IContainer
'REMARQUE : la procédure suivante est requise par le Concepteur Windows Form
'Elle peut être modifiée à l'aide du Concepteur Windows Form.
'Ne la modifiez pas à l'aide de l'éditeur de code.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(FormParentID))
Me.Label5 = New System.Windows.Forms.Label()
Me.Label4 = New System.Windows.Forms.Label()
Me.TBPhone = New System.Windows.Forms.TextBox()
Me.LabelPhone = New System.Windows.Forms.Label()
Me.LabelAddress = New System.Windows.Forms.Label()
Me.ListView = New System.Windows.Forms.ListView()
Me.CHChildName = CType(New System.Windows.Forms.ColumnHeader(), System.Windows.Forms.ColumnHeader)
Me.ButtonPick = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'ButtonEdit
'
Me.ButtonEdit.Image = Global.ApplicationCrèche_1.My.Resources.Resources.EditSheet2
Me.ButtonEdit.TabIndex = 8
Me.ButtonEdit.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
'
'ButtonClose
'
Me.ButtonClose.TabIndex = 9
'
'TBAddress
'
Me.TBAddress.TabIndex = 5
'
'Label5
'
Me.Label5.AutoSize = True
Me.Label5.Font = New System.Drawing.Font("Segoe UI", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.Location = New System.Drawing.Point(276, 9)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(102, 30)
Me.Label5.TabIndex = 21
Me.Label5.Text = "Child(ren)"
'
'Label4
'
Me.Label4.AutoSize = True
Me.Label4.Font = New System.Drawing.Font("Segoe UI", 15.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.Location = New System.Drawing.Point(12, 9)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(83, 30)
Me.Label4.TabIndex = 20
Me.Label4.Text = "Identity"
'
'TBPhone
'
Me.TBPhone.Location = New System.Drawing.Point(80, 136)
Me.TBPhone.Name = "TBPhone"
Me.TBPhone.Size = New System.Drawing.Size(165, 22)
Me.TBPhone.TabIndex = 4
'
'LabelPhone
'
Me.LabelPhone.AutoSize = True
Me.LabelPhone.Location = New System.Drawing.Point(12, 139)
Me.LabelPhone.Name = "LabelPhone"
Me.LabelPhone.Size = New System.Drawing.Size(43, 13)
Me.LabelPhone.TabIndex = 23
Me.LabelPhone.Text = "Phone:"
'
'LabelAddress
'
Me.LabelAddress.AutoSize = True
Me.LabelAddress.Location = New System.Drawing.Point(12, 166)
Me.LabelAddress.Name = "LabelAddress"
Me.LabelAddress.Size = New System.Drawing.Size(76, 13)
Me.LabelAddress.TabIndex = 24
Me.LabelAddress.Text = "Living adress:"
'
'ListView
'
Me.ListView.Columns.AddRange(New System.Windows.Forms.ColumnHeader() {Me.CHChildName})
Me.ListView.FullRowSelect = True
Me.ListView.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None
Me.ListView.Location = New System.Drawing.Point(281, 42)
Me.ListView.MultiSelect = False
Me.ListView.Name = "ListView"
Me.ListView.Size = New System.Drawing.Size(251, 298)
Me.ListView.TabIndex = 7
Me.ListView.UseCompatibleStateImageBehavior = False
Me.ListView.View = System.Windows.Forms.View.Details
'
'CHChildName
'
Me.CHChildName.Text = "Name"
Me.CHChildName.Width = 246
'
'ButtonPick
'
Me.ButtonPick.Image = Global.ApplicationCrèche_1.My.Resources.Resources.OpenFolder
Me.ButtonPick.Location = New System.Drawing.Point(157, 275)
Me.ButtonPick.Name = "ButtonPick"
Me.ButtonPick.Size = New System.Drawing.Size(113, 23)
Me.ButtonPick.TabIndex = 6
Me.ButtonPick.Text = "Pick adress..."
Me.ButtonPick.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText
Me.ButtonPick.UseVisualStyleBackColor = True
'
'FormParentID
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.ClientSize = New System.Drawing.Size(544, 381)
Me.Controls.Add(Me.ButtonPick)
Me.Controls.Add(Me.ListView)
Me.Controls.Add(Me.LabelAddress)
Me.Controls.Add(Me.LabelPhone)
Me.Controls.Add(Me.TBPhone)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.Label4)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MinimumSize = New System.Drawing.Size(550, 410)
Me.Name = "FormParentID"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Parent ID"
Me.Controls.SetChildIndex(Me.ButtonEdit, 0)
Me.Controls.SetChildIndex(Me.ButtonClose, 0)
Me.Controls.SetChildIndex(Me.TBFirstName, 0)
Me.Controls.SetChildIndex(Me.TBLastName, 0)
Me.Controls.SetChildIndex(Me.TBAddress, 0)
Me.Controls.SetChildIndex(Me.RBMale, 0)
Me.Controls.SetChildIndex(Me.RBFemale, 0)
Me.Controls.SetChildIndex(Me.Label4, 0)
Me.Controls.SetChildIndex(Me.Label5, 0)
Me.Controls.SetChildIndex(Me.TBPhone, 0)
Me.Controls.SetChildIndex(Me.LabelPhone, 0)
Me.Controls.SetChildIndex(Me.LabelAddress, 0)
Me.Controls.SetChildIndex(Me.ListView, 0)
Me.Controls.SetChildIndex(Me.ButtonPick, 0)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label5 As System.Windows.Forms.Label
Friend WithEvents Label4 As System.Windows.Forms.Label
Friend WithEvents TBPhone As System.Windows.Forms.TextBox
Friend WithEvents LabelPhone As System.Windows.Forms.Label
Friend WithEvents LabelAddress As System.Windows.Forms.Label
Friend WithEvents ListView As System.Windows.Forms.ListView
Friend WithEvents ButtonPick As System.Windows.Forms.Button
Friend WithEvents CHChildName As System.Windows.Forms.ColumnHeader
End Class

View File

@@ -0,0 +1,132 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIAB+AQAAFgAAAIlQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAAlw
SFlzAAALEwAACxMBAJqcGAAAATBJREFUOI2dkz1Ow0AQRp+Do5QcgxZxAFquQMMB0nIBGpo0tJEQB0Di
EIgL0CPR0SChQBA4/tnMNxS7mCDHJMLSalce7/Ob2dkMGAA7QJZG3+NpGODu7gA5MARGaR78ARAQgDrN
LWD0cH/17jJwEcEeVdIaNxRKqsWcg6PJboKpNXAZe/uHPxvW2Msabm8uSabVdyQHBrjAnfFw0ut//nTC
4qMipdnWKo+m8c/TcLrWINQNs+cZZtaJ5QBZ2jQeXvQanD0ek3kXnscUY2CTAb2ArQ2673+lsNEgnlx/
CpsM+lPYsgbZmlgEyADHXSyb0PmoqQOSpePuAmTLBbKGt5dXQt0FSEZZlMgcYiF8FRCaYs7d9ZTis0RL
tS0d281xOZKQCVYuEsSWHPGP2+juAvgCwODN5kOjKQoAAAAASUVORK5CYII=
</value>
</data>
</root>

View File

@@ -0,0 +1,240 @@
Imports ApplicationCrèche_1.IDFormMode
Public Class FormParentID
Inherits FormID
' ----- Private Attributes -----
Private actualFormMode As IDFormMode
' ----- Initialisators -----
Private Sub FormParentID_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
End Sub
Public Sub New(theFormMode As IDFormMode, Optional aParent As Parent = Nothing)
Console.WriteLine("FormParentID : Begining of a new instance")
' Cet appel est requis par le concepteur.
InitializeComponent()
' Ajoutez une initialisation quelconque après l'appel InitializeComponent().
If theFormMode = CREATOR Or aParent Is Nothing Then
ChangeMode(CREATOR)
Else
ChangeMode(theFormMode, aParent)
End If
End Sub
' ----- Methodes -----
Private Function getParentFromIntern() As Parent
Dim newParent = New Parent(Me.Tag)
newParent.firstname = TBFirstName.Text
newParent.lastname = TBLastName.Text
newParent.address = TBAddress.Text
If (RBMale.Checked) Then
newParent.gender = True
Else
newParent.gender = False
End If
newParent.phone = TBPhone.Text
Return newParent
End Function
Private Function updateParentFromExtern(aParent As Parent) As Boolean
If Not aParent Is Nothing Then
' Fill up controls with all the data we have.
Me.Tag = aParent.id
TBFirstName.Text = aParent.firstname 'Firstname
TBLastName.Text = aParent.lastname 'Lastname
If aParent.gender Then 'Gender
RBMale.Checked = True
Else
RBFemale.Checked = True
End If
TBPhone.Text = aParent.phone
TBAddress.Text = aParent.address
FillListView(aParent.id)
If ListView.Items.Count > 1 Then Label5.Text = "Children" Else Label5.Text = "Child"
If (actualFormMode = VIEWER) Then
Text = aParent.firstname + " " + aParent.lastname
Else
Text = aParent.firstname + " " + aParent.lastname + " (Edit)"
End If
Return True
End If
Return False
End Function
Private Sub ChangeMode(aFormMode As IDFormMode, Optional aParent As Parent = Nothing)
If aFormMode = IDFormMode.CREATOR Then ' CREATOR MODE
actualFormMode = CREATOR
Console.WriteLine("FormParentID : Switch to CREATOR Mode")
'Change of the main triggers labels + title
Text = "New parent"
ButtonClose.Text = "Cancel"
ButtonEdit.Text = "Save"
RBMale.Checked = True
ListView.Enabled = False
Label5.Text = ""
Me.Tag = 0
ElseIf aFormMode = IDFormMode.VIEWER And Not aParent Is Nothing Then ' VIEW MODE
actualFormMode = VIEWER
Console.WriteLine("FormParentID : Switch to VIEWER Mode")
'We change the main triggers labels
ButtonClose.Text = "Close"
ButtonEdit.Text = "Edit"
Text = TBFirstName.Text + " " + TBLastName.Text + " (Edit)"
'Activate most important security aspect (not show a window that can mat a save somewhere else)
TBAddress.Enabled = False
TBFirstName.Enabled = False
TBLastName.Enabled = False
RBFemale.Enabled = False
RBMale.Enabled = False
TBPhone.Enabled = False
ButtonPick.Enabled = False
ListView.Enabled = False
updateParentFromExtern(aParent)
ElseIf aFormMode = IDFormMode.EDITOR Then ' EDITOR MODE
Console.WriteLine("FormParentID : Switch to Editor Mode")
actualFormMode = EDITOR
''We change the main triggers labels
ButtonClose.Text = "Cancel"
ButtonEdit.Text = "Update"
'Turn off anti edit security
TBAddress.Enabled = True
TBFirstName.Enabled = True
TBLastName.Enabled = True
RBFemale.Enabled = True
RBMale.Enabled = True
TBPhone.Enabled = True
ButtonPick.Enabled = True
ListView.Enabled = True
updateParentFromExtern(aParent)
Else
Console.WriteLine("FormParentID : Return to Standart Mode !!")
End If
End Sub
''' <summary>
''' Get the list of children of the actual Parent.
''' </summary>
''' <param name="id">The id of the Parent</param>
''' <remarks></remarks>
Private Sub FillListView(id As Integer)
Dim theChildren As List(Of Child) = dbdata.getChildenOf(id)
For Each aChild As Child In theChildren
ListView.Items.Add(aChild.firstname + " " + aChild.lastname).Tag = aChild.id
Next
' Child or Children ?
If ListView.Items.Count <= 1 Then
Label5.Text = "Child"
Else
Label5.Text = "Children"
End If
End Sub
'Edit and click
Protected Overrides Sub ButtonEdit_Click(sender As System.Object, e As System.EventArgs)
Dim Validated As Boolean = True
If actualFormMode = VIEWER Then 'EDIT'
ChangeMode(EDITOR)
ElseIf actualFormMode = CREATOR Then 'SAVE'
' Error Provider
If String.IsNullOrEmpty(TBFirstName.Text) Then
ErrorProvider1.SetError(TBFirstName, "The first name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBLastName.Text) Then
ErrorProvider1.SetError(TBLastName, "The last name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBPhone.Text) Then
ErrorProvider1.SetError(TBPhone, "The phone number field could not be empty" & vbNewLine & "Please insert a correct phone number")
Validated = False
End If
'If TBPhone. = 0 Then
' ErrorProvider1.SetError(DTPBord, "The date of born could not be today" & vbNewLine & "Please insert a born date in the past")
' Validated = False
'End If
If String.IsNullOrEmpty(TBAddress.Text) Then
ErrorProvider1.SetError(LabelAddress, "The address field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If Not Validated Then
Exit Sub
End If
' Validation
Me.DialogResult = Windows.Forms.DialogResult.OK
Me.Tag = dbdata.addParent(Me.getParentFromIntern())
Hide()
ElseIf actualFormMode = EDITOR Then 'UPDATE'
' Error Provider
If String.IsNullOrEmpty(TBFirstName.Text) Then
ErrorProvider1.SetError(TBFirstName, "The first name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBLastName.Text) Then
ErrorProvider1.SetError(TBLastName, "The last name field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If String.IsNullOrEmpty(TBPhone.Text) Then
ErrorProvider1.SetError(TBPhone, "The phone number field could not be empty" & vbNewLine & "Please insert a correct phone number")
Validated = False
End If
'If TBPhone. = 0 Then
' ErrorProvider1.SetError(DTPBord, "The date of born could not be today" & vbNewLine & "Please insert a born date in the past")
' Validated = False
'End If
If String.IsNullOrEmpty(TBAddress.Text) Then
ErrorProvider1.SetError(LabelAddress, "The address field could not be empty." & vbNewLine & "Please fill this field.")
Validated = False
End If
If Not Validated Then
Exit Sub
End If
' Validation
Me.DialogResult = Windows.Forms.DialogResult.OK
dbdata.editParent(Me.getParentFromIntern())
Hide()
Else
'Don't know how to go here...
Console.WriteLine("FormParentID : Is in standart mode !")
Hide()
End If
End Sub
Protected Overrides Sub ButtonClose_Click(sender As System.Object, e As System.EventArgs)
Console.WriteLine("FormParentID : Closing instance")
Me.DialogResult = Windows.Forms.DialogResult.Cancel
Hide()
End Sub
Private Sub ButtonPick_Click(sender As System.Object, e As System.EventArgs) Handles ButtonPick.Click
Dim FormListParent As FormList = New FormList(PersonType.Parent, ListFormMode.SelectWithAdress)
Dim RD As DialogResult = FormListParent.ShowDialog
If RD = Windows.Forms.DialogResult.OK Then
Dim aParent As Parent = dbdata.getParentByID(FormListParent.Tag)
TBAddress.Text = aParent.address
End If
End Sub
End Class

View File

@@ -0,0 +1,20 @@
Public Enum IDFormMode
CREATOR
EDITOR
VIEWER
'STANDART
End Enum
Public Enum ListFormMode
Viewer
SelectWithAdress
SelectFiltered
Selector
End Enum
Public Enum PersonType
BabySitter
Child
Parent
Person
End Enum

View File

@@ -0,0 +1,27 @@
Module SharedRessources
Public dbConnexionString As String
Public dbdata As SQLManager = New SQLManager()
''' <summary>
'''
''' </summary>
''' <param name="id"></param>
''' <returns></returns>
''' <remarks></remarks>
Public Function getFirstFreeMeetOf(id As Integer) As Integer
Dim abs As BabySitter = dbdata.getBabysitterByID(id)
If abs.meet1 Is Nothing Then
Return 1
ElseIf abs.meet2 Is Nothing Then
Return 2
ElseIf abs.meet3 Is Nothing Then
Return 3
Else
Return 4
End If
End Function
End Module