This commit is contained in:
2022-07-04 17:45:30 +00:00
parent f718b34280
commit d4c163bc93
4 changed files with 38 additions and 0 deletions

View File

@@ -19,6 +19,8 @@ namespace AyaNovaQBI
private void SetQBImportInventoryAccounts_Load(object sender, EventArgs e)
{
btnCancel.Text = util.AyaTranslations["Cancel"];
btnOK.Text = util.AyaTranslations["OK"];
//Fill combo's and select defaults
cbAsset.BindingContext = new BindingContext();//Ensure unique binding context so multiple combo boxes bound to same datasource can be selected independantly
cbAsset.DisplayMember = "FullName";
@@ -41,5 +43,21 @@ namespace AyaNovaQBI
if (!string.IsNullOrEmpty(util.QDat.QBInventoryIncomeAccountReference))
cbIncome.SelectedValue = util.QDat.QBInventoryIncomeAccountReference;
}
private async void btnOK_Click(object sender, EventArgs e)
{
util.QDat.QBInventoryAssetAccountRef = cbAsset.SelectedValue.ToString();
util.QDat.QBInventoryCOGSAccountRef = cbCogs.SelectedValue.ToString();
util.QDat.QBInventoryIncomeAccountReference = cbIncome.SelectedValue.ToString();
await util.SaveIntegrationObject();
DialogResult = DialogResult.OK;
Close();
}
private void btnCancel_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}