Exemplo n.º 1
0
        void AppState_BusyComplete(object sender, EventArgs e)
        {
            StopwatchService.StopWatch(_performanceWatchTimerId);

            NewRelicBrowserAgentHelper.InlineHit(new NewRelicInlineHitCommand("EmployeeView")
            {
                FeTime      = StopwatchService.Elapsed(_performanceWatchTimerId),
                TotalBeTime = StopwatchService.Elapsed(_performanceWatchTimerId + "_TotalBeTime"),
            });

            GSPApplicationService.Current.AppState.BusyComplete -= AppState_BusyComplete;
        }
Exemplo n.º 2
0
        private void LoadEmployee(int employeeId, DateTime?searchDate, Action action)
        {
            var query = new QueryEmployeeById
            {
                EmployeeId             = employeeId,
                BetweenStartAndEndDate = searchDate
            };

            StopwatchService.StartWatch(_performanceWatchTimerId + "_TotalBeTime");

            // Reload employee from server
            EmployeeService.GetEmployee(query, (res, err) =>
            {
                StopwatchService.StopWatch(_performanceWatchTimerId + "_TotalBeTime");

                if (err.HasErrors)
                {
                    if (err.ApiErrorMessage == "NoAccess")
                    {
                        //Thread.CurrentThread.CurrentCulture = new CultureInfo(GSPApplicationService.Current.CurrentLangId);
                        //Thread.CurrentThread.CurrentUICulture = new CultureInfo(GSPApplicationService.Current.CurrentLangId);
                        var dialogMessage = string.Format(UIResources.Resources.Global_NoAccessMessge, UIResources.Resources.Global_Employee);
                        ThreadHelper.ExecuteOnUI(
                            () => Dialog.ShowDialog(UIResources.Resources.Global_NoAccessTitle, dialogMessage, false, null));
                        GspNavigation.CloseView("EmployeeView", ViewId);
                    }
                    return;
                }
                ThreadHelper.ExecuteOnUI(() =>
                {
                    Employee = res;
                    LoadChildViewmodels();
                    action.Invoke();
                });
            });
        }