first visual basic code upload

This commit is contained in:
ghassan committed 2020-02-16 03:39:56 +03:00
1 parent 93697318e4
commit 5e53ab7d73
101 files changed
+21213

No files matched your search

@@ -0,0 +1,53 @@
' Age Class To Generate Age From Date Of Birth
Public Class age
Private _days As Integer
Private _monthes As Integer
Private _years As Integer
Private _birthdate As Date
Public Sub New(Birthdate As Date)
_birthdate = Birthdate
Calculate(Birthdate)
End Sub
ReadOnly Property Birthdate As Date
Get
Return _birthdate
End Get
End Property
ReadOnly Property Years As Integer
Get
Return _years
End Get
End Property
ReadOnly Property Monthes As Integer
Get
Return _monthes
End Get
End Property
ReadOnly Property Days As Integer
Get
Return _days
End Get
End Property
ReadOnly Property Printable As String
Get
Return "You Are " & _years & " Years " & _monthes & " Monthes " & _days & " Old"
End Get
End Property
Private Sub Calculate(Birthdate As Date)
' Breaking Down The Date Difference Into Year, Monthes and Days
_years = DateDiff(DateInterval.Year, Birthdate, Now)
_monthes = DateDiff(DateInterval.Month, Birthdate, Now) Mod 12
_days = DateDiff(DateInterval.Day, Birthdate, Now) Mod 30 - 10
End Sub
End Class
@@ -0,0 +1,139 @@
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class club
Private _id As Integer
Private _title As String
Private _owner As person
Private _country As country
Private _address As String
Private _location As String
Private _logo As MemoryStream
Public Sub New(ID As Integer)
GetClubData(ID)
End Sub
ReadOnly Property ID As Integer
Get
Return _id
End Get
End Property
ReadOnly Property Title As String
Get
Return _title
End Get
End Property
ReadOnly Property Country As country
Get
Return _country
End Get
End Property
ReadOnly Property Location As String
Get
Return _location
End Get
End Property
ReadOnly Property Logo As MemoryStream
Get
Return _logo
End Get
End Property
Public Sub GetClubData(ID As Integer)
Dim QRY As String = "select * from clubs where id = " & ID & " limit 1"
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim RDR As MySqlDataReader
Try
CON.Open()
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
Try
_id = Int(RDR("id"))
Catch ex As Exception
_id = 0
End Try
Try
_title = RDR("title")
Catch ex As Exception
_title = Nothing
End Try
Try
_country = New country(Int(RDR("country")))
Catch ex As Exception
_country = Nothing
End Try
Try
_location = RDR("location")
Catch ex As Exception
_location = Nothing
End Try
Try ' Club Logo -----------------------------------------
Dim data As Byte() = DirectCast(RDR("logo"), Byte())
_logo = New System.IO.MemoryStream(data)
Catch ex As Exception
_logo = Nothing
End Try
End While
End If
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
CON.Dispose()
End Try
End Sub
Public Sub Create(Title As String, Country As country, Location As String, Logo As MemoryStream)
End Sub
Public Sub UpdateLogo(LogoPictureBox As PictureBox)
' To Avoid Wrong Execution Of Code
If _id = 0 Then Exit Sub
' Query To Update
Dim QRY As String = "update clubs set logo = @logo where id=" & _id
' Connection
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
' Preparing The Image
Dim Picture As New MemoryStream
LogoPictureBox.Image.Save(Picture, System.Drawing.Imaging.ImageFormat.Png)
Dim arrImage() As Byte = Picture.GetBuffer
Picture.Close()
Try
CON.Open()
COM.Parameters.AddWithValue("@logo", arrImage)
COM.ExecuteNonQuery()
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
CON.Dispose()
End Try
End Sub
End Class
@@ -0,0 +1,228 @@
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class country
Private _id As Integer
Private _name As String
Private _flag As MemoryStream
Private _flat_flag As String
Private _shiny_flag As String
Private _iso As String
Private _iso3 As String
Private _num_code As Integer
Private _call_code As Integer
Private _currency As String
Public Sub New()
End Sub
Public Sub New(id As Integer)
GetCountryData(id)
End Sub
ReadOnly Property ID As Integer
Get
Return _id
End Get
End Property
ReadOnly Property Name As String
Get
Return _name
End Get
End Property
ReadOnly Property Flag As MemoryStream
Get
Return _flag
End Get
End Property
ReadOnly Property FlatFlag As String
Get
Return _flat_flag
End Get
End Property
ReadOnly Property ShinyFlag As String
Get
Return _shiny_flag
End Get
End Property
ReadOnly Property ISO As String
Get
Return _iso
End Get
End Property
ReadOnly Property ISO3 As String
Get
Return _iso3
End Get
End Property
ReadOnly Property NumCode As Integer
Get
Return _num_code
End Get
End Property
ReadOnly Property CallCode As Integer
Get
Return _call_code
End Get
End Property
ReadOnly Property Currency As String
Get
Return _currency
End Get
End Property
Private Sub GetCountryData(ID As Integer)
Dim QRY As String = ("select * from countries where id = " & ID & " limit 1")
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim RDR As MySqlDataReader
Try
CON.Open()
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
Try ' ID
_id = RDR("id")
Catch ex As Exception
_id = 0
End Try
Try ' First Name
_name = RDR("name")
Catch ex As Exception
_name = Nothing
End Try
Try ' Middle Name
_flat_flag = RDR("flatFlag")
Catch ex As Exception
_flat_flag = Nothing
End Try
Try ' Last Name
_shiny_flag = RDR("shinyFlag")
Catch ex As Exception
_shiny_flag = Nothing
End Try
Try ' Gender
_iso = RDR("iso")
Catch ex As Exception
_iso = Nothing
End Try
Try ' Birthday
_iso3 = RDR("iso3")
Catch ex As Exception
_iso3 = Nothing
End Try
Try ' Age
_num_code = RDR("numcode")
Catch ex As Exception
_num_code = 0
End Try
Try ' Weight
_call_code = RDR("callcode")
Catch ex As Exception
_call_code = 0
End Try
Try ' Category
_currency = RDR("currency")
Catch ex As Exception
_currency = Nothing
End Try
Try ' Country Flag --------------------------------------
Dim data As Byte() = DirectCast(RDR("flag"), Byte())
_flag = New System.IO.MemoryStream(data)
Catch ex As Exception
_flag = Nothing
End Try
End While
End If
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
End Try
End Sub
Public Sub UpdateFlag(FlagPictureBox As PictureBox)
' To Avoid Wrong Execution Of Code
If _id = 0 Then Exit Sub
' Query To Update
Dim QRY As String = "update countries set flag = @flag where id=" & _id
' Connection
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
' Preparing The Image
Dim Picture As New MemoryStream
FlagPictureBox.Image.Save(Picture, System.Drawing.Imaging.ImageFormat.Png)
Dim arrImage() As Byte = Picture.GetBuffer
Picture.Close()
Try
CON.Open()
COM.Parameters.AddWithValue("@flag", arrImage)
COM.ExecuteNonQuery()
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
CON.Dispose()
End Try
End Sub
Public Function GetCountryList() As List(Of country)
Dim QRY As String = "select * from countries order by name asc"
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim RDR As MySqlDataReader
Dim LST As New List(Of country)
Try
CON.Open()
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
LST.Add(New country(RDR("id")))
End While
End If
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
CON.Dispose()
End Try
Return LST
End Function
End Class
@@ -0,0 +1,41 @@
Imports Newtonsoft.Json
Public Class location
Private _latitude As Double
Private _longitude As Double
Private _altitude As Double
Private product As Object
Public Sub New(latitude, longitude)
_latitude = latitude
_longitude = longitude
End Sub
Public Sub New(latitude, longitude, altitude)
_latitude = latitude
_longitude = longitude
_altitude = altitude
End Sub
ReadOnly Property Latitude As Double
Get
Return _latitude
End Get
End Property
ReadOnly Property Longitude As Double
Get
Return _longitude
End Get
End Property
ReadOnly Property Altitude As Double
Get
Return _altitude
End Get
End Property
End Class
@@ -0,0 +1,371 @@
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class person
' Person Data Variables
Private _id As Integer ' Member ID
Private _first_name As String ' First Name
Private _middle_name As String ' Middle Name
Private _last_name As String ' Last Name
Private _gender As String ' Gender
Private _birthday As Date ' Date Of Birth
Private _age As age ' Calculated From Birthday
Private _weight As weight ' Weight
Private _picture As MemoryStream ' Picture
' Person Country
Private _nationality As country ' Country Object
' Person Team / Club
Private _team As club ' Club Object
'--------------------------------------------------------------------------------------
' CONSTRUCTORS
'--------------------------------------------------------------------------------------
Public Sub New(Fname As String, Sname As String, Lname As String, DateOfBirth As String, Gender As String, Weight As String, CPR As String, Country As Integer, Mobile As String, Email As String, Address As String, Club As Integer, PictureBox As PictureBox)
' Create A New Person
CREATE(Fname, Sname, Lname, DateOfBirth, Gender, Weight, CPR, Country, Mobile, Email, Address, Club, PictureBox)
' Get Person Data From Returned ID
GetPersonData(_id)
End Sub
Public Sub New(ID As Integer)
If ID = 0 Then
ZeroID()
Else
GetPersonData(ID)
End If
End Sub
'--------------------------------------------------------------------------------------
' PROPERTIES
'--------------------------------------------------------------------------------------
Public Property ID As Integer
Get
Return _id
End Get
Set(value As Integer)
_id = value
GetPersonData(_id)
End Set
End Property
ReadOnly Property FirstName As String
Get
Return _first_name
End Get
End Property
ReadOnly Property LastName As String
Get
Return _last_name
End Get
End Property
ReadOnly Property MiddleName As String
Get
Return _first_name + " " + _last_name
End Get
End Property
ReadOnly Property ShortName As String
Get
Return _first_name + " " + _last_name
End Get
End Property
ReadOnly Property FullName As String
Get
Return _first_name + " " + _middle_name + " " + _last_name
End Get
End Property
ReadOnly Property Age As age
Get
Return _age
End Get
End Property
ReadOnly Property Birthday As Date
Get
Return _birthday
End Get
End Property
ReadOnly Property Weight As weight
Get
Return _weight
End Get
End Property
ReadOnly Property Gender As String
Get
Return _gender
End Get
End Property
ReadOnly Property Team As club
Get
Return _team
End Get
End Property
ReadOnly Property Nationality As country
Get
Return _nationality
End Get
End Property
ReadOnly Property Picture As MemoryStream
Get
Return _picture
End Get
End Property
'--------------------------------------------------------------------------------------
' Create Section
'--------------------------------------------------------------------------------------
Public Sub CREATE(Fname As String, Sname As String, Lname As String, DateOfBirth As String, Gender As String, Weight As String, CPR As String, Country As Integer, Mobile As String, Email As String, Address As String, Club As Integer, PictureBox As PictureBox)
Dim QRY As String = ("
insert into
person (fname, mname, lname, country, gender, date_of_birth, weight, cpr, mobile, email, address, club, picture)
values ('" & Fname & "', '" & Sname & "', '" & Lname & "', " & Country & ", '" & Gender & "', '" & DateOfBirth & "', '" & Weight & "', '" & CPR & "', '" & Mobile & "', '" & Email & "', '" & Address & "', " & Club & ", @picture);
select last_insert_id() as 'id';
")
' Generate Weight Object
_weight = New weight(ReadMySQLDate(DateOfBirth), Gender, CDbl(Val(Weight)))
' Connection
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim Picture As New MemoryStream
PictureBox.Image.Save(Picture, System.Drawing.Imaging.ImageFormat.Png)
Dim arrImage() As Byte = Picture.GetBuffer
Picture.Close()
Dim RDR As MySqlDataReader
Try
CON.Open()
COM.Parameters.AddWithValue("@picture", arrImage)
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
Try ' ID
_id = RDR("id")
Catch ex As Exception
_id = 0
End Try
End While
End If
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
End Try
' Updating Weight
UpdateWeight(CDbl(Val(Weight)))
End Sub
'--------------------------------------------------------------------------------------
' Update Section
'--------------------------------------------------------------------------------------
Public Sub UpdatePicture(PictureBox As PictureBox)
' Query To Update
Dim QRY As String = "update person set picture = @picture where id=" & _id
' Connection
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
' Preparing The Image
Dim Picture As New MemoryStream
PictureBox.Image.Save(Picture, System.Drawing.Imaging.ImageFormat.Png)
Dim arrImage() As Byte = Picture.GetBuffer
Picture.Close()
Try
CON.Open()
COM.Parameters.AddWithValue("@picture", arrImage)
COM.ExecuteNonQuery()
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
CON.Dispose()
End Try
End Sub
'--------------------------------------------------------------------------------------
' SUBROUTINES
'--------------------------------------------------------------------------------------
Private Sub GetPersonData(FighterID As Integer)
Dim QRY As String =
("
select
person.id as 'pid',
person.fname,
person.mname,
person.lname,
TIMESTAMPDIFF(YEAR, person.date_of_birth, CURDATE()) as 'age',
person.date_of_birth,
person.weight,
person.gender,
person.country as 'country',
clubs.id as 'club',
person.picture as 'picture'
FROM
person
left join
clubs on person.club = clubs.id
left join
countries on clubs.country = countries.id
where
person.id=" + FighterID.ToString
)
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim RDR As MySqlDataReader
Try
CON.Open()
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
Try ' ID
_id = RDR("pid")
Catch ex As Exception
_id = 0
End Try
Try ' First Name
_first_name = RDR("fname")
Catch ex As Exception
_first_name = Nothing
End Try
Try ' Middle Name
_middle_name = RDR("mname")
Catch ex As Exception
_middle_name = Nothing
End Try
Try ' Last Name
_last_name = RDR("lname")
Catch ex As Exception
_last_name = Nothing
End Try
Try ' Gender
_gender = RDR("gender")
Catch ex As Exception
_gender = Nothing
End Try
Try ' Birthday
_birthday = CDate(RDR("date_of_birth"))
Catch ex As Exception
_birthday = Nothing
End Try
Try ' Age
_age = New age(_birthday)
Catch ex As Exception
_age = Nothing
End Try
Try ' Weight
_weight = New weight(_birthday, _gender, RDR("weight"))
Catch ex As Exception
_weight = Nothing
End Try
Try ' Team Name
_team = New club(RDR("club"))
Catch ex As Exception
_team = Nothing
End Try
Try ' Country
_nationality = New country(RDR("country"))
Catch ex As Exception
_nationality = Nothing
End Try
Try ' Fighter Picture -------------------------------------------
Dim data As Byte() = DirectCast(RDR("picture"), Byte())
_picture = New System.IO.MemoryStream(data)
Catch ex As Exception
_picture = Nothing
End Try
End While
End If
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
End Try
End Sub
'--------------------------------------------------------------------------------------
' FUNCTIONS
'--------------------------------------------------------------------------------------
Public Sub UpdateWeight(Weight As Double)
' This Updates The Weight Of The Person
_weight.UpdateWeight(Me._id, Weight)
End Sub
'--------------------------------------------------------------------------------------
' Zero ID Person
'--------------------------------------------------------------------------------------
Private Sub ZeroID()
_id = 0
_first_name = "B"
_middle_name = "Y"
_last_name = "E"
_gender = "EXGEN"
_birthday = ""
_age = Nothing
_weight = Nothing
_picture = Nothing
_team = Nothing
_nationality = Nothing
End Sub
End Class
@@ -0,0 +1,209 @@
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class referee
' Referee Data Variables
Private _id As Integer ' Member ID
Private _first_name As String ' First Name
Private _middle_name As String ' Middle Name
Private _last_name As String ' Last Name
Private _gender As String ' Gender
Private _birthday As Date ' Date Of Birth
Private _age As Integer ' Calculated From Birthday
Private _picture As MemoryStream ' Picture
' Referee Team / Club
Private _team As club ' Team Within Country
' Referee Country
Private _nationality As country ' Country Name
'--------------------------------------------------------------------------------------
' CONSTRUCTORS
'--------------------------------------------------------------------------------------
' With Initial Parameter
Public Sub New(ID As Integer)
GetRefereeData(ID)
End Sub
'--------------------------------------------------------------------------------------
' PROPERTIES
'--------------------------------------------------------------------------------------
Public Property ID As Integer
Get
Return _id
End Get
Set(value As Integer)
_id = value
GetRefereeData(_id)
End Set
End Property
ReadOnly Property FirstNAME As String
Get
Return _first_name
End Get
End Property
ReadOnly Property LastNAME As String
Get
Return _last_name
End Get
End Property
ReadOnly Property MiddleNAME As String
Get
Return _first_name + " " + _last_name
End Get
End Property
ReadOnly Property ShortName As String
Get
Return _first_name + " " + _last_name
End Get
End Property
ReadOnly Property FullName As String
Get
Return _first_name + " " + _middle_name + " " + _last_name
End Get
End Property
ReadOnly Property Age As Integer
Get
Return _age
End Get
End Property
ReadOnly Property Birthday As Date
Get
Return _birthday
End Get
End Property
ReadOnly Property Country As country
Get
Return _nationality
End Get
End Property
ReadOnly Property Team As club
Get
Return _team
End Get
End Property
ReadOnly Property Picture As MemoryStream
Get
Return _picture
End Get
End Property
'--------------------------------------------------------------------------------------
' SUBROUTINES
'--------------------------------------------------------------------------------------
Private Sub GetRefereeData(FighterID As Integer)
Dim QRY As String =
("
select
person.id as 'pid',
person.fname,
person.mname,
person.lname,
TIMESTAMPDIFF(YEAR, person.date_of_birth, CURDATE()) as 'age',
person.date_of_birth,
person.gender,
person.club as 'club',
person.country as 'country',
person.picture
FROM
person
where
person.id=" + FighterID.ToString
)
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim RDR As MySqlDataReader
Try
CON.Open()
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
Try
_id = RDR("pid")
Catch ex As Exception
_id = 0
End Try
Try
_first_name = RDR("fname")
Catch ex As Exception
_first_name = Nothing
End Try
Try
_middle_name = RDR("mname")
Catch ex As Exception
_middle_name = Nothing
End Try
Try
_last_name = RDR("lname")
Catch ex As Exception
_last_name = Nothing
End Try
Try
_gender = RDR("gender")
Catch ex As Exception
_gender = Nothing
End Try
Try
_birthday = CDate(RDR("date_of_birth"))
Catch ex As Exception
_birthday = Nothing
End Try
Try
_age = RDR("age")
Catch ex As Exception
_age = 0
End Try
Try
_team = New club(Int(RDR("club")))
Catch ex As Exception
_team = Nothing
End Try
Try
_nationality = New country(Int(RDR("country")))
Catch ex As Exception
_nationality = Nothing
End Try
Try ' Fighter Personal Picture ----------------------------------
Dim arrImage() As Byte = DirectCast(RDR("picture"), Byte())
_picture = New MemoryStream(arrImage)
Catch ex As Exception
_picture = Nothing
End Try '--------------------------------------------------------
End While
End If
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
End Try
End Sub
End Class
@@ -0,0 +1,205 @@
Imports System.IO
Imports MySql.Data.MySqlClient
' Weight Class To Generate Weight (Category, Class) From Gender, Weight, Date Of Birth.
Public Class weight
Private _id As Integer ' Weight Profile ID
Private _age As age ' Age Object (years, monthes, days)
Private _gender As String ' Weight Filter Gender
Private _weight As Double ' Weight In KG
Private _weight_class As String ' Weight Class Name
Private _weight_category As String ' Weight Category Name
Public Sub New(Birthdate As Date, Gender As String, Weight As Double)
_age = New age(Birthdate)
_gender = Gender
_weight = Weight
' Weight Filter That Gets
WeightFilter(_age.Years, Weight, Gender)
End Sub
ReadOnly Property WeightFilterID As Integer
Get
Return _id
End Get
End Property
ReadOnly Property Weight As String
Get
Return Math.Round(_weight, 1).ToString
End Get
End Property
ReadOnly Property WeightClass As String
Get
Return _weight_class
End Get
End Property
ReadOnly Property WeightCategory As String
Get
Return _weight_category
End Get
End Property
Private Sub WeightFilter(Age As Integer, Weight As String, Gender As String)
Dim QRY As String = ("
SELECT
id,
Category,
ClassName
FROM
weight_divisions
WHERE
('" & Age & "' BETWEEN weight_divisions.minAge AND weight_divisions.maxAge)
AND
(weight_divisions.gender = '" & Gender & "')
AND
('" & Weight & "' > weight_divisions.minWeight AND '" & Weight & "' <= weight_divisions.maxWeight)
")
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim RDR As MySqlDataReader
Try
CON.Open()
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
_id = RDR("id")
_weight_category = RDR("Category")
_weight_class = RDR("ClassName")
End While
End If
CON.Close()
Catch ex As MySqlException
_weight_category = Nothing
_weight_class = Nothing
MessageBox.Show(ex.Message)
Finally
CON.Dispose()
End Try
End Sub
Private Sub GetPersonWeight(PersonID As Integer)
Dim QRY As String =
("
select
person.weight,
person.gender,
person.date_of_birth,
FROM
person
where
person.id=" + PersonID.ToString
)
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim RDR As MySqlDataReader
Try
CON.Open()
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
Try
_age = New age(RDR("date_of_birth"))
Catch ex As Exception
End Try
Try
_weight = RDR("weight")
Catch ex As Exception
_weight = 0
End Try
Try
_gender = RDR("gender")
Catch ex As Exception
_gender = Nothing
End Try
End While
End If
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
End Try
End Sub
Public Sub UpdateWeight(PersonID As Integer, NewWeight As Double)
' If Person ID = 0 Just Dont Do any Thing
If PersonID = 0 Then Exit Sub
Dim QRY As String = ("
/* Take The New Reading */
SET @pid = " & PersonID.ToString & "; /* Person ID */
SET @weight = " & NewWeight.ToString & "; /* New Weight Reading */
SET SQL_SAFE_UPDATES = 0; /* Disable Safe Mode For Updates */
/* Update Person Weight */
UPDATE person SET weight = @weight WHERE id = @pid;
/* Update Participants Weight Classes */
UPDATE
person
LEFT JOIN
weight_divisions
ON
(YEAR(CURDATE()) - YEAR(person.date_of_birth) BETWEEN weight_divisions.minAge AND weight_divisions.maxAge) AND
(weight_divisions.gender = person.gender) AND
(person.weight > weight_divisions.minWeight AND person.weight <= weight_divisions.maxWeight)
SET
person.wp = weight_divisions.id,
person.category = weight_divisions.category,
person.weight_Class = weight_divisions.className
WHERE
person.id = @pid;
/* Take Snap Shot Copy Current Weight To Person Body As A History */
INSERT INTO person_body (pid, weight, category, weight_class) SELECT id, weight, category, weight_class FROM person WHERE id = @pid;
/* Enable Safe Mode For Updates */
SET SQL_SAFE_UPDATES = 1;
")
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Try
CON.Open()
COM.ExecuteNonQuery()
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
CON.Dispose()
End Try
End Sub
End Class
@@ -0,0 +1,104 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frm_update_logo
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.cbo_clubs = New System.Windows.Forms.ComboBox()
Me.btn_save = New System.Windows.Forms.Button()
Me.btn_open = New System.Windows.Forms.Button()
Me.pb_logo = New System.Windows.Forms.PictureBox()
CType(Me.pb_logo, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'cbo_clubs
'
Me.cbo_clubs.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
Me.cbo_clubs.DropDownHeight = 100
Me.cbo_clubs.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, CType(0, Byte))
Me.cbo_clubs.ForeColor = System.Drawing.Color.White
Me.cbo_clubs.FormattingEnabled = True
Me.cbo_clubs.IntegralHeight = False
Me.cbo_clubs.Location = New System.Drawing.Point(5, 335)
Me.cbo_clubs.Name = "cbo_clubs"
Me.cbo_clubs.Size = New System.Drawing.Size(325, 30)
Me.cbo_clubs.TabIndex = 9
'
'btn_save
'
Me.btn_save.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_save.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, CType(0, Byte))
Me.btn_save.ForeColor = System.Drawing.Color.White
Me.btn_save.Location = New System.Drawing.Point(170, 370)
Me.btn_save.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btn_save.Name = "btn_save"
Me.btn_save.Size = New System.Drawing.Size(160, 45)
Me.btn_save.TabIndex = 8
Me.btn_save.Text = "Save"
Me.btn_save.UseVisualStyleBackColor = True
'
'btn_open
'
Me.btn_open.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_open.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, CType(0, Byte))
Me.btn_open.ForeColor = System.Drawing.Color.White
Me.btn_open.Location = New System.Drawing.Point(5, 370)
Me.btn_open.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btn_open.Name = "btn_open"
Me.btn_open.Size = New System.Drawing.Size(160, 45)
Me.btn_open.TabIndex = 7
Me.btn_open.Text = "Open"
Me.btn_open.UseVisualStyleBackColor = True
'
'pb_logo
'
Me.pb_logo.Location = New System.Drawing.Point(5, 5)
Me.pb_logo.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.pb_logo.Name = "pb_logo"
Me.pb_logo.Size = New System.Drawing.Size(325, 325)
Me.pb_logo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.pb_logo.TabIndex = 6
Me.pb_logo.TabStop = False
'
'frm_update_logo
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
Me.ClientSize = New System.Drawing.Size(336, 421)
Me.Controls.Add(Me.cbo_clubs)
Me.Controls.Add(Me.btn_save)
Me.Controls.Add(Me.btn_open)
Me.Controls.Add(Me.pb_logo)
Me.ForeColor = System.Drawing.Color.White
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Name = "frm_update_logo"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Update Club Logo"
CType(Me.pb_logo, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents cbo_clubs As ComboBox
Friend WithEvents btn_save As Button
Friend WithEvents btn_open As Button
Friend WithEvents pb_logo As PictureBox
End Class
@@ -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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,54 @@
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class frm_update_logo
Private Sub btn_open_Click(sender As Object, e As EventArgs) Handles btn_open.Click
If IsNothing(pb_logo.Image) Then
' Loads And Image And Resize It In PNG Format
ResizePicture(pb_logo, 500, 500)
ElseIf Not IsNothing(pb_logo.Image) Then
Dim iPictureUpdate As DialogResult = MessageBox.Show("Would You Like To Update The Club Logo ?", "Club Logo Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If iPictureUpdate = DialogResult.Yes Then
' Loads And Image And Resize It In PNG Format
ResizePicture(pb_logo, 500, 500)
End If
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' List Down Clubs
GetClubsList(cbo_clubs)
End Sub
Private Sub btn_save_Click(sender As Object, e As EventArgs) Handles btn_save.Click
' Updates A Club Logo
UpdateClubLogo(pb_logo, cbo_clubs.SelectedValue)
End Sub
Private Sub cbo_clubs_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbo_clubs.SelectedIndexChanged
Try
' Displays Clubs Logo
GetClubLogo(pb_logo, cbo_clubs.SelectedValue)
Catch ex As Exception
End Try
End Sub
End Class
@@ -0,0 +1,105 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frm_update_flag
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent()
Me.pb_country_flag = New System.Windows.Forms.PictureBox()
Me.btn_open = New System.Windows.Forms.Button()
Me.btn_save = New System.Windows.Forms.Button()
Me.cbo_countries = New System.Windows.Forms.ComboBox()
CType(Me.pb_country_flag, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'pb_country_flag
'
Me.pb_country_flag.Location = New System.Drawing.Point(5, 5)
Me.pb_country_flag.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.pb_country_flag.Name = "pb_country_flag"
Me.pb_country_flag.Size = New System.Drawing.Size(325, 205)
Me.pb_country_flag.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.pb_country_flag.TabIndex = 0
Me.pb_country_flag.TabStop = False
'
'btn_open
'
Me.btn_open.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_open.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, CType(0, Byte))
Me.btn_open.Location = New System.Drawing.Point(5, 250)
Me.btn_open.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btn_open.Name = "btn_open"
Me.btn_open.Size = New System.Drawing.Size(160, 45)
Me.btn_open.TabIndex = 1
Me.btn_open.Text = "Open"
Me.btn_open.UseVisualStyleBackColor = True
'
'btn_save
'
Me.btn_save.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_save.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, CType(0, Byte))
Me.btn_save.Location = New System.Drawing.Point(170, 250)
Me.btn_save.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.btn_save.Name = "btn_save"
Me.btn_save.Size = New System.Drawing.Size(160, 45)
Me.btn_save.TabIndex = 2
Me.btn_save.Text = "Save"
Me.btn_save.UseVisualStyleBackColor = True
'
'cbo_countries
'
Me.cbo_countries.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
Me.cbo_countries.DropDownHeight = 100
Me.cbo_countries.Font = New System.Drawing.Font("Microsoft Sans Serif", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, CType(0, Byte))
Me.cbo_countries.ForeColor = System.Drawing.Color.White
Me.cbo_countries.FormattingEnabled = True
Me.cbo_countries.IntegralHeight = False
Me.cbo_countries.Location = New System.Drawing.Point(5, 215)
Me.cbo_countries.Name = "cbo_countries"
Me.cbo_countries.Size = New System.Drawing.Size(325, 30)
Me.cbo_countries.TabIndex = 3
'
'frm_update_flag
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(9.0!, 20.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
Me.ClientSize = New System.Drawing.Size(336, 301)
Me.Controls.Add(Me.cbo_countries)
Me.Controls.Add(Me.btn_save)
Me.Controls.Add(Me.btn_open)
Me.Controls.Add(Me.pb_country_flag)
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.ForeColor = System.Drawing.Color.White
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Margin = New System.Windows.Forms.Padding(4, 5, 4, 5)
Me.Name = "frm_update_flag"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Update Flag"
CType(Me.pb_country_flag, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
Friend WithEvents pb_country_flag As PictureBox
Friend WithEvents btn_open As Button
Friend WithEvents btn_save As Button
Friend WithEvents cbo_countries As ComboBox
End Class
@@ -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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,78 @@
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class frm_update_flag
Private Country As country
Private Sub btn_open_Click(sender As Object, e As EventArgs) Handles btn_open.Click
If IsNothing(pb_country_flag.Image) Then
' Open Picture File
ResizePicture(pb_country_flag, 236, 156)
' Making Sure The Isntance Is Ready
Country = New country(cbo_countries.SelectedValue)
' Store The Picture
Country.UpdateFlag(pb_country_flag)
ElseIf Not IsNothing(pb_country_flag.Image) Then
Dim iPictureUpdate As DialogResult = MessageBox.Show("Would You Like To Update The Country Flag ?", "Country Flag Update", MessageBoxButtons.YesNo, MessageBoxIcon.Question)
If iPictureUpdate = DialogResult.Yes Then
' Open Picture File
ResizePicture(pb_country_flag, 236, 156)
' Making Sure The Isntance Is Ready
Country = New country(cbo_countries.SelectedValue)
' Store The Picture
Country.UpdateFlag(pb_country_flag)
End If
End If
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
Try
' Read All Countries To ComboBox
GetCountryList(cbo_countries)
Catch ex As Exception
cbo_countries.Items.Clear()
cbo_countries.DataSource = Nothing
End Try
End Sub
Private Sub btn_save_Click(sender As Object, e As EventArgs) Handles btn_save.Click
Try
' Read Created Function To Update Country Flag In Functions Module
Country = New country(cbo_countries.SelectedValue)
Country.UpdateFlag(pb_country_flag)
Catch ex As Exception
pb_country_flag.Image = Nothing
End Try
End Sub
Private Sub cbo_countries_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbo_countries.SelectedIndexChanged
Try
' Read Country Flag Image From Database To Picture Box
Country = New country(cbo_countries.SelectedValue)
pb_country_flag.Image = Image.FromStream(Country.Flag)
Catch ex As Exception
pb_country_flag.Image = Nothing
End Try
End Sub
End Class
@@ -0,0 +1,473 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frm_add_person
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.Label1 = New System.Windows.Forms.Label()
Me.Label2 = New System.Windows.Forms.Label()
Me.txt_fname = New System.Windows.Forms.TextBox()
Me.txt_mname = New System.Windows.Forms.TextBox()
Me.date_birthday = New System.Windows.Forms.DateTimePicker()
Me.Label4 = New System.Windows.Forms.Label()
Me.txt_lname = New System.Windows.Forms.TextBox()
Me.Label3 = New System.Windows.Forms.Label()
Me.Label5 = New System.Windows.Forms.Label()
Me.cbo_gender = New System.Windows.Forms.ComboBox()
Me.txt_mobile = New System.Windows.Forms.TextBox()
Me.Label6 = New System.Windows.Forms.Label()
Me.txt_cpr = New System.Windows.Forms.TextBox()
Me.txt_weight = New System.Windows.Forms.TextBox()
Me.Label7 = New System.Windows.Forms.Label()
Me.Label8 = New System.Windows.Forms.Label()
Me.txt_address = New System.Windows.Forms.TextBox()
Me.Label10 = New System.Windows.Forms.Label()
Me.cbo_club = New System.Windows.Forms.ComboBox()
Me.Label11 = New System.Windows.Forms.Label()
Me.btn_add_person = New System.Windows.Forms.Button()
Me.pb_person_picture = New System.Windows.Forms.PictureBox()
Me.lbl_picture = New System.Windows.Forms.Label()
Me.cbo_country = New System.Windows.Forms.ComboBox()
Me.Label12 = New System.Windows.Forms.Label()
Me.txt_email = New System.Windows.Forms.TextBox()
Me.Label9 = New System.Windows.Forms.Label()
Me.pb_flag = New System.Windows.Forms.PictureBox()
Me.pb_club = New System.Windows.Forms.PictureBox()
CType(Me.pb_person_picture, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.pb_flag, System.ComponentModel.ISupportInitialize).BeginInit()
CType(Me.pb_club, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label1.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label1.ForeColor = System.Drawing.Color.White
Me.Label1.Location = New System.Drawing.Point(235, 10)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(145, 30)
Me.Label1.TabIndex = 2
Me.Label1.Text = "First Name"
Me.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'Label2
'
Me.Label2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label2.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label2.ForeColor = System.Drawing.Color.White
Me.Label2.Location = New System.Drawing.Point(235, 45)
Me.Label2.Name = "Label2"
Me.Label2.Size = New System.Drawing.Size(145, 30)
Me.Label2.TabIndex = 3
Me.Label2.Text = "Middle Name"
Me.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'txt_fname
'
Me.txt_fname.BackColor = System.Drawing.Color.White
Me.txt_fname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txt_fname.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txt_fname.ForeColor = System.Drawing.Color.Black
Me.txt_fname.Location = New System.Drawing.Point(390, 10)
Me.txt_fname.Name = "txt_fname"
Me.txt_fname.Size = New System.Drawing.Size(339, 29)
Me.txt_fname.TabIndex = 5
'
'txt_mname
'
Me.txt_mname.BackColor = System.Drawing.Color.White
Me.txt_mname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txt_mname.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txt_mname.ForeColor = System.Drawing.Color.Black
Me.txt_mname.Location = New System.Drawing.Point(390, 45)
Me.txt_mname.Name = "txt_mname"
Me.txt_mname.Size = New System.Drawing.Size(340, 29)
Me.txt_mname.TabIndex = 6
'
'date_birthday
'
Me.date_birthday.CustomFormat = "yyyy-MM-dd"
Me.date_birthday.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.date_birthday.Format = System.Windows.Forms.DateTimePickerFormat.Custom
Me.date_birthday.Location = New System.Drawing.Point(390, 185)
Me.date_birthday.Name = "date_birthday"
Me.date_birthday.Size = New System.Drawing.Size(340, 29)
Me.date_birthday.TabIndex = 8
'
'Label4
'
Me.Label4.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label4.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label4.ForeColor = System.Drawing.Color.White
Me.Label4.Location = New System.Drawing.Point(235, 185)
Me.Label4.Name = "Label4"
Me.Label4.Size = New System.Drawing.Size(145, 30)
Me.Label4.TabIndex = 9
Me.Label4.Text = "Birthdate"
Me.Label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'txt_lname
'
Me.txt_lname.BackColor = System.Drawing.Color.White
Me.txt_lname.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txt_lname.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txt_lname.ForeColor = System.Drawing.Color.Black
Me.txt_lname.Location = New System.Drawing.Point(390, 80)
Me.txt_lname.Name = "txt_lname"
Me.txt_lname.Size = New System.Drawing.Size(340, 29)
Me.txt_lname.TabIndex = 11
'
'Label3
'
Me.Label3.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label3.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label3.ForeColor = System.Drawing.Color.White
Me.Label3.Location = New System.Drawing.Point(235, 80)
Me.Label3.Name = "Label3"
Me.Label3.Size = New System.Drawing.Size(145, 30)
Me.Label3.TabIndex = 10
Me.Label3.Text = "Last Name"
Me.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'Label5
'
Me.Label5.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label5.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label5.ForeColor = System.Drawing.Color.White
Me.Label5.Location = New System.Drawing.Point(235, 150)
Me.Label5.Name = "Label5"
Me.Label5.Size = New System.Drawing.Size(145, 30)
Me.Label5.TabIndex = 12
Me.Label5.Text = "Gender"
Me.Label5.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'cbo_gender
'
Me.cbo_gender.BackColor = System.Drawing.Color.White
Me.cbo_gender.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.cbo_gender.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cbo_gender.ForeColor = System.Drawing.Color.Black
Me.cbo_gender.FormattingEnabled = True
Me.cbo_gender.Items.AddRange(New Object() {"MALE", "FEMALE"})
Me.cbo_gender.Location = New System.Drawing.Point(390, 150)
Me.cbo_gender.Name = "cbo_gender"
Me.cbo_gender.Size = New System.Drawing.Size(340, 30)
Me.cbo_gender.TabIndex = 13
Me.cbo_gender.Text = "MALE"
'
'txt_mobile
'
Me.txt_mobile.BackColor = System.Drawing.Color.White
Me.txt_mobile.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txt_mobile.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txt_mobile.ForeColor = System.Drawing.Color.Black
Me.txt_mobile.Location = New System.Drawing.Point(390, 290)
Me.txt_mobile.Name = "txt_mobile"
Me.txt_mobile.Size = New System.Drawing.Size(340, 29)
Me.txt_mobile.TabIndex = 19
'
'Label6
'
Me.Label6.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label6.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label6.ForeColor = System.Drawing.Color.White
Me.Label6.Location = New System.Drawing.Point(235, 290)
Me.Label6.Name = "Label6"
Me.Label6.Size = New System.Drawing.Size(145, 30)
Me.Label6.TabIndex = 18
Me.Label6.Text = "Mobile"
Me.Label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'txt_cpr
'
Me.txt_cpr.BackColor = System.Drawing.Color.White
Me.txt_cpr.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txt_cpr.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txt_cpr.ForeColor = System.Drawing.Color.Black
Me.txt_cpr.Location = New System.Drawing.Point(390, 255)
Me.txt_cpr.MaxLength = 9
Me.txt_cpr.Name = "txt_cpr"
Me.txt_cpr.Size = New System.Drawing.Size(340, 29)
Me.txt_cpr.TabIndex = 17
'
'txt_weight
'
Me.txt_weight.BackColor = System.Drawing.Color.White
Me.txt_weight.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txt_weight.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txt_weight.ForeColor = System.Drawing.Color.Black
Me.txt_weight.Location = New System.Drawing.Point(390, 220)
Me.txt_weight.Name = "txt_weight"
Me.txt_weight.Size = New System.Drawing.Size(340, 29)
Me.txt_weight.TabIndex = 16
'
'Label7
'
Me.Label7.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label7.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label7.ForeColor = System.Drawing.Color.White
Me.Label7.Location = New System.Drawing.Point(235, 255)
Me.Label7.Name = "Label7"
Me.Label7.Size = New System.Drawing.Size(145, 30)
Me.Label7.TabIndex = 15
Me.Label7.Text = "CPR"
Me.Label7.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'Label8
'
Me.Label8.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label8.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label8.ForeColor = System.Drawing.Color.White
Me.Label8.Location = New System.Drawing.Point(235, 220)
Me.Label8.Name = "Label8"
Me.Label8.Size = New System.Drawing.Size(145, 30)
Me.Label8.TabIndex = 14
Me.Label8.Text = "Weight"
Me.Label8.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'txt_address
'
Me.txt_address.BackColor = System.Drawing.Color.White
Me.txt_address.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txt_address.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txt_address.ForeColor = System.Drawing.Color.Black
Me.txt_address.Location = New System.Drawing.Point(390, 360)
Me.txt_address.Name = "txt_address"
Me.txt_address.Size = New System.Drawing.Size(340, 29)
Me.txt_address.TabIndex = 23
'
'Label10
'
Me.Label10.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label10.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label10.ForeColor = System.Drawing.Color.White
Me.Label10.Location = New System.Drawing.Point(235, 360)
Me.Label10.Name = "Label10"
Me.Label10.Size = New System.Drawing.Size(145, 30)
Me.Label10.TabIndex = 22
Me.Label10.Text = "Address"
Me.Label10.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'cbo_club
'
Me.cbo_club.BackColor = System.Drawing.Color.White
Me.cbo_club.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.cbo_club.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cbo_club.ForeColor = System.Drawing.Color.Black
Me.cbo_club.FormattingEnabled = True
Me.cbo_club.Items.AddRange(New Object() {"ACES", "WARRIOR TAEKWONDO ACADEMY", "BAHRAIN TAEKWONDO SCHOOL"})
Me.cbo_club.Location = New System.Drawing.Point(390, 395)
Me.cbo_club.Name = "cbo_club"
Me.cbo_club.Size = New System.Drawing.Size(340, 30)
Me.cbo_club.TabIndex = 25
Me.cbo_club.Text = "Select Participant Club"
'
'Label11
'
Me.Label11.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label11.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label11.ForeColor = System.Drawing.Color.White
Me.Label11.Location = New System.Drawing.Point(235, 395)
Me.Label11.Name = "Label11"
Me.Label11.Size = New System.Drawing.Size(145, 30)
Me.Label11.TabIndex = 24
Me.Label11.Text = "Club"
Me.Label11.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'btn_add_person
'
Me.btn_add_person.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.btn_add_person.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btn_add_person.ForeColor = System.Drawing.Color.White
Me.btn_add_person.Location = New System.Drawing.Point(10, 360)
Me.btn_add_person.Name = "btn_add_person"
Me.btn_add_person.Size = New System.Drawing.Size(215, 65)
Me.btn_add_person.TabIndex = 26
Me.btn_add_person.Text = "ADD PERSON"
Me.btn_add_person.UseVisualStyleBackColor = True
'
'pb_person_picture
'
Me.pb_person_picture.Image = Global.TAKEONE_EMASS.My.Resources.Resources._8i6oer5KT
Me.pb_person_picture.Location = New System.Drawing.Point(10, 45)
Me.pb_person_picture.Name = "pb_person_picture"
Me.pb_person_picture.Size = New System.Drawing.Size(215, 235)
Me.pb_person_picture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.pb_person_picture.TabIndex = 27
Me.pb_person_picture.TabStop = False
'
'lbl_picture
'
Me.lbl_picture.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.lbl_picture.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lbl_picture.ForeColor = System.Drawing.Color.White
Me.lbl_picture.Location = New System.Drawing.Point(10, 10)
Me.lbl_picture.Name = "lbl_picture"
Me.lbl_picture.Size = New System.Drawing.Size(215, 30)
Me.lbl_picture.TabIndex = 28
Me.lbl_picture.Text = "Person Picture"
Me.lbl_picture.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
'
'cbo_country
'
Me.cbo_country.BackColor = System.Drawing.Color.White
Me.cbo_country.FlatStyle = System.Windows.Forms.FlatStyle.Flat
Me.cbo_country.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cbo_country.ForeColor = System.Drawing.Color.Black
Me.cbo_country.FormattingEnabled = True
Me.cbo_country.Items.AddRange(New Object() {"WHITE", "YELLOW", "GREEN", "BLUE", "RED", "POOM", "BLACK DAN 1", "BLACK DAN 2", "BLACK DAN 3", "BLACK DAN 4", "BLACK DAN 5", "BLACK DAN 6", "BLACK DAN 7", "BLACK DAN 8", "BLACK DAN 9", "BLACK DAN 10"})
Me.cbo_country.Location = New System.Drawing.Point(390, 115)
Me.cbo_country.Name = "cbo_country"
Me.cbo_country.Size = New System.Drawing.Size(340, 30)
Me.cbo_country.TabIndex = 30
Me.cbo_country.Text = "Select Your Nationality"
'
'Label12
'
Me.Label12.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label12.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label12.ForeColor = System.Drawing.Color.White
Me.Label12.Location = New System.Drawing.Point(235, 115)
Me.Label12.Name = "Label12"
Me.Label12.Size = New System.Drawing.Size(145, 30)
Me.Label12.TabIndex = 29
Me.Label12.Text = "Nationality"
Me.Label12.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'txt_email
'
Me.txt_email.BackColor = System.Drawing.Color.White
Me.txt_email.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.txt_email.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txt_email.ForeColor = System.Drawing.Color.Black
Me.txt_email.Location = New System.Drawing.Point(390, 325)
Me.txt_email.Name = "txt_email"
Me.txt_email.Size = New System.Drawing.Size(340, 29)
Me.txt_email.TabIndex = 32
'
'Label9
'
Me.Label9.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.Label9.Font = New System.Drawing.Font("Arial Rounded MT Bold", 14.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Label9.ForeColor = System.Drawing.Color.White
Me.Label9.Location = New System.Drawing.Point(235, 325)
Me.Label9.Name = "Label9"
Me.Label9.Size = New System.Drawing.Size(145, 30)
Me.Label9.TabIndex = 31
Me.Label9.Text = "Em@il"
Me.Label9.TextAlign = System.Drawing.ContentAlignment.MiddleRight
'
'pb_flag
'
Me.pb_flag.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
Me.pb_flag.Location = New System.Drawing.Point(110, 290)
Me.pb_flag.Name = "pb_flag"
Me.pb_flag.Size = New System.Drawing.Size(100, 60)
Me.pb_flag.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.pb_flag.TabIndex = 37
Me.pb_flag.TabStop = False
'
'pb_club
'
Me.pb_club.BackColor = System.Drawing.Color.Transparent
Me.pb_club.Location = New System.Drawing.Point(20, 285)
Me.pb_club.Name = "pb_club"
Me.pb_club.Size = New System.Drawing.Size(70, 70)
Me.pb_club.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.pb_club.TabIndex = 38
Me.pb_club.TabStop = False
'
'frm_add_person
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.BackColor = System.Drawing.Color.FromArgb(CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer), CType(CType(64, Byte), Integer))
Me.ClientSize = New System.Drawing.Size(740, 436)
Me.Controls.Add(Me.pb_club)
Me.Controls.Add(Me.pb_flag)
Me.Controls.Add(Me.txt_email)
Me.Controls.Add(Me.Label9)
Me.Controls.Add(Me.cbo_country)
Me.Controls.Add(Me.Label12)
Me.Controls.Add(Me.lbl_picture)
Me.Controls.Add(Me.btn_add_person)
Me.Controls.Add(Me.cbo_club)
Me.Controls.Add(Me.Label11)
Me.Controls.Add(Me.txt_address)
Me.Controls.Add(Me.Label10)
Me.Controls.Add(Me.txt_mobile)
Me.Controls.Add(Me.Label6)
Me.Controls.Add(Me.txt_cpr)
Me.Controls.Add(Me.txt_weight)
Me.Controls.Add(Me.Label7)
Me.Controls.Add(Me.Label8)
Me.Controls.Add(Me.cbo_gender)
Me.Controls.Add(Me.Label5)
Me.Controls.Add(Me.txt_lname)
Me.Controls.Add(Me.Label3)
Me.Controls.Add(Me.Label4)
Me.Controls.Add(Me.date_birthday)
Me.Controls.Add(Me.txt_mname)
Me.Controls.Add(Me.txt_fname)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.pb_person_picture)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow
Me.Name = "frm_add_person"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Add New Person"
CType(Me.pb_person_picture, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.pb_flag, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.pb_club, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents Label1 As Label
Friend WithEvents Label2 As Label
Friend WithEvents txt_fname As TextBox
Friend WithEvents txt_mname As TextBox
Friend WithEvents date_birthday As DateTimePicker
Friend WithEvents Label4 As Label
Friend WithEvents txt_lname As TextBox
Friend WithEvents Label3 As Label
Friend WithEvents Label5 As Label
Friend WithEvents cbo_gender As ComboBox
Friend WithEvents txt_mobile As TextBox
Friend WithEvents Label6 As Label
Friend WithEvents txt_cpr As TextBox
Friend WithEvents txt_weight As TextBox
Friend WithEvents Label7 As Label
Friend WithEvents Label8 As Label
Friend WithEvents txt_address As TextBox
Friend WithEvents Label10 As Label
Friend WithEvents cbo_club As ComboBox
Friend WithEvents Label11 As Label
Friend WithEvents btn_add_person As Button
Friend WithEvents pb_person_picture As PictureBox
Friend WithEvents lbl_picture As Label
Friend WithEvents cbo_country As ComboBox
Friend WithEvents Label12 As Label
Friend WithEvents txt_email As TextBox
Friend WithEvents Label9 As Label
Friend WithEvents pb_flag As PictureBox
Friend WithEvents pb_club As PictureBox
End Class
@@ -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=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
@@ -0,0 +1,139 @@
Imports System.ComponentModel
Imports System.IO
Imports MySql.Data.MySqlClient
Public Class frm_add_person
Private Sub add_person()
Dim person As New person(txt_fname.Text, txt_mname.Text, txt_lname.Text, date_birthday.Text, cbo_gender.Text, txt_weight.Text, txt_cpr.Text, cbo_country.SelectedValue, txt_mobile.Text, txt_email.Text, txt_address.Text, cbo_club.SelectedValue, pb_person_picture)
End Sub
Private Sub Load_Picture()
'Creating A New Dialog
Dim OpenPictureFile As New OpenFileDialog
'Filtering The Types
OpenPictureFile.Filter = "Image Files | *.jpg; *.jpeg; *.bmp; *.png; *.gif;"
'Openning The File
If OpenPictureFile.ShowDialog = System.Windows.Forms.DialogResult.OK Then
Try
' Getting File Path
Dim FilePath As String = OpenPictureFile.FileName()
Dim FileName As String = System.IO.Path.GetFileName(OpenPictureFile.FileName)
' Picture File
Dim Picture As New MemoryStream
' Define New Image Size
Dim LogoSize As New Size(385, 500)
' Resizing The Image
Dim ResizedImage = New Bitmap(Image.FromFile(FilePath), LogoSize)
' Display The Image
pb_person_picture.Image = ResizedImage
' Saving The Image As PNG Format
pb_person_picture.Image.Save(Picture, System.Drawing.Imaging.ImageFormat.Png)
' Read The Image As Bytes
Dim arrImage() As Byte = Picture.GetBuffer
' Closing The Picture
Picture.Close()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End If
End Sub
Private Sub btn_add_person_Click(sender As Object, e As EventArgs) Handles btn_add_person.Click
add_person()
Me.Close()
End Sub
Private Sub frm_add_person_Load(sender As Object, e As EventArgs) Handles Me.Load
Try
' List Down The Countries
GetCountryList(cbo_country)
Catch ex As Exception
End Try
Try
' List Down Clubs
GetClubsList(cbo_club)
Catch ex As Exception
End Try
End Sub
Private Sub cbo_country_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbo_country.SelectedIndexChanged
Dim QRY As String
Try
QRY = "select flag from countries where id=" & cbo_country.SelectedValue
Catch ex As Exception
Exit Sub
End Try
Dim CON As New MySqlConnection(CON_STRING)
Dim COM As New MySqlCommand(QRY, CON)
Dim RDR As MySqlDataReader
Dim LST As New List(Of dataset)
Try
CON.Open()
RDR = COM.ExecuteReader
If RDR.HasRows = True Then
While RDR.Read
Try
Dim data As Byte() = DirectCast(RDR("flag"), Byte())
Dim flag As New System.IO.MemoryStream(data)
pb_flag.Image = Image.FromStream(flag)
Catch ex As Exception
pb_flag.Image = Nothing
Exit Sub
End Try
End While
End If
CON.Close()
Catch ex As MySqlException
MessageBox.Show(ex.Message)
Finally
CON.Dispose()
End Try
End Sub
Private Sub pb_person_picture_Click(sender As Object, e As EventArgs) Handles pb_person_picture.Click
'Load_Picture()
ResizePicture(pb_person_picture, 385, 500)
End Sub
Private Sub cbo_club_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cbo_club.SelectedIndexChanged
Try
GetClubLogo(pb_club, cbo_club.SelectedValue)
Catch ex As Exception
End Try
End Sub
End Class