introduction
This article is based on the actual situation of the second-hand trading situation on campus, and constructs an online trading system that mainly deals with second-hand goods trading on campus, and stores, displays and manages commodity information in an orderly manner. It mainly realizes the design and management of product display, product category, user registration, login and user background function module information for members. Before logging in, users can search and view product display details. After registering and logging in, they can purchase products online, add shipping addresses, contacts and other information, select payment methods, and submit orders. View, edit or delete management, view or delete purchased or sold product information, reply or delete personal messages received, and modify personal information and passwords. The website administrator can manage school management, user management, commodity category management, commodity management, order management, commodity message management and system management through the website background. Using ASP.NET technology, based on B/S framework, and Sql Server 2005 database to establish a dynamic website, to achieve rapid update and maintenance of item information.
Table of contents
1. Main technical environment for system development
(1) Introduction to the Visual Studio.NET platform
(4) Introduction to SQL Server 2005
1. Feasibility of technology and development method
(2) Functional analysis of the system
(3) Analysis of system requirements
3. Overall design of system modules
1. Database requirements analysis
2. Database conceptual structure design
3. Database logical structure design
4. Detailed system design and implementation
5. The message list page I have received
6. Publish product information pages
7. My product information list page
(3) Detailed design of background module interface
1. Administrator login interface
2. Member management information list page
3. Product message information list page
4. Product category information list page
5. Product information list page
6. Manage order information list page
Functional structure diagram
code
using System; using System.Collections.Generic; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Text; using System.Data; using System.Data.SqlClient; public partial class news : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { if(!IsPostBack) { show(); bind(); } } /// <summary> /// Display the corresponding information according to the number /// </summary> protected void show() { string sql = ""; sql = "select a.*,b.tname,c.*,d.unname from products a left join productType b on a.tid=b.tid left join members c on a.lname=c.lname left join university d on c.unid=d.unid where pid=" + Request.QueryString["id"]; //Get the corresponding record according to the number SqlDataReader sdr = DbHelperSQL.ExecuteReader(sql); if (sdr.Read()) { lblpname.Text = sdr["pname"].ToString(); if (sdr["pic"].ToString() != "" && sdr["pic"].ToString().Length > 3) { imgpic.ImageUrl = "uploads/" + sdr["pic"].ToString(); } lblxj.Text = sdr["xj"].ToString(); lblprice.Text = sdr["price"].ToString(); lblmemo.Text = sdr["memo"].ToString(); lbllname.Text = sdr["lname"].ToString(); lblatime.Text = sdr["atime"].ToString(); lbltel.Text = sdr["tel"].ToString(); lblemail.Text = sdr["email"].ToString(); Literal1.Text = sdr["unname"].ToString(); Literal2.Text = sdr["address"].ToString(); Literal3.Text = sdr["qq"].ToString(); ViewState["f"] = sdr["flag"].ToString(); } } /// <summary> /// bind data /// </summary> protected void bind() { DataPage dp = new DataPage(); string where = " pid=" + Request.QueryString["id"]; int recordcount; int pagesize = this.AspNetPager1.PageSize; int pageindex = this.AspNetPager1.CurrentPageIndex; Repeater1.DataSource = dp.pagelist(pagesize, pageindex, "productMess ", " * ", "id", where, "id desc", out recordcount); Repeater1.DataBind(); } /// <summary> ///pagination /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void AspNetPager1_PageChanged(object sender, EventArgs e) { bind(); } protected void btnSave_Click(object sender, EventArgs e) { if (Session["lname"] == null) { MessageBox.RunScript(this, "alert('please log in first!');"); return; } if (Session["lname"].ToString() == Request.QueryString["l"]) { MessageBox.RunScript(this, "alert('Can't message myself!');;"); return; } //set up Sql StringBuilder strSql = new StringBuilder(); strSql.Append(@"insert into ProductMess ( lname,pid,memo,atime,anmemo ) "); strSql.Append(@" values (@lname,@pid,@memo,@atime,@anmemo)"); //Setting parameters SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@lname", SqlDbType.VarChar,50), new SqlParameter("@pid", SqlDbType.Int,4), new SqlParameter("@memo", SqlDbType.VarChar,2000), new SqlParameter("@atime", SqlDbType.DateTime,8), new SqlParameter("@anmemo", SqlDbType.VarChar,2000) }; parameters[0].Value = Session["lname"].ToString(); parameters[1].Value = Request.QueryString["id"]; parameters[2].Value = txt_memo.Text; parameters[3].Value = DateTime.Now; parameters[4].Value = ""; //submit to database DbHelperSQL.ExecuteSql(strSql.ToString(), parameters); MessageBox.ShowAndRedirect(this, "The operation is successful, please wait for the seller's reply!", Request.Url.ToString()); } }