c968-wgu-project/C968Project/Helpers.cs
chrisbell ef65598a4d Main Screen fixes
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;
2025-05-15 13:31:08 -05:00

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;
}
}
}