Source Code
Source Code
Login.vb
Imports System.Data
Imports System.Data.OleDb
End Sub
TextBox1.Text = ""
TextBox2.Text = ""
End Sub
con.Open()
sql = "SELECT * FROM logs WHERE uname='" & TextBox1.Text & "' and pwd='" & TextBox2.Text & "'"
Dim rd As OleDbDataReader
rd = cmd.ExecuteReader
MsgBox("Login Success")
MDIParent1.Show()
Me.Hide()
Else
MsgBox("Login Failed")
End If
con.Close()
End Sub
End Class
End Sub
End Sub
ProgressBar1.Minimum = 0
ProgressBar1.Maximum = 1000000
ProgressBar1.Value = PrgCounter
PrgCounter = PrgCounter + 1
Loop
Button1.Visible = True
End If
End Sub
Form1.Show()
Me.Hide()
End Sub
End Class
Imports System.Data
Imports System.Data.OleDb
Button2.Enabled = False
End Sub
con.Open()
sql = "INSERT INTO Employee_reg (emp_name, j_date, emp_mob, emp_addr, emp_desig) values ('"
& TextBox1.Text & "', '" & DateTimePicker1.Value & "' , '" & TextBox2.Text & "' , '" & TextBox3.Text & "' ,
'" & ComboBox1.SelectedText & "' )"
If cmd.ExecuteNonQuery Then
MsgBox("Data Saved")
Else
MsgBox("Failed to Save")
End If
con.Close()
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Button1.Enabled = False
Button2.Enabled = True
End Sub
End Sub
con.Open()
sql = "UPDATE Employee_reg SET emp_name='" & TextBox1.Text & "' , j_date='" &
DateTimePicker1.Value & "' , emp_mob='" & TextBox2.Text & "' , emp_addr ='" & TextBox3.Text & "' ,
emp_desig='" & ComboBox1.Text & "' WHERE ID=" & TextBox4.Text & ""
If cmd.ExecuteNonQuery Then
MsgBox("Data Update")
Else
MsgBox("Failed to Update")
End If
con.Close()
End Sub
Private Sub Button5_Click(sender As System.Object, e As System.EventArgs) Handles Button5.Click
con.Open()
sql = "SELECT * FROM Employee_reg WHERE ID=" & TextBox4.Text & ""
Dim rd As OleDbDataReader
rd = cmd.ExecuteReader
If rd.Read Then
TextBox1.Text = rd.GetString(1)
TextBox2.Text = rd.GetString(3)
TextBox3.Text = rd.GetString(4)
ComboBox1.Text = rd.GetString(5)
DateTimePicker1.Value = rd.GetDateTime(2)
End If
con.Close()
End Sub
con.Open()
sql = "DELETE FROM Employee_reg WHERE ID=" & TextBox4.Text & ""
Else
End If
con.Close()
End Sub
End Class
Imports System.Data
Imports System.Data.OleDb
End Sub
Button2.Enabled = False
Button6.Visible = False
Label8.Visible = False
TextBox6.Visible = False
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\Supermarket\
Supermarket\supermarket.mdb"
End Sub
End Sub
Button1.Enabled = False
Button2.Enabled = True
Dim qr As String
Dim id As Integer
con.Open()
Dim rs As OleDbDataReader
rs = cd.ExecuteReader
If rs.Read Then
id = Val(rs.Item("pid"))
If id = Nothing Then
id = 1
MsgBox("less")
Else
id = id + 1
End If
End If
TextBox1.Text = id
con.Close()
End Sub
con.Open()
sql = "INSERT INTO products Values ('" & TextBox1.Text & "' , '" & TextBox2.Text & "','" &
TextBox3.Text & "' , '" & TextBox4.Text & "','" & DateTimePicker1.Value & "' ,'" & TextBox5.Text & "')"
If cmd.ExecuteNonQuery Then
End If
con.Close()
End Sub
con.Open()
sql = "SELECT * FROM products WHERE pid=" & TextBox7.Text & ""
Dim rd As OleDbDataReader
rd = cmd.ExecuteReader
If rd.Read Then
TextBox1.Text = rd.GetInt32(0)
TextBox2.Text = rd.GetString(1)
TextBox3.Text = rd.GetInt32(2)
TextBox4.Text = rd.GetInt32(3)
DateTimePicker1.Value = rd.GetDateTime(4)
TextBox5.Text = rd.GetInt32(5)
TextBox6.Text = rd.GetInt32(5)
TextBox7.Text = rd.GetInt32(5)
End If
con.Close()
End Sub
con.Open()
sql1 = "UPDATE products SET pname='" & TextBox2.Text & "' , pprice=" & TextBox3.Text &
" ,sprice=" & TextBox4.Text & " ,expdate ='" & DateTimePicker1.Value & "' , stock=" & TextBox5.Text & "
WHERE pid=" & TextBox7.Text & ""
If cmd.ExecuteNonQuery Then
MsgBox("Data Updated")
Else
MsgBox("Failed to Update")
End If
con.Close()
End Sub
Button6.Visible = True
Label8.Visible = True
TextBox6.Visible = True
End Sub
con.Open()
sql1 = "UPDATE products SET stock=" & stock & " WHERE pid=" & TextBox7.Text & ""
If cmd.ExecuteNonQuery Then
MsgBox("Stock Updated")
Else
MsgBox("Failed to Update")
End If
con.Close()
Button6.Visible = False
Label8.Visible = False
TextBox6.Visible = False
End Sub
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
con.Open()
sql = "DELETE FROM products WHERE pid=" & TextBox7.Text & ""
If cmd.ExecuteNonQuery Then
Else
End If
con.Close()
End Sub
End Class
Imports System.Data
Imports System.Data.OleDb
con.Open()
sql = "INSERT into sale_temp values ( '" & ComboBox1.Text & "' , '" & TextBox1.Text & "' , '" &
TextBox2.Text & "' , '" & TextBox3.Text & "', '" & TextBox4.Text & "' , '" & TextBox5.Text & "' ,'" &
TextBox6.Text & "' )"
MsgBox("Product added")
End If
Adpt.Fill(ds, "sale")
DataGridView1.DataSource = ds.Tables(0)
con.Close()
DataGridView1.Visible = True
End Sub
Private Sub ComboBox1_TextChanged(sender As Object, e As System.EventArgs) Handles
ComboBox1.TextChanged
con.Open()
qry = "SELECT pname, sprice from products where pid=" & ComboBox1.Text & ""
Dim rd As OleDbDataReader
rd = cmd.ExecuteReader
If rd.Read Then
TextBox2.Text = rd.GetString(0)
TextBox3.Text = rd.GetInt32(1)
End If
con.Close()
End Sub
DataGridView1.Visible = False
con.Open()
Dim rd As OleDbDataReader
rd = cmd.ExecuteReader
While rd.Read
ComboBox1.Items.Add(rd.GetInt32(0))
End While
con.Close()
End Sub
End Sub
End Sub
con.Open()
Dim qr As String
Dim sql As String
rdd = cmd.ExecuteReader
While rdd.Read
sql = "insert into sales values (" & rdd.GetInt32(0) & " , '" & rdd.GetString(1) & "' , '" &
rdd.GetString(2) & "' , " & rdd.GetInt32(3) & " , " & rdd.GetInt32(4) & " , " & rdd.GetInt32(5) & " , " &
rdd.GetInt32(6) & ")"
cd.ExecuteNonQuery()
Dim qq As String
Dim st As Integer
red = cmdd.ExecuteReader
If red.Read Then
st = red.GetInt32(0)
stk = st - Val(TextBox4.Text)
End If
upq = "update products set stock=" & stk & " where pid=" & ComboBox1.Text
ccd.ExecuteNonQuery()
End While
con.Close()
Form6.Show()
Me.Hide()
End Sub
End Sub
End Sub
End Class
Imports System.Data
Imports System.Data.OleDb
' con.Open()
' rd = cd1.ExecuteReader
' End If
' ListBox1.Items.Add(rd.GetString(0))
'ListBox2.Items.Add(rd.GetInt32(2))
' ListBox3.Items.Add(rd.GetInt32(3))
' ListBox4.Items.Add(rd.GetInt32(4))
' con.Close()
End Sub
PrintDialog1.ShowDialog()
con.Open()
If cmd1.ExecuteNonQuery Then
'MsgBox("View Bill")
End If
con.Close()
End Sub
End Class
Imports System.Data
Imports System.Data.OleDb
con.Open()
Dim qry As String
Dim rd As OleDbDataReader
rd = cmd.ExecuteReader
While rd.Read
ComboBox1.Items.Add(rd.GetInt32(0))
End While
con.Close()
End Sub
End Sub
con.Open()
qry = "SELECT pname, sprice from products where pid=" & ComboBox1.Text & ""
Dim rd As OleDbDataReader
rd = cmd.ExecuteReader
If rd.Read Then
TextBox2.Text = rd.GetString(0)
TextBox3.Text = rd.GetInt32(1)
End If
con.Close()
End Sub
Dim qq As String
Dim st As Integer
con.Open()
red = cmdd.ExecuteReader
If red.Read Then
st = red.GetInt32(0)
stk = st + Val(TextBox4.Text)
End If
upq = "update products set stock=" & stk & " where pid=" & ComboBox1.Text
MsgBox("Updated")
End If
sql = "insert into salesreturn values( '" & TextBox1.Text & "', '" & ComboBox1.Text & "' , '" &
TextBox2.Text & "', '" & TextBox3.Text & "' , '" & TextBox4.Text & "' )"
cmd.ExecuteReader()
con.Close()
End Sub
End Class