Esempio n. 1
0
        private void buttonAddNewPart_Click(object sender, EventArgs e)
        {
            AddPartName AddPart = new AddPartName();

            //AddPart partWindow = new AddPart();
            AddPart.ShowDialog();

            if (AddPart.closed)
            {
                int PartId = GCIDB.GetPartID(AddPart.PartName);
                if (PartId == 0)
                {
                    GCIDB.AddPartID(AddPart.PartName);

                    int LifetimeLimitID = GCIDB.AddNewLifetimeLimit(AddPart.PartName, Properties.Settings.Default.LifetimeLimit_DefaultLowerRange, Properties.Settings.Default.LifetimeLimit_DefaultUpperRange);
                    GCIDB.SetLifetimeLimit(AddPart.PartName, LifetimeLimitID);
                    PopulatePartList();
                }
                // else
                //MessageBox.Show("Error partname already exists in database.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            //Console.Write(AddPart.PartName);
        }