2 using System.Collections.Generic;
3 using System.ComponentModel;
8 using System.Windows.Forms;
10 namespace SeciControls
14 private DataSet
_data =
new DataSet();
27 for (
int i = 0; i < oldUsers.GetLength(0); ++i)
38 if (String.IsNullOrEmpty(
oldUsers[i, 2]))
59 newUsers =
new String[dgv1.Rows.Count, 3];
60 for (
int i = 0; i < dgv1.Rows.Count; ++i)
62 if (
dgv1.Rows[i].Cells[0].Value != null)
newUsers[i, 0] = dgv1.Rows[i].Cells[0].Value.ToString();
63 if (
dgv1.Rows[i].Cells[1].Value != null)
newUsers[i, 1] = dgv1.Rows[i].Cells[1].Value.ToString();
64 if (
dgv1.Rows[i].Cells[2].Value != null)
newUsers[i, 2] = dgv1.Rows[i].Cells[2].Value.ToString();
67 DialogResult = DialogResult.OK;
77 for (
int i = 0; i < dgv1.Rows.Count; ++i)
79 if (
dgv1.Rows[i].Cells[2].Value == null)
continue;
81 if (
dgv1.Rows[i].Cells[2].Value.ToString() ==
"PI")
85 else if (
dgv1.Rows[i].Cells[2].Value.ToString() ==
"Contact")
91 if (ContactCount > 1 || PICount > 1)
93 MessageBox.Show(
"There MUST be only one contact and PI for an experiment.",
"Invalid", MessageBoxButtons.OK, MessageBoxIcon.Error);
102 DialogResult = DialogResult.Cancel;
108 dgv1.Rows.Add(
"",
"",
"User");
113 if (
dgv1.SelectedRows.Count > 0)
115 dgv1.Rows.RemoveAt(dgv1.SelectedRows[0].Index);
void InitializeComponent()
Required method for Designer support - do not modify the contents of this method with the code editor...
void btnCancel_Click(object sender, EventArgs e)
System.Windows.Forms.DataGridView dgv1
void btnDelete_Click(object sender, EventArgs e)
void btnOK_Click(object sender, EventArgs e)
void EnterUser_Load(object sender, EventArgs e)
void btnAdd_Click(object sender, EventArgs e)