public static bool CheckClientProducts1(string clientid) { List <ClientProducts> clientProducts = ClientProducts.GetCP(); foreach (ClientProducts item in clientProducts) { if (item.ClientID == clientid) { return(true); } } return(false); }
public static bool CheckClientProducts(string clientid) { List <ClientProducts> clientProducts = ClientProducts.GetCP(); foreach (ClientProducts item in clientProducts) { if (item.ClientID == clientid) { MessageBox.Show("Client already has a contract. Only one contract is allowed per client.", "", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); return(true); } } return(false); }