Exemplo n.º 1
0
        private void addButton(string ButtonData, string LabelData, string serialnumber = "", string lotnumber = "")
        {
            LabelButton newbtn = new LabelButton();

            newbtn.Width        = 1162;
            newbtn.Height       = 40;
            newbtn.Foreground   = MainWindow.buttonForeground;
            newbtn.Background   = MainWindow.buttonBackground;
            newbtn.Content      = "Printer: " + MainWindow.PrinterComboBox.Text + "  SN:  " + ButtonData;
            newbtn.LabelType    = "FINISHED GOODS";
            newbtn.Printer      = MainWindow.PrinterComboBox.Text;
            newbtn.SerialNumber = serialnumber;
            newbtn.LotNumber    = lotnumber;

            newbtn.SetLabelInfo(LabelData);
            testGrid.Children.Add(newbtn);
            newbtn.Click += newbtn_Click;

            LabelButton rembtn = new LabelButton();

            rembtn.Width        = 40;
            rembtn.Height       = 40;
            rembtn.Foreground   = MainWindow.remButtonColor;
            rembtn.Background   = MainWindow.buttonBackground;
            rembtn.Content      = " X ";
            rembtn.LabelType    = "FINISHED GOODS";
            rembtn.Printer      = MainWindow.PrinterComboBox.Text;
            rembtn.SerialNumber = serialnumber;
            rembtn.LotNumber    = lotnumber;
            rembtn.SetLabelInfo(LabelData);
            remGrid.Children.Add(rembtn);
            rembtn.Click += rembtn_Click;
        }
Exemplo n.º 2
0
        private void rembtn_Click(object sender, RoutedEventArgs e)
        {
            LabelButton btn  = (sender as LabelButton);
            string      info = btn.getInfo();
            int         i    = 0;

            foreach (LabelButton but in remGrid.Children)
            {
                if (but.getInfo() == info)
                {
                    testGrid.Children.RemoveAt(i);
                    break;
                }
                i += 1;
            }
            remGrid.Children.Remove((sender as LabelButton));
        }
Exemplo n.º 3
0
        private void newbtn_Click(object sender, RoutedEventArgs e)
        {
            LabelButton btn  = (sender as LabelButton);
            string      info = btn.getInfo();

            MainWindow.SendToBartender(info, btn.SerialNumber, btn.Printer, btn.LabelType, btn.LotNumber);
            int i = 0;

            foreach (LabelButton but in testGrid.Children)
            {
                if (but.getInfo() == info)
                {
                    remGrid.Children.RemoveAt(i);
                    break;
                }
                i += 1;
            }
            testGrid.Children.Remove((sender as LabelButton));
        }