private void btnEdit_Click(object sender, RoutedEventArgs e) { if (masterRecord == null) { return; } CWAddGLOffsetAccountTemplate childWindow = new CWAddGLOffsetAccountTemplate(masterRecord.Name); childWindow.Closing += async delegate { if (childWindow.DialogResult == true) { masterRecord._Name = childWindow.offSetAccountName; busyIndicator.IsBusy = true; var err = await api.Update(masterRecord); busyIndicator.IsBusy = false; if (err != ErrorCodes.Succes) { UtilDisplay.ShowErrorCode(err); } } }; childWindow.Show(); }
private void btnAdd_Click(object sender, RoutedEventArgs e) { CWAddGLOffsetAccountTemplate childWindow = new CWAddGLOffsetAccountTemplate(null); childWindow.Closing += async delegate { if (childWindow.DialogResult == true) { var offsetAccTemp = new GLOffsetAccountTemplateClient(); offsetAccTemp._Name = childWindow.offSetAccountName; busyIndicator.IsBusy = true; var res = await api.Insert(offsetAccTemp); busyIndicator.IsBusy = false; if (res != ErrorCodes.Succes) { UtilDisplay.ShowErrorCode(res); } else { GlOffSetAccTemList.Add(offsetAccTemp); } } }; childWindow.Show(); }