Merge branch 'master' into feature_rene_17_xrechnung
This commit is contained in:
@@ -633,8 +633,8 @@ namespace BeWo
|
||||
//showInfoButtonInCalender = true;
|
||||
//IsInDeveloperMode = true;
|
||||
//IsInDeveloperMode = false;
|
||||
AppSettings.ModuleAiEnabled = true;
|
||||
AppSettings.ModuleAiSettingsEnabled = false;
|
||||
//AppSettings.ModuleAiEnabled = true;
|
||||
//AppSettings.ModuleAiSettingsEnabled = false;
|
||||
AppSettings.IsSchedulerAllowed = true;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,11 +14,11 @@ namespace BeWo.Core.Commands
|
||||
public static DelegateCommand GetAiViewCommand(Action openView, UserRightType userRightType, Func<bool> additionalCheckup = null)
|
||||
{
|
||||
bool canExecute() =>
|
||||
BeWoApp.AppSettings.ModuleAiEnabled &&
|
||||
(BeWoApp.AppSettings?.ModuleAiEnabled ?? false) &&
|
||||
BeWoApp.HasLoggedOnUserRight(userRightType) &&
|
||||
(additionalCheckup is null || additionalCheckup());
|
||||
|
||||
return GetTestClientCommand(openView, canExecute, false);
|
||||
return GetTestClientCommand(openView, () => CheckupSafe(canExecute), null);
|
||||
}
|
||||
|
||||
public static DelegateCommand GetTestClientCommand(Action action, Func<bool> canExecute = null, bool? useCommandManager = null)
|
||||
@@ -27,7 +27,19 @@ namespace BeWo.Core.Commands
|
||||
CheckupTestVersion() &&
|
||||
(canExecute is null || canExecute());
|
||||
|
||||
return new DelegateCommand(action, canExecute2, useCommandManager);
|
||||
return new DelegateCommand(action, () => CheckupSafe(canExecute2), useCommandManager);
|
||||
}
|
||||
|
||||
private static bool CheckupSafe(Func<bool> predicate)
|
||||
{
|
||||
try
|
||||
{
|
||||
return predicate();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private static bool CheckupTestVersion()
|
||||
|
||||
@@ -350,21 +350,11 @@ namespace BeWo.View.Detail.Zeiterfassung
|
||||
|
||||
OpenAiWindowCommand = CommandFactory.GetAiViewCommand(OpenAiWindow, UserRightType.AiModuleView);
|
||||
OpenAiPopupCommand = CommandFactory.GetAiViewCommand(OpenAiPopup, UserRightType.AiModuleView2);
|
||||
|
||||
if (!BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleView))
|
||||
{
|
||||
btnOpenAi2.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
if (!BeWoApp.HasLoggedOnUserRight(UserRightType.AiModuleView2))
|
||||
{
|
||||
btnOpenAi3.Visibility = Visibility.Collapsed;
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand OpenAiWindowCommand { get; set; }
|
||||
public ICommand OpenAiPopupCommand { get; set; }
|
||||
|
||||
|
||||
private void SrGridControl_ItemsSourceChanged(object sender, DevExpress.Xpf.Grid.ItemsSourceChangedEventArgs e)
|
||||
{
|
||||
ErstelleRecordInformationString();
|
||||
|
||||
@@ -506,7 +506,9 @@ namespace BeWo.View.Navigation
|
||||
|
||||
private void OnLoaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
textbox_search.Focus();
|
||||
CommandManager.InvalidateRequerySuggested();
|
||||
|
||||
textbox_search.Focus();
|
||||
}
|
||||
|
||||
private void OnOpenObject()
|
||||
|
||||
Reference in New Issue
Block a user