Exemplo n.º 1
0
        private void CheckIfExist(PrepAndPaintModel newJob)
        {
            List <PrepAndPaintModel> prepAndPaintModels = PrepAndPaintDB.GetNewData();

            foreach (var item in prepAndPaintModels)
            {
                if (item.JobNumber == newJob.JobNumber && item.BodyOrDoors == newJob.BodyOrDoors)
                {
                    MessageBox.Show($"Item: {newJob.BodyOrDoors} already exist for Job# {newJob.JobNumber} in the database!",
                                    "Entry Exist!", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    return;
                }
            }
            PrepAndPaintDB.AddnewJob(newJob);
            jobId        = newJob.Id;
            DialogResult = DialogResult.OK;
            Close();
        }