Get the App
SLTechnology News&Howtos  ›  Development  › 

How to use C# to realize online ordering system

Shulou Source: shulou.com Published: 2022-06-03 14:06:11 10月26日 Update

This article mainly explains "how to use C # to realize the online ordering system". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "how to use C# to realize the online ordering system".

Implement the function:

1. Merchant login; customer login and registration. 2. The merchant interface realizes the addition, deletion, modification and query of menus, as well as order viewing, inquiry, checkout (delete orders), viewing closed orders, closing, and exiting the system. 3. The user interface realizes menu viewing, querying, creating new orders, selecting dining tables, saving orders, adding dishes and quitting.

The online ordering system is implemented in C # language, and the specific functions are as follows

Login Page

Using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace MenuSystemWss {public partial class Form1: Form {int dlsf=0; / * SqlConnection sqlcon; SqlCommand sqlcom; SqlDataReader sqlsdr;*/ BaseInfo baseinfo = new BaseInfo (); / / BaseInfo.GkInfo gkinfo = new BaseInfo.GkInfo (); / / public Form1 () {InitializeComponent ();} public void dengluzt () {DataSet ds = null Gkinfo.Gk_num = textBox1.Text.Trim (); ds = baseinfo.DengLu (gkinfo, "db_menu"); gkinfo.Gk_zt = 1; gkinfo.Gk_apw = gkinfo.Gk_pw; gkinfo.Gk_name = ds.Tables [0] .Rows [0] [1] .ToString (). Trim (); baseinfo.Updatgk (this.gkinfo);} private void button1_Click (object sender, EventArgs e) {if (radioButton1.Checked) dlsf = 1; if (radioButton2.Checked) dlsf = 2 If (textBox1.Text.Trim () = = "") {label3.Text = "account cannot be empty"; textBox1.Focus (); return;} else if (textBox2.Text.Trim () = "") {label3.Text = "password cannot be empty"; textBox1.Focus (); return;} else if (dlsf = 2) {try {DataSet ds = null; gkinfo.Gk_num = textBox1.Text.Trim (); gkinfo.Gk_pw = textBox2.Text.Trim () Ds= baseinfo.DengLu (gkinfo, "db_menu"); if (ds== null | | ds.Tables.Count = = 0 | | (ds.Tables.Count = = 1 & & ds.Tables [0] .Rows.Count = = 0) {MessageBox.Show ("wrong user name!") ; return;} else if (ds.Tables [0] .Rows [0] [2] .ToString () .Trim ()! = textBox2.Text.Trim ()) {MessageBox.Show ("password error");} else {MessageBox.Show ("login successful!") ; dengluzt (); gkfm fm = new gkfm (); fm.add (Convert.ToString (textBox1.Text)); fm.Show (); / / this.Hide ();}} catch (Exception ee) {MessageBox.Show (ee.Message);}} else if (dlsf = = 1) {if (textBox1.Text.Trim () = = "1" & & textBox2.Text.Trim () = "1") {MessageBox.Show ("login successful"); sjfm fm = new sjfm (); fm.Show () / / this.Hide ();} else {MessageBox.Show ("wrong account or password! Please re-enter! ") ; return;} private void label3_Click (object sender, EventArgs e) {zcfm fm = new zcfm (); fm.Show (); this.Hide ();}}}

Registration interface

Using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Data.SqlClient;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;namespace MenuSystemWss {public partial class zcfm: Form {BaseInfo baseinfo = new BaseInfo (); / / BaseInfo.GkInfo gkinfo = new BaseInfo.GkInfo (); / / * SqlConnection sqlcon; SqlCommand sqlcom;*/ public zcfm () {InitializeComponent () } private void label6_Click (object sender, EventArgs e) {Form1 fm = new Form1 (); fm.Show (); this.Hide ();} private void button1_Click (object sender, EventArgs e) {if (textBox1.Text.Trim ()) = = "" | textBox1.Text.Length! = 11) {MessageBox.Show ("incorrect mobile phone number, please fill in the standard") } else if (textBox2.Text.Trim () = = "") {MessageBox.Show ("user name error, please fill in 4-8 digits");} else if (textBox3.Text.Trim () = = "" | textBox3.Text.Length |

< 6 || textBox3.Text.Length >

Tags: Dishes errors successes orders prompts passwords data table numbers interfaces queries selections systems users clients online types logins prices information goods Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Shulou Technology macOS Shulou Tech Info MySQL