Example #1
0
        private void AddPart_Click(object sender, EventArgs e)
        {
            SQL_Commands SQL  = new SQL_Commands(connectionString);
            Parts        part = new Parts();

            if (PartNumber.Text != "" && SerialNumber.Text != "")
            {
                part.PartNumber   = PartNumber.Text;
                part.SerialNumber = SerialNumber.Text;

                SQL.AddToDB(part);
                SQL.AddToDB(part, part.Status);

                if (SQL.PartExists("Query Serial", part))
                {
                    MessageBox.Show("Database updated!", "Successful");
                }

                PartNumber.Text = SerialNumber.Text = "";
            }
            else
            {
                MessageBox.Show("Please make sure all entries are filled before submitting inventory", "Missing Information");
            }
        }
        private void QueryPart_Click(object sender, EventArgs e)
        {
            SQL_Commands SQL  = new SQL_Commands(connectionString);
            Parts        part = new Parts();

            part.PartNumber = PartNumber.Text;

            if (PartNumber.Text != "")
            {
                if (SQL.PartExists("Query Part", part))
                {
                    PartNumber.Text = "";
                    MessageBox.Show("That part is in stock. Proceed with the repair.", "Part Found");
                }
                else
                {
                    MessageBox.Show("That part isn't in stock. Refer customer to a store with that part.", "Part Not Found");
                }
            }
            else
            {
                MessageBox.Show("You must enter a part number!", "Warning");
            }
        }
Example #3
0
        private void Submit_Click(object sender, EventArgs e)
        {
            SQL_Commands SQL  = new SQL_Commands(connectionString);
            Parts        part = new Parts();

            part.PartNumber   = PartNumber.Text;
            part.SerialNumber = SerialNumber.Text;
            part.Status       = Status.Text;


            if (TechName.Enabled && TechName.Text != "" && PartNumber.Text != "" && SerialNumber.Text != "" && Status.Text != "(Select a status)")
            {
                part.TechName = TechName.Text;
                SQL.PostConsumtion(part);

                PartNumber.Text   = "";
                SerialNumber.Text = "";
                Status.Text       = "(Select a status)";

                TechName.Text    = "";
                tech.Visible     = false;
                TechName.Enabled = TechName.Visible = false;
            }
            else if (PartNumber.Text != "" && SerialNumber.Text != "" && Status.Text != "(Select a status)")
            {
                SQL.PostConsumtion(part);

                PartNumber.Text   = "";
                SerialNumber.Text = "";
                Status.Text       = "(Select a status)";
            }
            else
            {
                MessageBox.Show("Please make sure all entries are filled before submitting inventory", "Missing Information");
            }
        }