Added confimation dialogues for deleting parts/products; Finished implementing Product class methods; Propogating part modifications to associated products; Stopped deleting of items if there is an association;
36 lines
816 B
C#
36 lines
816 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace C968Project
|
|
{
|
|
static class Helpers
|
|
{
|
|
public static void SetTextBoxValidationState(TextBox textBox, bool isValid)
|
|
{
|
|
if (isValid)
|
|
{
|
|
textBox.BackColor = Color.White;
|
|
}
|
|
else
|
|
{
|
|
textBox.BackColor = Color.Red;
|
|
}
|
|
}
|
|
|
|
public static bool ConfirmDelete()
|
|
{
|
|
var result = MessageBox.Show("Are you sure you want to delete this item?", "", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
|
|
|
|
if (result == DialogResult.Yes)
|
|
{
|
|
return true;
|
|
}
|
|
|
|
return false;
|
|
}
|
|
}
|
|
}
|