Papatulong lang po sana ako sa inyo, Restaurant management system ang system na nagawa namin, kaso may gusto ipakuha na feature si sir sa system.
Yung sa required time , na foor example ilang minutes maluluto ang dish, gusto kasi ipatanggal, nag modify na ako sa codes kaso ayaw parin. Yung iabang code is from my friends at sa internet , pero this time di ko talaga ma kuha paano matanggal ang required time.
pa help po, sa monday na po ang re.defense namin, tsaka last enrol na sa monday
ito po ang code, and ang tatanggalin is txtrequired.txt, this is under register button, kung ssan e register niya ang dish na gianawa.
nung una sinubukan ko na gawing optionala nalang ang required time, kasi pag di ka nag input sa required time ay di mag sisave. Kung marunong kayo, plss help.
or tanggalin nalang ang function ng required time. Ay nako. d talaga ako magaling sa ganito, gamit din kasi kami ng code generator. hahay.
sa may mga mabubuting loob jan, ito po yung system ko >> Restaurant management system username : bonbon pasword: bonbon
pls po, paitulungan po ako.di ko na kaya e debug.
Yung sa required time , na foor example ilang minutes maluluto ang dish, gusto kasi ipatanggal, nag modify na ako sa codes kaso ayaw parin. Yung iabang code is from my friends at sa internet , pero this time di ko talaga ma kuha paano matanggal ang required time.
pa help po, sa monday na po ang re.defense namin, tsaka last enrol na sa monday
ito po ang code, and ang tatanggalin is txtrequired.txt, this is under register button, kung ssan e register niya ang dish na gianawa.
Private Sub btnregister_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnregister.Click
Dim Filesource As String
Dim directory As String
Dim destination As String = ""
Dim filename As String = FileBrowser.SafeFileName
Try
'DataGridView1.Rows.Cells(0).Value = txtid.Text
'DataGridView1.Rows.Cells(1).Value = txtname.Text
'DataGridView1.Rows.Cells(2).Value = cmbtype.Text
'DataGridView1.Rows.Cells(3).Value = txtorigin.Text
'DataGridView1.Rows.Cells(4).Value = txtmv.Text
'DataGridView1.Rows.Cells(5).Value = txtsp.Text
'DataGridView1.Rows.Cells(6).Value = nudquality.Value
'DataGridView1.Rows.Cells(7).Value = txtrequired.Text
'DataGridView1.Rows.Cells(8).Value = checkgas.CheckState
'DataGridView1.Rows.Cells(9).Value = checkmicro.CheckState
'DataGridView1.Rows.Cells(10).Value = checkgrill.CheckState
'DataGridView1.Rows.Cells(11).Value = checkfp.CheckState
'DataGridView1.Rows.Cells(12).Value = picbox1.ImageLocation
'Checks whether required fields are filled with valid value
If txtname.Text <> "" And txtmv.Text <> "" And txtsp.Text <> "" And cmbtype.SelectedItem <> "" Then
Dim errorcount As Integer
' Checking whether the name and address information contains "'" or not. If it exists, errorcount increases by one, which leads to encounter error
For i = 1 To Len(txtname.Text)
Dim value As String
value = Mid(txtname.Text, i, 1)
If value = "'" Then
errorcount = errorcount + 1 'If any field includes " ' " then increase the vlaue of errorcount by 1
End If
Next
For i = 1 To Len(txtorigin.Text)
Dim value As String
value = Mid(txtorigin.Text, i, 1)
If value = "'" Then
errorcount = errorcount + 1
End If
Next
Dim originnumericcount As Integer = 0
'Checking whether the non-numeric field contains number or not
For i = 1 To Len(txtorigin.Text)
Dim value As String
value = Mid(txtorigin.Text, i, 1)
If IsNumeric(value) = True Then
originnumericcount = originnumericcount + 1
End If
Next
If errorcount = 0 Then
'Validating numeric and non-numeric fields
If originnumericcount = 0 And IsNumeric(txtmv.Text) = True And IsNumeric(txtsp.Text) = True And IsNumeric(txtrequired.Text) = True Then
If txtmv.Text >= 0 And txtsp.Text >= 0 And txtrequired.Text >= 0 Then
Dim imagelocation As String
imagelocation = picbox1.ImageLocation
If imagelocation <> "" Then
Dim picturedirectory As New DirectoryInfo("C:\RMS")
' Checks whether the directory exists.
If picturedirectory.Exists Then
'Copies the selected picture file to the created directory "C:\RMS"
directory = picturedirectory.FullName
Filesource = FileBrowser.FileName
destination = (directory) & "\" & ((txtid.Text) & filename)
FileCopy(Filesource, destination)
Else
'Creates the directory "C:\RMS"
picturedirectory.Create()
'Copies the selected picture file to the created directory "C:\RMS"
directory = picturedirectory.FullName
Filesource = FileBrowser.FileName
destination = (directory) & "\" & ((txtid.Text) & filename)
FileCopy(Filesource, destination)
End If
End If
'Adds new record in related data table and updates the database
dbconnection.Open()
Dim Sql As String
Sql = "Insert into Dishdetails values ('" & txtid.Text & "','" & txtname.Text & "','" & cmbtype.Text & "','" & txtorigin.Text & "','" & txtmv.Text & "','" & txtsp.Text & "','" & nudquality.Value & "','" & txtrequired.Text & "','" & checkgas.CheckState & "','" & checkmicro.CheckState & "','" & checkgrill.CheckState & "','" & checkfp.CheckState & "','" & destination & "')"
Dim dt As OleDbCommand
dt = New OleDbCommand(Sql, dbconnection)
dt.ExecuteNonQuery()
dbconnection.Close()
MsgBox("New Record added", MsgBoxStyle.Information, "Success")
txtid.Text = txtid.Text + 1
txtmv.Clear()
txtname.Clear()
txtorigin.Clear()
txtrequired.Clear()
txtsp.Clear()
picbox1.Image = My.Resources._default
checkfp.CheckState = CheckState.Unchecked
checkgas.CheckState = CheckState.Unchecked
checkgrill.CheckState = CheckState.Unchecked
checkmicro.CheckState = CheckState.Unchecked
nudquality.Value = 0
Else
'displays error message
MsgBox("Negative value not accepted", MsgBoxStyle.Critical, "NEGATIVE INTEGER")
End If
Else
'Displays error message
MsgBox(" Some fields(Market value, Selling Price and Required Time) accept numbers only and Originaton accept only alphabets, please re-check your records", MsgBoxStyle.Exclamation, "Validation Error")
End If
Else
'Displays error message
MsgBox("Something wrong either in field name or origination, may be there is presence of " & "(') in entered value" & Chr(13) & "Remove that sign if present", MsgBoxStyle.Critical, "ERROR")
End If
Else
'Displays error message
MsgBox("Some of the required fields are left empty", MsgBoxStyle.Critical, "Validation Error")
End If
Catch ex As Exception
'Displays error message
MsgBox(ex.Message, MsgBoxStyle.Critical, "ERROR")
If dbconnection.State = ConnectionState.Open Then
dbconnection.Close() ' ensures that the connection is closed
End If
End Try
End Sub
nung una sinubukan ko na gawing optionala nalang ang required time, kasi pag di ka nag input sa required time ay di mag sisave. Kung marunong kayo, plss help.
or tanggalin nalang ang function ng required time. Ay nako. d talaga ako magaling sa ganito, gamit din kasi kami ng code generator. hahay.
sa may mga mabubuting loob jan, ito po yung system ko >> Restaurant management system username : bonbon pasword: bonbon
pls po, paitulungan po ako.di ko na kaya e debug.
Last edited: