public void fillEditFields() { cboClientType.SelectedValue = clsVoucher.ClientType.ToString(); dtpTrxDate.Value = clsVoucher.TrxDate; foreach (TextBox tb in tbFamData) { tb.Text = clsVoucher.GetDataValue(tb.Tag.ToString()).ToString(); } foreach (CheckBox chk in chkList) { chk.Checked = (bool)clsVoucher.GetDataValue(chk.Tag.ToString()); } }
public void fillEditFields(string itemDescr) { btnPost.Focus(); //tbVoucherType.Text = clsVoucher.ClientType.ToString(); tbVoucherId.Text = clsVoucher.TrxId.ToString(); tbTrxDate.Text = clsVoucher.TrxDate.ToLongDateString(); // clsVoucher.TrxDate.ToShortDateString(); if (clsVoucher.TrxId > 0) { dtpTrxDate.Value = clsVoucher.TrxDate; } foreach (TextBox tb in pnlDemographics.Controls.OfType <TextBox>()) { tb.Text = clsVoucher.GetDataValue(tb.Tag.ToString()).ToString(); } foreach (CheckBox chk in pnlDemographics.Controls.OfType <CheckBox>()) { chk.Checked = (bool)clsVoucher.GetDataValue(chk.Tag.ToString()); } tbNotes.Text = clsVoucher.Notes; tbVoucherType.Text = itemDescr; cboHHCat.SelectedValue = clsVoucher.ClientType.ToString(); lblAmt.Text = CCFBGlobal.LongNameFromId(CCFBGlobal.parmTbl_VoucherType, clsVItems.VoucherType); oriAmt = clsVoucher.Amount; switch (clsVItems.VoucherType) { case 0: tbQty.Text = clsVoucher.Amount.ToString(); tbQty.Visible = true; break; case 1: tbQty.Text = Convert.ToInt32(clsVoucher.Amount).ToString(); tbQty.Visible = true; break; case 2: tbQty.Text = Convert.ToInt32(clsVoucher.Amount).ToString(); tbQty.Visible = false; break; default: tbQty.Text = clsVoucher.Amount.ToString(); tbQty.Visible = true; break; } }