Professional Documents
Culture Documents
Federal University of Lafia: Department of Computer Science
Federal University of Lafia: Department of Computer Science
ASSIGNMENT
ON
PREPARED BY
Manage foods
Manage Category of foods
Transaction (recieve order,place order)
Manage User
Login and Logout
dglist.Columns(0).Visible = False
Catch ex As Exception
' MsgBox(ex.Message)
End Try
End Sub
My.Computer.FileSystem.CopyFile( _
OpenFileDialog1.FileName, _
Application.StartupPath & "/pic/" & picname)
'''''''''''''''''''''''''''''''''''''''''''
photos.Image = Nothing
Idproduct.Clear()
Idcode.Clear()
foodname.Clear()
price.Clear()
Try
fsize.Text = "Small"
reloadDtg("Select pro_id as 'Product ID' ,Item_name as 'Item code
name',Product_name as 'Product name' ,category as 'Category',price as 'price',size as
'size' From foods_list", dglist)
dglist.Columns(0).Visible = False
Catch ex As Exception
' MsgBox(ex.Message)
End Try
End Sub
End If
Catch ex As Exception
'MsgBox(ex.Message)
End Try
End Sub
Call fclear_Click(sender, e)
'My.Computer.FileSystem.CopyFile( _
' OpenFileDialog1.FileName, _
' Application.StartupPath & "/pic/" & picname)
Catch ex As Exception
End Try
End Sub
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Try
End Sub
End Sub
End Class
Imports MySql.Data.MySqlClient
Public Class adduser
btn_update.Enabled = False
btn_delete.Enabled = False
btn_saveuser.Enabled = True
Else
btn_saveuser.Enabled = True
btn_update.Enabled = True
btn_delete.Enabled = True
End If
Catch ex As Exception
' MsgBox(ex.Message)
End Try
End Sub
Try
cbo_type.Text = "Owner"
Call btn_New_Click(sender, e)
If lbl_id.Text = "ID" Then
btn_update.Enabled = False
btn_delete.Enabled = False
btn_saveuser.Enabled = True
Else
btn_saveuser.Enabled = True
btn_update.Enabled = True
btn_delete.Enabled = True
End If
Catch ex As Exception
' MsgBox(ex.Message)
End Try
End Sub
Public Sub deletes(ByVal sql As String)
Try
con.Open()
With cmd
.Connection = con
.CommandText = sql
End With
'If MessageBox.Show("Do you want to delete this rocord?", "Delete" _
' , MessageBoxButtons.YesNo,
MessageBoxIcon.Information) _
' = Windows.Forms.DialogResult.Yes Then
result = cmd.ExecuteNonQuery
If result = 0 Then
MsgBox("Delete failed.")
Else
MsgBox("The data has been deleted in the database.")
End If
'End If
con.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
Private Sub btn_update_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btn_update.Click
Try
If txt_name.Text = "" Or txt_pass.Text = "" Or txt_username.Text = "" Then
Else
updates("update cashier_user set Firstname = '" & TextBox1.Text &
"',Lastname = '" & txt_name.Text & "',username= '" & txt_username.Text _
& "',pass='" & txt_pass.Text & "',User_status= '" &
cbo_type.Text _
& "' where ID = " & lbl_id.Text)
Call btn_New_Click(sender, e)
End If
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End If
Catch ex As Exception
End Try
End Sub
Catch ex As Exception
' MsgBox(ex.Message)
End Try
End Sub
End Sub