void FindWorkerCompleted(object sender, FindWorkerCompletedEventArgs e) { if (e.Error == null) { update = false; Worker = e.Result; WorkerTours = Functionality.CloneCollection(Worker.Tours); Description = Worker.Description; FirstName = Worker.FirstName; LastName = Worker.LastName; PersonalEmail = Worker.PersonalEmail; PersonalPhone = Worker.PersonalPhone; SapNumber = Worker.SapNumber; ServiceEmail = Worker.ServiceEmail; ServiceNumber = Worker.ServiceNumber; ServicePhone = Worker.ServicePhone; Photo = PhotoConvert(worker.Photo); SelectedTour = null; SelectedWorkerTour = null; Enabled = false; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.FindWorkerCompleted -= FindWorkerCompleted; Busy = false; }
void GetDetachmentsCompleted(object sender, GetDetachmentsCompletedEventArgs e) { if (e.Error == null) { Detachments = e.Result; SelectedDetachment = Detachments.FirstOrDefault(c => c.ID == LoginInit.user.DetachmentID); if (LoginInit.user.Roles.Any(c => c.Name == "Master")) { Visibility = System.Windows.Visibility.Visible; } } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.GetDetachmentsCompleted -= GetDetachmentsCompleted; if (busyCount == 0) { Busy = false; } else { busyCount--; } }
void UpdateDateCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error != null) { Date.IsClosed = Date.IsClosed = !Date.IsClosed; ErrorProvider.ShowError(e.Error, Navigator); } dataClient.UpdateDateCompleted -= UpdateDateCompleted; Busy = false; }
void FindAttendancesCompleted(object sender, FindAttendancesCompletedEventArgs e) { if (e.Error == null) { Attendances = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.FindAttendancesCompleted -= FindAttendancesCompleted; }
void UpdateWorkCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { OnCloseView(); } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.AddWorkCompleted -= UpdateWorkCompleted; Busy = false; }
void FindDetachmentCompleted(object sender, FindDetachmentCompletedEventArgs e) { if (e.Error == null) { Detachment = e.Result.Name; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.FindDetachmentCompleted -= FindDetachmentCompleted; Busy = false; }
void FindWorkCompleted(object sender, FindWorkCompletedEventArgs e) { if (e.Error == null) { Works = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } fullTextClient.FindWorkCompleted -= FindWorkCompleted; Busy = false; }
void FindToursCompleted(object sender, FindToursCompletedEventArgs e) { if (e.Error == null) { Tours = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.FindToursCompleted -= FindToursCompleted; Busy = false; }
void ResetPasswordCompleted(object sender, ResetPasswordCompletedEventArgs e) { if (e.Error == null) { Password = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } securityClient.ResetPasswordCompleted -= ResetPasswordCompleted; Busy = false; }
void GetDetachmentsCompleted(object sender, GetDetachmentsCompletedEventArgs e) { if (e.Error == null) { Items = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.GetDetachmentsCompleted -= GetDetachmentsCompleted; Busy = false; }
void AddAttendanceCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { Attendances.Add(selectedAttendance); OnPropertyChanged(() => SelectedAttendance); } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.AddAttendanceCompleted -= AddAttendanceCompleted; Busy = false; }
void AddWorkCompleted(object sender, AddWorkCompletedEventArgs e) { if (e.Error == null) { Work.ID = e.Result; OnCloseView(); } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.AddWorkCompleted -= AddWorkCompleted; Busy = false; }
void DeleteTourCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { Tours.Remove(SelectedTour); NewCommand.Execute(null); } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.DeleteTourCompleted -= DeleteTourCompleted; Busy = false; }
void DeleteWorkCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { Works.Remove(SelectedWork); SelectedWork = null; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.DeleteWorkCompleted -= DeleteWorkCompleted; Busy = false; }
void UpdateWorkerCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { dataClient.FindWorkerCompleted += FindWorkerCompleted; dataClient.FindWorkerAsync(selectedWorker.ID); (SaveCommand as Command).OnCanExecuteChanged(); } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.UpdateWorkerCompleted -= UpdateWorkerCompleted; Busy = false; }
void UpdateTourCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { oldObject = null; (SaveCommand as Command).OnCanExecuteChanged(); } else { ErrorProvider.ShowError(e.Error, Navigator); SelectedTour = oldObject; } dataClient.UpdateTourCompleted -= UpdateTourCompleted; Busy = false; }
void AddUserCompleted(object sender, AddUserCompletedEventArgs e) { if (e.Error == null) { SelectedUser = e.Result; Password = e.Result.Password; Users.Add(SelectedUser); } else { ErrorProvider.ShowError(e.Error, Navigator); } securityClient.AddUserCompleted -= AddUserCompleted; Busy = false; }
void AddTourCompleted(object sender, AddTourCompletedEventArgs e) { if (e.Error == null) { selectedTour.ID = e.Result; Tours.Add(selectedTour); SelectedTour = selectedTour; } else { ErrorProvider.ShowError(e.Error, Navigator); SelectedTour = null; } dataClient.AddTourCompleted -= AddTourCompleted; Busy = false; }
void AddWorkerStateCompleted(object sender, AddWorkerStateCompletedEventArgs e) { if (e.Error == null) { selectedWorkerState.ID = e.Result; Items.Add(selectedWorkerState); SelectedItem = selectedWorkerState; } else { ErrorProvider.ShowError(e.Error, Navigator); SelectedItem = null; } dataClient.AddWorkerStateCompleted -= AddWorkerStateCompleted; Busy = false; }
void UpdateAttendanceCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { var a = SelectedAttendance; var index = Attendances.IndexOf(SelectedAttendance); Attendances.RemoveAt(index); Attendances.Insert(index, a); SelectedAttendance = a; } else { ErrorProvider.ShowError(e.Error, Navigator); } Busy = false; }
void FindWorkersCompleted(object sender, FindWorkersCompletedEventArgs e) { if (e.Error == null) { Workers = e.Result; if (SelectedUser != null) { SelectedWorker = (selectedUser.WorkerID != null ? Workers.FirstOrDefault(c => c.ID == selectedUser.WorkerID) : null); } } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.FindWorkersCompleted -= FindWorkersCompleted; Busy = false; }
void TransferChangeoverCompleted(object sender, TransferChangeoverCompletedEventArgs e) { if (e.Error == null) { if (Works != null) { Works.Add(e.Result); } Changeovers.Remove(SelectedChangeover); SelectedChangeover = null; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.TransferChangeoverCompleted -= TransferChangeoverCompleted; Busy = false; }
void FindWorkerStatesCompleted(object sender, FindWorkerStatesCompletedEventArgs e) { if (e.Error == null) { WorkerStates = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.FindWorkerStatesCompleted -= FindWorkerStatesCompleted; if (busyCount == 0) { Busy = false; } else { busyCount--; } }
void DeleteAttendanceCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { FirstName = null; LastName = null; SelectedWorkerState = null; SelectedWorkerTour = null; WorkerTours = null; Description = null; Attendances.Remove(SelectedAttendance); SelectedAttendance = null; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.DeleteAttendanceCompleted -= DeleteAttendanceCompleted; Busy = false; }
void FindWorkerCompleted(object sender, FindWorkerCompletedEventArgs e) { if (e.Error == null) { Worker = e.Result; if (SelectedAttendance != null) { SelectedWorkerState = WorkerStates.FirstOrDefault(c => c.ID == selectedAttendance.WorkerStateID); SelectedWorkerTour = WorkerTours.FirstOrDefault(c => c.ID == selectedAttendance.WorkerTourID); Description = selectedAttendance.Description; (UpdateCommand as Command).OnCanExecuteChanged(); } } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.FindWorkerCompleted -= FindWorkerCompleted; Busy = false; }
void GetRolesCompleted(object sender, GetRolesCompletedEventArgs e) { if (e.Error == null) { Roles = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } securityClient.GetRolesCompleted -= GetRolesCompleted; if (busyCount == 0) { Busy = false; } else { busyCount--; } }
void GetTopFaultWorksCompleted(object sender, GetTopFaultWorksCompletedEventArgs e) { if (e.Error == null) { topFaultWorks = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.GetTopFaultWorksCompleted -= GetTopFaultWorksCompleted; if (busyCount == 0) { Busy = false; } else { busyCount--; } }
void FindVehiclesCompleted(object sender, FindVehiclesCompletedEventArgs e) { if (e.Error == null) { Vehicles = e.Result; SelectedVehicle = Vehicles.FirstOrDefault(c => c.ID == Work.VehicleID); } else { ErrorProvider.ShowError(e.Error, Navigator); } dataClient.FindVehiclesCompleted -= FindVehiclesCompleted; if (busyCount == 0) { Busy = false; } else { busyCount--; } }
void GetUsersCompleted(object sender, GetUsersCompletedEventArgs e) { if (e.Error == null) { e.Result.Remove(e.Result.FirstOrDefault(c => c.ID == LoginInit.user.ID)); Users = e.Result; } else { ErrorProvider.ShowError(e.Error, Navigator); } securityClient.GetUsersCompleted -= GetUsersCompleted; if (busyCount == 0) { Busy = false; } else { busyCount--; } }
void ChangePasswordCompleted(object sender, ChangePasswordCompletedEventArgs e) { if (e.Error == null) { tmpPass = null; Status = "Heslo bylo úspěšně změněno!"; NewPassword = null; OldPassword = null; ConfirmPassword = null; } else { LoginInit.user.Password = tmpPass; tmpPass = null; ErrorProvider.ShowError(e.Error, Navigator); } securityClient.ChangePasswordCompleted -= ChangePasswordCompleted; Busy = false; }