protected void cboPayTypes_SelectedIndexChanged(object sender, EventArgs e) { try { string paytypecode = cboPayTypes.SelectedValue.ToString(); if (paytypecode.Equals("0")) { Button1.Enabled = false; } else { dataTable = datafile.GetPayTypesByShortName(paytypecode); if (dataTable.Rows.Count > 0) { Button1.Enabled = true; string name = dataTable.Rows[0]["PaymentType"].ToString(); bool Vatable = bool.Parse(dataTable.Rows[0]["Vatable"].ToString()); double amount = double.Parse(dataTable.Rows[0]["Amount"].ToString()); txtamount.Text = amount.ToString("#,##0"); lblvat.Text = Vatable.ToString(); txtpayingfor.Text = name; } else { Button1.Enabled = false; } } } catch (Exception ex) { ShowMessage(ex.Message, true); } }