Ejemplo n.º 1
0
        private void MProdCancelButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            Mainscreen q = new Mainscreen();

            q.Show();
        }
Ejemplo n.º 2
0
        private void MProdSaveButton_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(MProdInventoryTextBox.Text) < Convert.ToInt32(MProdMinTextBox.Text) ||
                Convert.ToInt32(MProdInventoryTextBox.Text) > Convert.ToInt32(MProdMaxTextBox.Text))
            {
                MessageBox.Show("Inventory is out of range.", "Error");
                return;
            }
            if (Convert.ToInt32(MProdMaxTextBox.Text) < Convert.ToInt32(MProdMinTextBox.Text))
            {
                MessageBox.Show("Your min value must be less than the max value.", "Error");
            }
            else
            {
                Inventory.CurrentProduct.ProductID = Int32.Parse(MProdIDTextBox.Text);
                Inventory.CurrentProduct.Name      = MProdNameTextBox.Text;
                Inventory.CurrentProduct.InStock   = Int32.Parse(MProdInventoryTextBox.Text);
                Inventory.CurrentProduct.Price     = Decimal.Parse(MProdPriceTextBox.Text);
                Inventory.CurrentProduct.Max       = Int32.Parse(MProdMaxTextBox.Text);
                Inventory.CurrentProduct.Min       = Int32.Parse(MProdMinTextBox.Text);

                Inventory.UpdateProduct(Convert.ToInt32(Inventory.CurrProductIndex), Inventory.CurrentProduct);
                this.Hide();
                Mainscreen p = new Mainscreen();
                p.Show();
            }
        }
Ejemplo n.º 3
0
        private void APCancelButton_Click(object sender, EventArgs e)
        {
            Close();
            Mainscreen p = new Mainscreen();

            p.Show();
        }
Ejemplo n.º 4
0
        private void MPSaveButton_Click(object sender, EventArgs e)
        {
            InhousePart    IP = new InhousePart();
            OutsourcedPart OP = new OutsourcedPart();

            if (Convert.ToInt32(MPInventoryTextBox.Text) < Convert.ToInt32(MPMinTextBox.Text) ||
                Convert.ToInt32(MPInventoryTextBox.Text) > Convert.ToInt32(MPMaxTextBox.Text))
            {
                MessageBox.Show("Inventory is out of range.", "Error");
                return;
            }
            if (Convert.ToInt32(MPMaxTextBox.Text) > Convert.ToInt32(MPMinTextBox.Text))
            {
                if (MPInhouseRadio.Checked)
                {
                    IP.PartID    = Int32.Parse(MPIDTextBox.Text);
                    IP.Name      = MPNameTextBox.Text;
                    IP.InStock   = Int32.Parse(MPInventoryTextBox.Text);
                    IP.Price     = Decimal.Parse(MPPriceTextBox.Text);
                    IP.Max       = Int32.Parse(MPMaxTextBox.Text);
                    IP.Min       = Int32.Parse(MPMinTextBox.Text);
                    IP.MachineID = Int32.Parse(MPMachineIDTextBox.Text);

                    Inventory.UpdatePart(Convert.ToInt32(IP.PartID), IP);
                }
                else
                {
                    OP.PartID      = Int32.Parse(MPIDTextBox.Text);
                    OP.Name        = MPNameTextBox.Text;
                    OP.InStock     = Int32.Parse(MPInventoryTextBox.Text);
                    OP.Price       = Decimal.Parse(MPPriceTextBox.Text);
                    OP.Max         = Int32.Parse(MPMaxTextBox.Text);
                    OP.Min         = Int32.Parse(MPMinTextBox.Text);
                    OP.CompanyName = (MPMachineIDTextBox.Text);

                    Inventory.UpdatePart(Convert.ToInt32(OP.PartID), OP);
                }

                Inventory.DeletePart(Inventory.CurrentPart);

                this.Hide();
                Mainscreen o = new Mainscreen();
                o.Show();
            }
            else
            {
                MessageBox.Show("Your min value is greater than the max value.", "Error");
            }
        }
Ejemplo n.º 5
0
        private void APSaveButton_Click(object sender, EventArgs e)
        {
            if (Convert.ToInt32(APInventoryTextBox.Text) < Convert.ToInt32(APMinTextBox.Text) ||
                Convert.ToInt32(APInventoryTextBox.Text) > Convert.ToInt32(APMaxTextBox.Text))
            {
                MessageBox.Show("Inventory is out of range.", "Error");
                return;
            }
            if (Convert.ToInt32(APMaxTextBox.Text) > Convert.ToInt32(APMinTextBox.Text))
            {
                if (APInhouseRadio.Checked)
                {
                    InhousePart newIPart = new InhousePart();
                    newIPart.PartID    = Inventory.createPartID();
                    newIPart.Name      = APNameTextBox.Text;
                    newIPart.InStock   = Int32.Parse(APInventoryTextBox.Text);
                    newIPart.Price     = Decimal.Parse(APPriceTextBox.Text);
                    newIPart.Max       = Int32.Parse(APMaxTextBox.Text);
                    newIPart.Min       = Int32.Parse(APMinTextBox.Text);
                    newIPart.MachineID = Int32.Parse(APMachineIDTextBox.Text);
                    Inventory.AddPart(newIPart);
                }
                else
                {
                    OutsourcedPart newOPart = new OutsourcedPart();
                    newOPart.PartID      = Inventory.createPartID();
                    newOPart.Name        = APNameTextBox.Text;
                    newOPart.InStock     = Int32.Parse(APInventoryTextBox.Text);
                    newOPart.Price       = Decimal.Parse(APPriceTextBox.Text);
                    newOPart.Max         = Int32.Parse(APMaxTextBox.Text);
                    newOPart.Min         = Int32.Parse(APMinTextBox.Text);
                    newOPart.CompanyName = (APMachineIDTextBox.Text);
                    Inventory.AddPart(newOPart);
                }
            }

            else
            {
                MessageBox.Show("Your min value is greater than the max value.", "Error");
                return;
            }


            Close();
            Mainscreen p = new Mainscreen();

            p.Show();
        }