Design and Implementation of Campus Second-hand Items Trading Website Based on ASP.NET Source Code + Design Document + Instruction Document

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

Abstract

Abstract

introduction

1. Main technical environment for system development

(1) Introduction to the Visual Studio.NET platform

(2) Introduction to ASP.NET

(3) Introduction to C#

(4) Introduction to SQL Server 2005

2. System requirements

(1) Feasibility analysis

1. Feasibility of technology and development method

2. Management Feasibility

3. Economic feasibility

4. Operational feasibility

5. Legal feasibility

(2) Functional analysis of the system

(3) Analysis of system requirements

3. Overall design of system modules

(1) System outline design

(2) Database design

1. Database requirements analysis

2. Database conceptual structure design

3. Database logical structure design

4. Detailed system design and implementation

(1) System business process

(2) Detailed system design

1. Homepage Design

2. User registration page

3. User login page

4. Product details page

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

5. System test

(1) Overview of the test plan

1. Test strategy

2. Test method

3. Test points

4. Test content

(2) Test results

Conclusion

Thanks

references

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());
    }
}

Source code acquisition

👇🏻👇🏻👇🏻 Check the QQ business card below for contact information👇🏻👇🏻👇🏻

Tags: Back-end Database ASP.NET GraduationDesign

Posted by pilau on Tue, 06 Sep 2022 01:34:01 +0930