Bug fix: disable combo on no record

This commit is contained in:
2020-03-24 13:54:10 +00:00
parent 0b713314fe
commit 38b9508112

View File

@@ -78,9 +78,20 @@ namespace BealeEngineering.Accounts
private void cmbInvoicePick_SelectedIndexChanged(object sender, EventArgs e)
{
var invoiceHeader = (Core.Model.Sale.InvoiceHeader)cmbInvoicePick.SelectedItem;
txtInvoiceContact.Text = invoiceHeader.ContactName;
txtInvoiceNetAmount.Text = (invoiceHeader.InvoiceTotal - invoiceHeader.TaxTotal).ToString("F") + " " + invoiceHeader.CurrencyCode;
txtInvoiceStatus.Text = invoiceHeader.Status;
if (invoiceHeader != null)
{
cmbInvoicePick.Enabled = true;
txtInvoiceContact.Text = invoiceHeader.ContactName;
txtInvoiceNetAmount.Text = (invoiceHeader.InvoiceTotal - invoiceHeader.TaxTotal).ToString("F") + " " + invoiceHeader.CurrencyCode;
txtInvoiceStatus.Text = invoiceHeader.Status;
}
else
{
cmbInvoicePick.Enabled = false;
txtInvoiceContact.Text = "";
txtInvoiceNetAmount.Text = "";
txtInvoiceStatus.Text = "";
}
}
private void UpdateInvoiceCombo()