04-06-24, 05:37 AM
PHP كود :
Private Async Sub Orders_Load(sender As Object, e As EventArgs) Handles Me.Load
Await Task.WhenAll(
Task.Run(Sub() notee()),
Task.Run(Sub() landryInfo()),
Task.Run(Sub() SelectAll_Customers()),
Task.Run(Sub() GetSub_User()),
Task.Run(Sub() LoadCategory()),
Task.Run(Sub() LoadData())
)
End Sub
Private Sub notee()
Using dp As New OleDbDataAdapter("SELECT ID, notee FROM notess", conn)
Dim dt As New DataTable()
dp.Fill(dt)
CheckedListBox1.DataSource = dt
CheckedListBox1.DisplayMember = "notee"
CheckedListBox1.ValueMember = "ID"
End Using
End Sub
Private Sub landryInfo()
Using dp As New OleDbDataAdapter("SELECT Status_vat, Value_VAT, type, Type_VAT FROM landryInfo WHERE ID = 5", conn)
Dim ds As New DataSet()
dp.Fill(ds)
If ds.Tables(0).Rows.Count <> 0 Then
statusvat = ds.Tables(0).Rows(0).Item("Status_vat")
valuvat = ds.Tables(0).Rows(0).Item("Value_VAT")
paytype = ds.Tables(0).Rows(0).Item("type")
typevat = ds.Tables(0).Rows(0).Item("Type_VAT")
End If
End Using
End Sub
Private Sub SelectAll_Customers()
Using Cmmd As New OleDbCommand("SELECT mobilenumber, customername FROM Customers1", conn)
Using da As New OleDbDataAdapter(Cmmd)
Dim dt As New DataSet()
da.Fill(dt)
Dim cloumn1 As New AutoCompleteStringCollection()
For Each row As DataRow In dt.Tables(0).Rows
cloumn1.Add(row("mobilenumber").ToString())
Next
TextBox11.AutoCompleteSource = AutoCompleteSource.CustomSource
TextBox11.AutoCompleteMode = AutoCompleteMode.SuggestAppend
TextBox11.AutoCompleteCustomSource = cloumn1
End Using
End Using
End Sub
Private Sub GetSub_User()
Using dp As New OleDbDataAdapter("SELECT Sub_Customer, Tailor, Laundery FROM Sub WHERE ID = 1", conn)
Dim ds As New DataSet()
dp.Fill(ds)
If ds.Tables(0).Rows.Count <> 0 Then
subscription = ds.Tables(0).Rows(0).Item("Sub_Customer")
Tailor = ds.Tables(0).Rows(0).Item("Tailor")
Laundery = ds.Tables(0).Rows(0).Item("Laundery")
End If
End Using
Using dp1 As New OleDbDataAdapter("SELECT ID, user_name FROM login", conn)
Dim dt As New DataTable()
dp1.Fill(dt)
ComboBox1.DataSource = dt
ComboBox1.DisplayMember = "user_name"
ComboBox1.ValueMember = "user_name"
ComboBox2.DataSource = dt
ComboBox2.DisplayMember = "ID"
ComboBox2.ValueMember = "ID"
End Using
End Sub
Private Sub LoadCategory()
FlowLayoutPanel3.Controls.Clear()
Using Cmd As New OleDbCommand("SELECT ID, item_NameA FROM Proudect_items", conn)
conn.Open()
Using rdr = Cmd.ExecuteReader()
While rdr.Read()
Dim button = New Button() With {
.Font = New Font("Tahoma", 10, FontStyle.Bold),
.Width = 125,
.Height = 60,
.Text = rdr("item_NameA").ToString(),
.Tag = rdr("ID").ToString(),
.FlatStyle = FlatStyle.Flat,
.BackColor = Color.FromArgb(72, 4, 156),
.ForeColor = Color.White
}
FlowLayoutPanel3.Controls.Add(button)
button.Cursor = Cursors.Hand
AddHandler button.Click, AddressOf button_Click
End While
End Using
End Using
FlowLayoutPanel3.AutoScroll = True
End Sub
Private Sub LoadData()
FlowLayoutPanel1.Controls.Clear()
If _action = "StartUp" Then
Cmd = New OleDbCommand("SELECT pic, ID, ProductNameA, ProductNameE FROM Proudect WHERE ProductNameA LIKE @searchText", conn)
Cmd.Parameters.AddWithValue("@searchText", "%" & TextSerch.Text & "%")
ElseIf _action = "Search1" Then
Cmd = New OleDbCommand("SELECT pic, ID, ProductNameA, ProductNameE FROM Proudect WHERE id_Proudect_items = @query", conn)
Cmd.Parameters.AddWithValue("@query", _query1)
End If
conn.Open()
Using rdr = Cmd.ExecuteReader(CommandBehavior.CloseConnection)
While rdr.Read()
Dim len As Long = rdr.GetBytes(0, 0, Nothing, 0, 0)
Dim array(CInt(len)) As Byte
rdr.GetBytes(0, 0, array, 0, CInt(len))
pic = New PictureBox() With {
.Width = 150,
.Height = 150,
.BackgroundImageLayout = ImageLayout.Stretch,
.Tag = rdr("ID").ToString()
}
AddHandler pic.Click, AddressOf lblD_Click
'-----------------------------------------------------
lblD1 = New Label() With {
.Font = New Font("Tahoma", 10, FontStyle.Bold),
.ForeColor = Color.FromArgb(72, 4, 156),
.BackColor = Color.GhostWhite,
.Dock = DockStyle.Top,
.Tag = rdr("ID").ToString(),
.Text = rdr("ID").ToString()
}
'-----------------------------------------------------
lblD = New Label() With {
.Font = New Font("Tahoma", 9, FontStyle.Bold),
.ForeColor = Color.FromArgb(72, 4, 156),
.BackColor = Color.GhostWhite,
.Dock = DockStyle.Bottom,
.Tag = rdr("ID").ToString(),
.Text = rdr("ProductNameE").ToString() & "-" & rdr("ProductNameA").ToString()
}
AddHandler lblD.Click, AddressOf lblD_Click
'-----------------------------------------------------
Dim ms As New System.IO.MemoryStream(array)
Dim bitmap As New System.Drawing.Bitmap(ms)
pic.BackgroundImage = bitmap
'-----------------------------------------------------
pic.Controls.Add(lblD)
pic.Controls.Add(lblD1)
FlowLayoutPanel1.Controls.Add(pic)
End While
End Using
FlowLayoutPanel1.AutoScroll = True
End Sub
لو كل مسلم رمى دلو ماء لغرقت إسرائيل
