private void LoadForm(string PayTypeCode) { dtable = datafile.GetPayTypeByCode(PayTypeCode); if (dtable.Rows.Count > 0) { CallPayTypeform(); lblcode.Text = dtable.Rows[0]["PaymentCode"].ToString(); txtcode.Text = dtable.Rows[0]["PaymentCode"].ToString(); txtshortname.Text = dtable.Rows[0]["ShortName"].ToString(); txtname.Text = dtable.Rows[0]["PaymentType"].ToString(); double amount = double.Parse(dtable.Rows[0]["Amount"].ToString()); bool Isactive = bool.Parse(dtable.Rows[0]["Active"].ToString()); bool IsVat = bool.Parse(dtable.Rows[0]["Vatable"].ToString()); bool IsRef = bool.Parse(dtable.Rows[0]["Referenced"].ToString()); txtAmount.Text = amount.ToString("#,##0"); chkActive.Checked = Isactive; chkvat.Checked = IsVat; chkRef.Checked = IsRef; txtcode.Enabled = false; txtshortname.Enabled = false; } }