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,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