コード例 #1
0
		private void AddClaimants(claimantsClass claimcls)
		{
			if (claimantList.Count <= 6)
			{
				claimantList.Add(claimcls);
				claimantsDataGrid.Items.Clear();
				foreach (claimantsClass cls in claimantList)
				{
					claimantsDataGrid.Items.Add(cls);
				}

				claimantID++;
				claimantsLabelCount.Content = claimantList.Count.ToString() + " OF 7";

				ClearEntryClaimant();
			}
			else
			{
				MessageBox.Show("Maximum entries reached!");
			}
		}
コード例 #2
0
		private void AddClaimants(int id, string name, string phone, string address, string guess)
		{
			if (claimantList.Count <= 6)
			{
				//  claimantsClass claimcls = new claimantsClass() { ClaimantName = tbClaimantName.Text, ClaimantPhone = tbClaimantPhone.Text, ClaimantAddress = tbClaimantAddress.Text, ClaimantGuess = tbClaimantGuess.Text };

				claimantsClass claimcls = new claimantsClass() { ID = id, ClaimantName = name, ClaimantPhone = phone, ClaimantAddress = address, ClaimantGuess = guess };
				claimantList.Add(claimcls);

				claimantsDataGrid.Items.Clear();

				foreach (claimantsClass cls in claimantList)
				{
					claimantsDataGrid.Items.Add(cls);
				}

				claimantID++;
				claimantsLabelCount.Content = claimantList.Count.ToString() + " OF 7";

				ClearEntryClaimant();
			}
			else
			{
				MessageBox.Show("Maximum entries reached!");
			}
		}