Beispiel #1
0
        private void LoadKhu()
        {
            int  i         = 0;
            bool isUpdow   = mListKhu.Count > (NUM_OF_KHU + 2) ? true : false;
            int  numOfItem = mListKhu.Count;

            if (isUpdow)
            {
                numOfItem = mListKhu.Count - mCurrentPage;
                numOfItem = numOfItem < NUM_OF_KHU ? numOfItem : NUM_OF_KHU;
            }
            gridListArea.Children.Clear();
            if (isUpdow)
            {
                POSButtonTableArea btnUp = new POSButtonTableArea();
                btnUp.Content = "Lên";
                Grid.SetRow(btnUp, i);
                btnUp.Image = new BitmapImage(new Uri(@"/SystemImages;component/Images/Up.png", UriKind.Relative));
                gridListArea.Children.Add(btnUp);
                btnUp.Click += new RoutedEventHandler(btnUp_Click);
                i++;
            }
            for (int j = 0; j < numOfItem; j++)
            {
                Data.KHU           item = mListKhu[mCurrentPage + j];
                POSButtonTableArea btn  = new POSButtonTableArea();
                btn.Content = item.TenKhu;
                Grid.SetRow(btn, i);
                btn.SetTableClicked((bool)item.MacDinhSoDoBan);
                if ((bool)item.MacDinhSoDoBan)
                {
                    mPOSButtonTableArea = btn;
                    if (_UCFloorPlan != null)
                    {
                        _UCFloorPlan.LoadTable(item);
                    }
                }
                btn._Khu   = item;
                btn.Margin = new Thickness(5, 5, 5, 5);
                btn.Image  = Utilities.ImageHandler.BitmapImageFromByteArray(item.Hinh);
                btn.Click += new RoutedEventHandler(btn_Click);
                gridListArea.Children.Add(btn);
                i++;
            }
            if (isUpdow)
            {
                POSButtonTableArea btnDow = new POSButtonTableArea();
                btnDow.Content = "Xuống";
                Grid.SetRow(btnDow, 6);
                btnDow.Image  = new BitmapImage(new Uri(@"/SystemImages;component/Images/Down.png", UriKind.Relative));
                btnDow.Click += new RoutedEventHandler(btnDow_Click);
                gridListArea.Children.Add(btnDow);
            }
        }
 private void LoadKhu()
 {
     int i = 0;
     bool isUpdow = mListKhu.Count > (NUM_OF_KHU + 2) ? true : false;
     int numOfItem=mListKhu.Count;
     if (isUpdow)
     {
         numOfItem = mListKhu.Count - mCurrentPage;
         numOfItem= numOfItem < NUM_OF_KHU ? numOfItem : NUM_OF_KHU;
     }            
     gridListArea.Children.Clear();
     if (isUpdow)
     {
         POSButtonTableArea btnUp = new POSButtonTableArea();
         btnUp.Content = "Lên";
         Grid.SetRow(btnUp, i);
         btnUp.Image = new BitmapImage(new Uri(@"/SystemImages;component/Images/Up.png", UriKind.Relative));
         gridListArea.Children.Add(btnUp);
         btnUp.Click += new RoutedEventHandler(btnUp_Click);
         i++;
     }
     for (int j=0; j < numOfItem; j++)
     {
         Data.KHU item = mListKhu[mCurrentPage+j];
         POSButtonTableArea btn = new POSButtonTableArea();
         btn.Content = item.TenKhu;
         Grid.SetRow(btn, i);
         btn.SetTableClicked((bool)item.MacDinhSoDoBan);                
         if ((bool)item.MacDinhSoDoBan)
         {
             mPOSButtonTableArea = btn;
             if (_UCFloorPlan != null)
             {
                 _UCFloorPlan.LoadTable(item);
             }
         }
         btn._Khu = item;
         btn.Margin = new Thickness(5, 5, 5, 5);
         btn.Image = Utilities.ImageHandler.BitmapImageFromByteArray(item.Hinh);
         btn.Click += new RoutedEventHandler(btn_Click);
         gridListArea.Children.Add(btn);
         i++;
     }
     if (isUpdow)
     {
         POSButtonTableArea btnDow = new POSButtonTableArea();
         btnDow.Content = "Xuống";
         Grid.SetRow(btnDow, 6);
         btnDow.Image = new BitmapImage(new Uri(@"/SystemImages;component/Images/Down.png", UriKind.Relative));
         btnDow.Click += new RoutedEventHandler(btnDow_Click);
         gridListArea.Children.Add(btnDow);
     }
 }
Beispiel #3
0
        void btn_Click(object sender, RoutedEventArgs e)
        {
            if (mPOSButtonTableArea != null)
            {
                mPOSButtonTableArea._Khu.MacDinhSoDoBan = false;
                mPOSButtonTableArea.SetTableClicked(false);
            }
            POSButtonTableArea btn = (POSButtonTableArea)sender;

            mPOSButtonTableArea = btn;
            mTransit.Khu        = mPOSButtonTableArea._Khu;
            btn.SetTableClicked(true);
            if (_UCFloorPlan != null)
            {
                _UCFloorPlan.LoadTable(btn._Khu);
            }
        }
 void btn_Click(object sender, RoutedEventArgs e)
 {
     if (mPOSButtonTableArea!=null)
     {
         mPOSButtonTableArea._Khu.MacDinhSoDoBan = false;
         mPOSButtonTableArea.SetTableClicked(false);
     }
     POSButtonTableArea btn = (POSButtonTableArea)sender;
     mPOSButtonTableArea = btn;
     mTransit.Khu = mPOSButtonTableArea._Khu;
     btn.SetTableClicked(true);
     if (_UCFloorPlan!=null)
     {
         _UCFloorPlan.LoadTable(btn._Khu);              
     }
 }