来源:互联网 发布:打开telnet端口 编辑:程序博客网 时间:2024/04/28 23:34
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace CaoShi
{
    public class Storage
    {
           string[] goods = new string[50];


        public string[] Goods
        {
            get { return goods; }
            set { goods = value; }
        }
        string[] palce = new string[50];


        public string[] Palce
        {
            get { return palce; }
            set { palce = value; }
        }
        public void showMenu()
        {
            bool flag = true;
            do{
            Console.WriteLine("======================欢迎使用库存管理系统==================");
            Console.WriteLine("1:根据货品名称获取货品位置 2:取得客户满意度最高的货品 3:退出");
            Console.WriteLine("===========================================================");
            Console.WriteLine("请选择:");
            int num =Convert.ToInt32(Console.ReadLine());
            switch (num) 
            {
                case 1:
                     Console.WriteLine("请输入货品名字:");
                        string h =Console.ReadLine();
                         if (h == "杯子")
                           {
                             Console.WriteLine("第一仓库第一排");
                           }
                           else if (h == "花瓶")
                         { 
                               Console.WriteLine("第一仓库第二排");
                          }
                             else if (h == "热水器")
                             {
                                   Console.WriteLine("第一仓库第三排");
                             }
                             else { Console.WriteLine("缺货..."); }
                            
                   
                    break;
                case 2:
                     Console.WriteLine("客户满意度最高的货品:热水器");
                            Console.WriteLine("摆放在:");
                            Console.WriteLine("第一仓库第三排 客户满意度:99 价格:17.5");
                            
                    break;
                case 3:
                    Console.WriteLine("\n谢谢使用!");
                    flag = false;
                    break;
                default:
                    Console.WriteLine("输入有误,请重新输入选项:");
                    break;
            }
            }while (flag);
        }
    }
}




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


namespace CaoShi
{
    public class goods
    {
        Storage S = new Storage();
        public void chushi()
        {
            S.Goods[0] = "杯子";
            S.Goods[1] = "花瓶";
            S.Goods[2] = "热水器";


            S.Palce[0] = "第一仓库第一排";
            S.Palce[1] = "第一仓库第二排";
            S.Palce[2] = "第一仓库第三排";
        }
    }
}



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


namespace CaoShi
{
    class Program
    {
        static void Main(string[] args)
        {
            Storage s = new Storage();
            s.showMenu();
        }
    }
}


    









原创粉丝点击