예제 #1
0
        private TabPage AddTab(TabPage sTab)
        {
            //Set up an accessory for the tab
            Accessory tempa = new Accessory();

            //Our selected tab
            //Add our labels
            sTab.Controls.Add(CreateDisplay.CreateLabel("Part Name", new Point(37, 38)));
            sTab.Controls.Add(CreateDisplay.CreateLabel("Part Number", new Point(37, 100)));
            sTab.Controls.Add(CreateDisplay.CreateLabel("Serial Number", new Point(37, 163)));
            sTab.Controls.Add(CreateDisplay.CreateLabel("Process", new Point(37, 221)));
            sTab.Controls.Add(CreateDisplay.CreateLabel("Price", new Point(37, 283)));

            //Add our boxes
            ComboBox _pNameBox = CreateDisplay.CreateComboBox(pNameList, new Point(525, 38), "Parts Name List");

            _pNameBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _pNameBox.Text, "Name");
            TextBox _pNumBox = CreateDisplay.CreateTextBox("", new Point(525, 100));

            _pNumBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _pNumBox.Text, "Number");
            TextBox _pSerialBox = CreateDisplay.CreateTextBox("", new Point(525, 163));

            _pSerialBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _pSerialBox.Text, "Serial");
            ComboBox _processBox = CreateDisplay.CreateComboBox(processList, new Point(525, 221), "Process List");

            _processBox.SelectedIndex = 0;
            tempa.Process             = _processBox.Text;
            _processBox.TextChanged  += (sender2, e2) => TBoxTextChanged(sender2, e2, _processBox.Text, "Process");
            TextBox _priceBox = CreateDisplay.CreateTextBox("", new Point(525, 283));

            _priceBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _priceBox.Text, "Price");

            sTab.Controls.Add(_pNameBox);
            sTab.Controls.Add(_pNumBox);
            sTab.Controls.Add(_pSerialBox);
            sTab.Controls.Add(_processBox);
            sTab.Controls.Add(_priceBox);

            _accList.Add(tempa);

            return(sTab);
        }
예제 #2
0
        public void Setup_Work_Order_Edit()
        {
            _editWOTabs = new TabControl()
            {
                Location = new Point(27, 73),
                Size     = new Size(738, 360),
                Name     = "EditWOTabControl",
                Visible  = false,
            };

            //Set up some initial variables
            _cuName  = _curWOList[0].Customer_Name;
            _poNum   = _curWOList[0].Purchase_Order_Number;
            _invDate = _curWOList[0].Inventoried_Date;
            _date    = _curWOList[0].Date_Entered;

            GetInfoFromWOForm(_cuName, _woNum);


            //Now lets create our first tab page which will contain our miscellaneous variables to edit
            TabPage firstTab = CreateTab("Primary");

            #region LabelCreation
            firstTab.Controls.Add(new Label()
            {
                Location = new Point(31, 31),
                AutoSize = true,
                Text     = "Work Order Number: " + _curWOList[0].Work_Order_Number,
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            firstTab.Controls.Add(new Label()
            {
                Location = new Point(388, 31),
                AutoSize = true,
                Text     = "Date Created: " + _curWOList[0].Date_Entered,
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            firstTab.Controls.Add(new Label()
            {
                Location = new Point(31, 88),
                AutoSize = true,
                Text     = "Customer: ",
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            firstTab.Controls.Add(new Label()
            {
                Location = new Point(392, 88),
                AutoSize = true,
                Text     = _cuName,
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            firstTab.Controls.Add(new Label()
            {
                Location = new Point(31, 148),
                AutoSize = true,
                Text     = "Purchase Order Number: ",
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            firstTab.Controls.Add(new Label()
            {
                Location = new Point(31, 210),
                AutoSize = true,
                Text     = "Inventoried Date: ",
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });
            #endregion

            #region BoxCreation

            TextBox PONumBox = new TextBox()
            {
                Location = new Point(392, 151),
                Size     = new Size(271, 20),
                Text     = _poNum,
                Name     = "PurchaseOrderNumberBox"
            };
            PONumBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, PONumBox.Text, "PONum");

            TextBox InvenDate = new TextBox()
            {
                Location = new Point(392, 213),
                Size     = new Size(271, 20),
                Text     = _invDate,
                Name     = "InventoriedDateBox"
            };
            InvenDate.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, InvenDate.Text, "InvDate");


            firstTab.Controls.Add(PONumBox);
            firstTab.Controls.Add(InvenDate);
            #endregion

            _editWOTabs.Controls.Add(firstTab);

            TabPage secondTab = CreateTab("Fuel");

            #region LabelCreation
            secondTab.Controls.Add(new Label()
            {
                Location = new Point(20, 36),
                AutoSize = true,
                Text     = "Number of Fuel Lines: ",
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            secondTab.Controls.Add(new Label()
            {
                Location = new Point(20, 84),
                AutoSize = true,
                Text     = "Number of Fuel Nozzles: ",
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            secondTab.Controls.Add(new Label()
            {
                Location = new Point(20, 133),
                AutoSize = true,
                Text     = "Fuel Nozzles Number: ",
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            secondTab.Controls.Add(new Label()
            {
                Location = new Point(20, 185),
                AutoSize = true,
                Text     = "Fuel System Engine Number: ",
                Font     = new Font("Verdana", 14.25f, FontStyle.Bold)
            });

            secondTab.Controls.Add(new Label()
            {
                Location = new Point(136, 259),
                AutoSize = true,
                Text     = "Leave these fields blank to not have them included in the Work Order\nFor Fuel System Engine Number, type NoNumber to tell the program to\nhave aComplete Fuel System field without an Engine Number",
                Font     = new Font("Verdana", 10.25f, FontStyle.Italic)
            });
            #endregion

            #region BoxCreation
            TextBox FLines = new TextBox()
            {
                Location = new Point(412, 39),
                Size     = new Size(226, 20),
                Text     = _fuelLines,
                Name     = "FuelLinesBox"
            };

            FLines.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, FLines.Text, "FuelLines");

            TextBox FNozzles = new TextBox()
            {
                Location = new Point(412, 87),
                Size     = new Size(226, 20),
                Text     = _fuelNozzles,
                Name     = "FuelNozzlesBox"
            };

            FNozzles.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, FNozzles.Text, "FuelNozzles");

            TextBox FNozzlesNum = new TextBox()
            {
                Location = new Point(412, 136),
                Size     = new Size(226, 20),
                Text     = _nozzlesNum,
                Name     = "NozzlesNumberBox"
            };

            FNozzlesNum.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, FNozzlesNum.Text, "NozzlesNumber");

            TextBox EngineNum = new TextBox()
            {
                Location = new Point(412, 188),
                Size     = new Size(226, 20),
                Text     = _engineNum,
                Name     = "EngineNumberBoxs"
            };

            EngineNum.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, EngineNum.Text, "EngineNumber");

            secondTab.Controls.Add(FLines);
            secondTab.Controls.Add(FNozzles);
            secondTab.Controls.Add(FNozzlesNum);
            secondTab.Controls.Add(EngineNum);

            #endregion

            _editWOTabs.Controls.Add(secondTab);


            _editWOTabs.Visible = true;
            //Create/add our tabs according to our _curWOList List Variable
            for (int index = 0; index < _curWOList.Count; index++)
            {
                //Set up an accessory for the tab
                Accessory tempa = new Accessory(_curWOList[index].Get_Accessory.Part_Name,
                                                _curWOList[index].Get_Accessory.Part_Number,
                                                _curWOList[index].Get_Accessory.Part_Serial_Number,
                                                _curWOList[index].Get_Accessory.Process);

                //Our selected tab
                TabPage sTab = CreateTab(tempa.Part_Name);
                //Add our labels
                sTab.Controls.Add(CreateDisplay.CreateLabel("Part Name", new Point(37, 38)));
                sTab.Controls.Add(CreateDisplay.CreateLabel("Part Number", new Point(37, 100)));
                sTab.Controls.Add(CreateDisplay.CreateLabel("Serial Number", new Point(37, 163)));
                sTab.Controls.Add(CreateDisplay.CreateLabel("Process", new Point(37, 221)));
                sTab.Controls.Add(CreateDisplay.CreateLabel("Price", new Point(37, 283)));

                //Add our boxes
                ComboBox _pNameBox = CreateDisplay.CreateComboBox(pNameList, new Point(525, 38), "Parts Name List");
                _pNameBox.SelectedText = CreateDisplay.ReCapsString(_accList[index].Part_Name);
                _pNameBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _pNameBox.Text, "Name");
                TextBox _pNumBox = CreateDisplay.CreateTextBox(tempa.Part_Number, new Point(525, 100));
                _pNumBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _pNumBox.Text, "Number");
                TextBox _pSerialBox = CreateDisplay.CreateTextBox(tempa.Part_Serial_Number, new Point(525, 163));
                _pSerialBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _pSerialBox.Text, "Serial");
                ComboBox _processBox = CreateDisplay.CreateComboBox(processList, new Point(525, 221), "Process List");
                _processBox.SelectedText = _accList[index].Process;
                _processBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _processBox.Text, "Process");
                TextBox _priceBox = CreateDisplay.CreateTextBox(_accList[index].Price, new Point(525, 283));
                _priceBox.TextChanged += (sender2, e2) => TBoxTextChanged(sender2, e2, _priceBox.Text, "Price");

                sTab.Controls.Add(_pNameBox);
                sTab.Controls.Add(_pNumBox);
                sTab.Controls.Add(_pSerialBox);
                sTab.Controls.Add(_processBox);
                sTab.Controls.Add(_priceBox);


                _editWOTabs.TabPages.Add(sTab);
            }
            Button editWOButton = new Button()
            {
                Size     = new Size(285, 28),
                Location = new Point(275, 450),
                Text     = "Submit Edited Work Order",
                Name     = "EditWOButton"
            };
            editWOButton.Click += new EventHandler(SubmitEdits);
            _editWOPanel.Controls.Add(editWOButton);
            _editWOPanel.Controls.Add(_editWOTabs);
        }