//Close ProductIn Popup private void ExitInPopUp_Click(object sender, RoutedEventArgs e) { AddProductPopUp.IsOpen = false; BillDock.IsEnabled = true; InProductBT.Focus(); //Clear popup data ProductSearchTX.Clear(); ProductCB.ItemsSource = null; ProductCB.Items.Refresh(); ProductBranchCountLB.Content = "0"; ProductBranchCountLB.Foreground = new SolidColorBrush(Colors.DarkGray); PriceCatCB.ItemsSource = null; PriceCatCB.Items.Refresh(); ProcutCountTX.Text = "1"; ProductSellValueTX.Number = 0; DiscountPercentTX.Text = "0"; DiscountValueTX.Number = 0; InventoryInBT.IsEnabled = false; EditProduct = false; ProductSearchTX.IsEnabled = true; ProductCB.IsEnabled = true; }
//Search client private void SearchClientBT_Click(object sender, RoutedEventArgs e) { //Search client value var Data = NovaAPI.APIClient.clients.Find(x => x.name.ToLower().Contains(ClientFilterTX.Text.ToLower())); //Clear data ClearForm(); //Set Client data if (Data != null) { //Client found ClientFilterTX.Text = Data.name; SelectedClientID = Data.id; SelectClient(Data); InProductBT.IsEnabled = true; InProductBT.Focus(); } else { //Client not found ClearForm(); ClientFilterTX.Focus(); ClientFilterTX.SelectAll(); } }
//Inventory Close private void Button_Click_2(object sender, RoutedEventArgs e) { InventoryDock.IsEnabled = true; InventoryFinishPopUp.IsOpen = false; InProductBT.Focus(); }
//Bill key down private void SuppBillTX_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { InProductBT.Focus(); e.Handled = true; } }
//PopUp Exit private async void Button_Click_1(object sender, RoutedEventArgs e) { InventoryInPopUp.IsOpen = false; InventoryDock.IsEnabled = true; await Task.Delay(200); //Clear container ErrorMessage.Visibility = Visibility.Collapsed; //Clear offset values InventoryInPopUp.HorizontalOffset = 0; InventoryInPopUp.VerticalOffset = 0; //resume focus InProductBT.Focus(); ResetPopUP(); }