private void fillForm(int itemKey) { loadingData = true; if (tbID.Text != itemKey.ToString()) { clsSvcItems.find(itemKey); } foreach (TextBox tb in tbList) { tb.Text = clsSvcItems.GetDataValue(tb.Tag.ToString()).ToString(); } foreach (CheckBox chk in chkList) { chk.Checked = clsSvcItems.GetDataValueBool(chk.Tag.ToString()); } cboSvcGrp.SelectedValue = clsSvcItems.DefaultSvcGrp.ToString(); cboRules.SelectedValue = clsSvcItems.ItemRule.ToString(); cboType.SelectedValue = clsSvcItems.ItemType.ToString(); ShowAgeGroupBox(chkLimitByAgeGroups.Checked); lblServiceItems.Text = clsSvcItems.DSet.Tables[0].Rows.Count.ToString() + " Service Items"; grpbxMask.Enabled = false; for (int i = 0; i < chkArray.Length; i++) { chkArray[i].Checked = false; } if (clsSvcItems.ItemRule == CCFBGlobal.itemRule_MaskArray) { grpbxMask.Enabled = true; char[] useForServiceCount = clsSvcItems.Mask.ToCharArray(); for (int i = 0; i < chkArray.Length; i++) { if (useForServiceCount[i] == '1') { chkArray[i].Checked = true; } } } loadingData = false; if (lvServiceItems.SelectedItems.Count > 0) { int iPos = lvServiceItems.SelectedItems[0].Index; btnPrevious.Visible = (iPos > 0); btnNext.Visible = (iPos < lvServiceItems.Items.Count - 1); } else { btnPrevious.Visible = true; btnNext.Visible = true; } tbLbsPerItem.Focus(); }
private void fillForm(int itemKey) { loadingData = true; if (tbID.Text != itemKey.ToString()) { clsSvcItems.find(itemKey); } foreach (TextBox tb in tbList) { tb.Text = clsSvcItems.GetDataValue(tb.Tag.ToString()).ToString(); } foreach (CheckBox chk in chkList) { chk.Checked = clsSvcItems.GetDataValueBool(chk.Tag.ToString()); } cboRules.SelectedValue = clsSvcItems.ItemRule.ToString(); cboType.SelectedValue = clsSvcItems.ItemType.ToString(); ShowAgeGroupBox(chkLimitByAgeGroups.Checked); lblServiceItems.Text = clsSvcItems.DSet.Tables[0].Rows.Count.ToString() + " Service Items"; loadingData = false; if (lvServiceItems.SelectedItems.Count > 0) { int iPos = lvServiceItems.SelectedItems[0].Index; btnPrevious.Visible = (iPos > 0); btnNext.Visible = (iPos < lvServiceItems.Items.Count - 1); } else { btnPrevious.Visible = true; btnNext.Visible = true; } tbLbsPerItem.Focus(); }