商品表示(C#)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClassLibrary1
{
    public class cStockInfo
    {
        private string tradecode = "";
        private string fullname = "";
        private string tradetype = "";
        private string standard = "";
        private string tradeunit= "";
        private string produce = "";
        private float qty = 0;
        private float price = 0;
        private float averageprice = 0;
        private float saleprice = 0;
        private float check = 0;
        private float upperlimit = 0;
        private float lowerlimit = 0;
    }
    public string TradeCode
    {
        get { return tradecode; }
        set { tradecode = value; }
    }
    public string FullName
    {
        get { return fullname; }
        set { fullname = value; }
    }
    public string TradeType
    {
        get { return tradetype; }
        set { tradetype = value; }
    }
    public string Standard
    {
        get { return standard; }
        set { standard = value; }
    }
    public string Unit
    {
        get { return tradeunit; }
        set { tradeunit = value; }
    }
    public string Produce
    {
        get { return produce; }
        set { produce = value; }
    }
    public float Qty
    {
        get { return qty; }
        set { qty = value; }
    }
    public float Price
    {
        get { return price; }
        set { price = value; }
    }
    public float Qty
    {
        get { return qty; }
        set { qty = value; }
    }
    public float AveragePrice
    {
        get { return averageprice; }
        set { averageprice = value; }
    }
    public float SalePrice
    {
        get { return saleprice; }
        set { saleprice = value; }
    }
    public float Check
    {
        get { return check; }
        set { check = value; }
    }
    public float Upperlimit
    {
        get { return upperlimit; }
        set { upperlimit = value; }
    }
    public float Lowerlimit
    {
        get { return lowerlimit; }
        set {lowerlimit = value; }
    }
    public void ShowInfo()
    {
        Console.WriteLine("--------------------------------------------------");
        Console.WriteLine("显示商品信息");
        Console.WriteLine("");
        Console.WriteLine("商品编号:{0,-15}",TradeCode);
        Console.WriteLine("单位全称:{0,-15}",FullName);
        Console.WriteLine("商品型号:{0,-15",TradeType);
        Console.WriteLine("");
        Console.WriteLine("商品规格:{0,-15}", Standard);
        Console.WriteLine("单位单位:{0,-15}", Unit);
        Console.WriteLine("商品产地:{0,-15", Produce);
        Console.WriteLine("库存数量:{0,-15}", Qty);
        Console.WriteLine("");
        Console.WriteLine("最后一次价格:{0,-15}", Price);
        Console.WriteLine("加权平均价格:{0,-15}", AveragePrice);
        Console.WriteLine("最后一次销价:{0,-15}", SalePrice);
        Console.WriteLine("");
        Console.WriteLine("盘点数量:{0,-15}", Check);
        Console.WriteLine("库存报警上限:{0,-15}", Upperlimit);
        Console.WriteLine("库存报警下限:{0,-15}", LowerLimit);
        Console.WriteLine("");
        Console.WriteLine("商品信息显示完毕");
        Console.WriteLine("-----------------------------------------------------");
    }
    static void Main(String[] args)
    {
        Console.Title = "商品的库存信息显示";
        Console.WriteLine("库存盘点信息如下:");
        cStockInfo csi1 = new cStockInfo();
        csi1.TradeCode = "TJRA001";
        csi1.FullName = "空调";
        csi1.TradeType = "TYPE-1";
        csi1.Standard = "2匹";
        csi1.Unit = "台";
        csi1.Produce = "天津";
        csi1.Qty = 200;
        csi1.Price = 2000;
        csi1.AveragePrice = 2500;
        csi1.SalePrice = 3000;
        csi1.Check = 200;
        csi1.UpperLimit = 800;
        csi1.LowerLimit = 200;
        csi1.ShowInfo();
        cStockInfo csi2 = new cStockInfo();
        csi2.TradeCode = "TJRA002";
        csi2.FullName = "空调";
        csi2.TradeType = "TYPE-2";
        csi2.Standard = "1.5匹";
        csi2.Unit = "台";
        csi2.Produce = "天津";
        csi2.Qty = 300;
        csi2.Price = 3000;
        csi2.AveragePrice = 3500;
        csi2.SalePrice = 4000;
        csi2.Check = 290;
        csi2.ShowInfo();
        cStockInfo csi3 = new cStockInfo();
        csi3.TradeCode = "TJRA003";
        csi3.TradeType = "TYPE-3";
        csi3.ShoeInfo();
        Console.ReadLine();
    }
   
}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

张立龙666

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值