private async void LoadCustomer() { if (string.IsNullOrEmpty(txtBarcode.Text)) { MessageBox.Show("کد وارد شده صحیح نمی باشد."); return; } string barcode = txtBarcode.Text; Loading(true); Response <CustomerViewModel> response = await GetCustomer(barcode); if (response.status == 404) { RegisterWindow window = new RegisterWindow(user, barcode); window.ShowDialog(); } else if (response.status == 403) { LoginWindow login = new LoginWindow(); login.Show(); Close(); } else { CustomerMainWindow window = new CustomerMainWindow(user, response.data); window.ShowDialog(); } Loading(false); txtBarcode.Text = ""; txtBarcode.Focus(); }
private void Btn_home_Click(object sender, RoutedEventArgs e) { Storage.WriteXml <ObservableCollection <FoodItem> >(foodItems, "FoodItems.xml"); var win = new CustomerMainWindow(); win.Owner = this; win.Show(); Visibility = Visibility.Hidden; }