private async void ActivateImplementation(object obj) { bool correct = true; LoaderManager.Instance.ShowLoader(); await Task.Run(() => { ServiceReference1.ServiceATMClient client = new ServiceATMClient(); var atm = client.GetATMByCode(Code); StaticManager.CurrentAtm = atm; if (atm == null || !atm.CheckPassword(Password)) { correct = false; MessageBox.Show("Wrong code or password!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1); } else { StaticManager.CurrentAtm.Status = true; DbManager.SaveATM(StaticManager.CurrentAtm); } }); LoaderManager.Instance.HideLoader(); if (correct) { NavigationManager.Instance.Navigate(ModesEnum.CardNumber); } else { NavigationManager.Instance.Navigate(ModesEnum.ActivateAtm); } }
// public static ATM GetATMByCode(string atmCode) { ServiceATMClient client = new ServiceATMClient(); return(client.GetATMByCode(atmCode)); }