Example #1
0
        public Page1(String name, String storeNumber)
        {
            InitializeComponent();

            //连接服务器,创建通讯类
            dgl = TransDGL.GetInstance();
            //从服务器获取数据
            Store store = dgl.GetStoreInfo(storeNumber);

            t1.Text = store.GetLoc();
            t2.Text = storeNumber;
            t3.Text = name;
            t4.Text = store.GetPa();
            t5.Text = store.GetRent().ToString();
            t6.Text = store.GetMaster();
            bool a = store.GetLease();

            if (a == true)
            {
                c1.Text = "是";
            }
            else
            {
                c1.Text = "否";
            }
        }
Example #2
0
        public Page2(String name, String storeNumber)
        {
            InitializeComponent();
            //连接服务器,创建通讯类
            dgl = TransDGL.GetInstance();

            //从数据库获取数据
            //循环进行列表的初始化操作
            List <Food> ds = new List <Food>();

            getname = name;
            sNumber = storeNumber;
            String shopName = getname;

            //Food[] foods = dgl.GetFoods(sNumber);
            ds = dgl.GetFoods(sNumber);

            /*
             * foreach (Food f in foods)
             * {
             *  var d1 = new Food();
             *  d1.SetFoodNum(f.GetFoodNum());
             *  d1.SetName(f.GetName());
             *  d1.SetPrice(f.GetPrice());
             *  d1.SetId(f.GetId());
             *  d1.SetFoodClass(f.GetFoodClass());
             *  d1.SetFoodTip(f.GetFoodTip());
             *  d1.SetSt(f.GetSt());
             *  ds.Add(d1);
             * }
             */
            this.gridList.ItemsSource = ds; //设置列表
        }
Example #3
0
 public static TransDGL GetInstance()
 {
     if (instance == null)
     {
         instance = new TransDGL();
     }
     return(instance);
 }
Example #4
0
        //String[] shop = new String[112];
        public Window1()
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            InitializeComponent();

            dgl = TransDGL.GetInstance();

            ShowTime();                                          //在这里窗体加载的时候不执行文本框赋值,窗体上不会及时的把时间显示出来,而是等待了片刻才显示了出来
            ShowTimer          = new System.Windows.Threading.DispatcherTimer();
            ShowTimer.Tick    += new EventHandler(ShowCurTimer); //起个Timer一直获取当前时间
            ShowTimer.Interval = new TimeSpan(0, 0, 0, 1, 0);
            ShowTimer.Start();

            List <Store> ls = new List <Store>();

            ls = dgl.GetStores();

            stores = ls.ToArray();
            //stores = dgl.GetStores();

            RadioButton[] rads = { r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12, r13, r14, r15, r16, r17, r18 };
            if (stores.Length >= 18)
            {
                for (int i = 0; i < 18; i++)
                {
                    if (stores[i].id != "")
                    {
                        rads[i].DataContext = stores[i];
                        //rads[i].Content = stores[i].GetName();
                    }
                    else
                    {
                        break;
                    }
                }
            }
            else
            {
                for (int i = 0; i < stores.Length; i++)
                {
                    if (stores[i].id != "")
                    {
                        rads[i].DataContext = stores[i];
                        //rads[i].Content = stores[i].GetName();
                    }
                    else
                    {
                        break;
                    }
                }
                for (int j = stores.Length; j < 18; j++)
                {
                    rads[j].Visibility = Visibility.Hidden;
                }
            }
            page = 0;
        }
Example #5
0
        public Window2()
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            InitializeComponent();

            //连接服务器,创建通讯类

            dgl     = TransDGL.GetInstance();
            c1.Text = "否";
        }
Example #6
0
        public Window4(String name, String storeNumber)
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            InitializeComponent();

            dgl = TransDGL.GetInstance();

            t6.Text = name;
            t9.Text = storeNumber;
            c1.Text = "singal";
        }
Example #7
0
        public Page3(String id)
        {
            InitializeComponent();
            dgl = TransDGL.GetInstance();

            //从服务器中得到店铺消费记录
            List <Bill> ds = new List <Bill>();

            //Bill[] bs = dgl.GetBills(id);
            ds = dgl.GetBills(id);
            if (ds == null)
            {
                Console.Out.WriteLine("获取失败!");
            }
            else
            {
                this.gridList.ItemsSource = ds;
            }
        }
Example #8
0
        public Window3(String shopname, String sNumber, String Number, String name, String Class, String Strategy, int price)
        {
            WindowStartupLocation = WindowStartupLocation.CenterScreen;
            InitializeComponent();

            //连接服务器,创建通讯类

            dgl = TransDGL.GetInstance();

            t2.Text = Number;
            t6.Text = shopname;
            t1.Text = name;
            t3.Text = Class;
            c1.Text = Strategy;
            t5.Text = price.ToString();
            Price   = price.ToString();

            storeNumber = sNumber;
        }
Example #9
0
 public MainWindow()
 {
     WindowStartupLocation = WindowStartupLocation.CenterScreen;
     InitializeComponent();
     dgl = TransDGL.GetInstance();
 }