Beispiel #1
0
        //On search or exit productsearchtx
        private void ProductSearchTX_PreviewKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                ExitInPopUp_Click(null, null);
                e.Handled = true;
            }
            if (e.Key == Key.Enter && ((Control)sender).Name != "PaymentType")
            {
                try
                {
                    //Clear list
                    ProductCB.ItemsSource = null;
                    GC.Collect();
                }
                catch (Exception) { }

                int parsedValue;
                if (!int.TryParse(ProductSearchTX.Text, out parsedValue))
                {
                    LoadProducts(ProductSearchTX.Text);
                }
                else
                {
                    LoadProducts(ProductSearchTX.Text);
                    ProductSearchTX.Clear();
                }
                MoveFocus(sender, e);
                e.Handled = true;
            }
        }
Beispiel #2
0
        //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;
        }
Beispiel #3
0
        //Search TX on Enter key
        private void ProductSearchTX_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                Button_Click_1(null, null);
                e.Handled = true;
            }
            if (e.Key == Key.Enter)
            {
                try
                {
                    //Clear list
                    ProductCB.ItemsSource = null;
                    GC.Collect();
                }
                catch (Exception) { }

                int parsedValue;
                if (!int.TryParse(ProductSearchTX.Text, out parsedValue))
                {
                    LoadProducts(ProductSearchTX.Text);
                }
                else
                {
                    LoadProducts(ProductSearchTX.Text);
                    ProductSearchTX.Clear();
                }
                MoveFocus(sender, e);
                e.Handled = true;
            }
        }
Beispiel #4
0
        //Open PopUp on add products
        private void In_Click(object sender, RoutedEventArgs e)
        {
            InventoryDock.IsEnabled = false;
            InventoryInPopUp.IsOpen = true;

            //Focus search TX
            ProductSearchTX.Focus();
        }
Beispiel #5
0
 //Inser product to bill / open product popup
 public void InProductBT_Click(object sender, RoutedEventArgs e)
 {
     if (BillDock.IsEnabled == true)
     {
         BillDock.IsEnabled     = false;
         AddProductPopUp.IsOpen = true;
         ProductSearchTX.Focus();
     }
 }
Beispiel #6
0
 private void ResetPopUP()
 {
     ProductSearchTX.Clear();
     ProductCB.ItemsSource   = null;
     BranchCB.SelectedIndex  = BranchCB.Items.IndexOf(NovaAPI.APIBranch.branch.Find(x => x.id == DataConfig.WorkPlaceID.ToString()));
     ProcutCountTX.Text      = "1";
     ProductCostTX.Number    = 0;
     InventoryInBT.IsEnabled = false;
 }
Beispiel #7
0
        //Clear all form data and values
        private async void ClearForm()
        {
            ClientFilterTX.Clear();

            //Load client data -----------------------------
            if (Cache.Cache.ClientsDateTime != null)
            {
                if (Cache.Cache.ClientsDateTime <= DateTime.Now.AddMinutes(-Cache.Cache.CacheTime))
                {
                    await LoadClients();
                }
            }
            else
            {
                await LoadClients();
            }

            //Clear client data
            ClientNameLB.Content     = "";
            ClientDocumentLB.Content = "";
            ClientPhonesLB.Content   = "";
            ClientAddressLB.Content  = "";
            ClientMailLB.Content     = "";

            SelectedClientID = "";
            //Reset form
            InProductBT.IsEnabled = false;
            FinalIn.IsEnabled     = false;

            string ZeroValue = string.Format("{0:C0}", 0);

            TotalProductsLB.Content = "0";
            SubtotalLB.Content      = ZeroValue;
            IVALB.Content           = ZeroValue;
            IACLB.Content           = ZeroValue;
            TotalLB.Content         = ZeroValue;

            //Product add popup
            ProductSearchTX.Clear();

            ProductCB.ItemsSource  = null;
            PriceCatCB.ItemsSource = null;
            ProductCB.Items.Refresh();
            PriceCatCB.Items.Refresh();
            SelectedCatIndex = 0;

            ProductBranchCountLB.Content    = "0";
            ProductBranchCountLB.Foreground = new SolidColorBrush(Colors.DarkGray);

            ProcutCountTX.Text = "1";
            ProductSellValueTX.Clear();

            BillProducts.Clear();
            ProductsGrid.Items.Refresh();

            PrintIn.Visibility     = Visibility.Collapsed;
            InProductBT.Visibility = Visibility.Visible;
            FinalIn.Visibility     = Visibility.Visible;

            SetClients();
        }