当前位置:编程学习 > asp >>

网上购物系统(Task007)——FormView显示商品详细信息

一、在数据库表Item中添加字段Descn、SupplyTime、SupplyDate、SupplyArea。因为除Descn,其它几个字段内容都差不多,所以,设置一下默认值,以后添加,更新数据库内容时,会更方便。二、在数据集Model类库中添加类ItemDetails.cs。

[csharp]  using System; 
 
namespace WestGarden.Model 

    public class ItemDetails 
    { 
        private int itemid; 
        private string categoryid; 
        private string name; 
        private decimal price; 
        private string image; 
        private string categoryname; 
 
        private string descn; 
        private string supplytime; 
        private string supplydate; 
        private string supplyarea; 
 
        public ItemDetails() { } 
 
        public ItemDetails(int itemid, string categoryid, string name, decimal price, string image, string categoryname, 
            string descn, string supplytime,string supplydate,string supplyarea) 
        { 
            this.itemid = itemid; 
            this.categoryid = categoryid; 
            this.name = name; 
            this.price = price; 
            this.image = image; 
            this.categoryname = categoryname; 
 
            this.descn = descn; 
            this.supplytime = supplytime; 
            this.supplydate = supplydate; 
            this.supplyarea = supplyarea; 
        } 
 
        public int ItemId 
        { 
            get { return itemid; } 
            set { itemid = value; } 
        } 
        public string CategoryId 
        { 
            get { return categoryid; } 
            set { categoryid = value; } 
        } 
        public string Name 
        { 
            get { return name; } 
            set { name = value; } 
        } 
        public decimal Price 
        { 
            get { return price; } 
            set { price = value; } 
        } 
        public string Image 
        { 
            get { return image; } 
            set { image = value; } 
        } 
        public string CategoryName 
        { 
            get { return categoryname; } 
            set { categoryname = value; } 
        } 
 
        public string Descn 
        { 
            get { return descn; } 
            set { descn = value; } 
        } 
        public string SupplyTime 
        { 
            get { return supplytime; } 
            set { supplytime = value; } 
        } 
        public string SupplyDate 
        { 
            get { return supplydate; } 
            set { supplydate = value; } 
        } 
        public string SupplyArea 
        { 
            get { return supplyarea; } 
            set { supplyarea = value; } 
        } 
    } 

using System;

namespace WestGarden.Model
{
    public class ItemDetails
    {
        private int itemid;
        private string categoryid;
        private string name;
        private decimal price;
        private string image;
        private string categoryname;

        private string descn;
        private string supplytime;
        private string supplydate;
        private string supplyarea;

        public ItemDetails() { }

        public ItemDetails(int itemid, string categoryid, string name, decimal price, string image, string categoryn

补充:Web开发 , ASP.Net ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,