예제 #1
0
        public ListPOSSales()
        {
            bwLoadSales.DoWork += new DoWorkEventHandler(bwLoadSales_DoWork);
            bwLoadSales.ProgressChanged += new ProgressChangedEventHandler(bwLoadSales_ProgressChanged);
            bwLoadSales.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bwLoadSales_RunWorkerCompleted);

            _vm = DataContext as ListPOSSalesViewModel;
            InitializeComponent();
            LabelControls();

            SetUpDataPager();

            this.Loaded += new RoutedEventHandler(ListPOSSales_Loaded);

            double newLayoutRootWidth = OtherUtilities.ContentFrameWidth;
            newLayoutRootWidth = (newLayoutRootWidth * 0.95);

            double newLayoutRootHeight = OtherUtilities.ContentFrameHeight;
            newLayoutRootHeight = (newLayoutRootHeight * 0.95);

            double tabControlHeight = (newLayoutRootHeight * 0.825);

            LayoutRoot.Width = newLayoutRootWidth;
            LayoutRoot.Height = newLayoutRootHeight;
            SalesTabControl.Height = tabControlHeight;

#if (KEMSA)
            {
                BackOrdersTabItem.Visibility = Visibility.Collapsed;
                LostSalesTabItem.Visibility = Visibility.Collapsed;
                OutstandingTabItem.Visibility = Visibility.Collapsed;
            }
#endif
        }
예제 #2
0
        void ListPOSSales_Loaded(object sender, RoutedEventArgs e)
        {
            _vm = DataContext as ListPOSSalesViewModel;
            _vm.ClearAndSetup();
            try
            {
                DataPager.txtTotal.Text = _vm.SalesCount.ToString();
                DataPager.txtPage.Text = _vm.CurrentPage.ToString();

                _posvm = ViewModelLocator.EditPOSOutletSaleViewModelPropertyNameStatic;
                _livm = ViewModelLocator.ListInvoicesViewModelStatic;

                SalesTabControl.SelectedIndex = OtherUtilities.SelectedTabPos;
                string _pendingSales = NavigationService.Source.OriginalString.ParseQueryString("PendingSales");
                if (!string.IsNullOrEmpty(_pendingSales))
                    _vm.PendingSales = Convert.ToBoolean(_pendingSales);
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
예제 #3
0
        void LoadSales(ContentControl selectedTab)
        {
            if (_vm == null)
                _vm = DataContext as ListPOSSalesViewModel;

            if (lblProgress != null)
                lblProgress.Visibility = Visibility.Visible;

            var dataGrid = selectedTab.Content as DataGrid;

            switch (selectedTab.Name)
            {
                case "CompleteSalesTabItem":
                    _vm.reportType = ListPOSSalesViewModel.ReportType.Complete;
                    break;
                case "IncompleteTabItem":
                    _vm.reportType = ListPOSSalesViewModel.ReportType.Incomplete;
                    break;
                case "BackOrdersTabItem":
                    _vm.reportType = ListPOSSalesViewModel.ReportType.BackOrders;
                    break;
                case "LostSalesTabItem":
                    _vm.reportType = ListPOSSalesViewModel.ReportType.LostSales;
                    break;
                case "OutstandingTabItem":
                    _vm.reportType = ListPOSSalesViewModel.ReportType.OutstandingPayment;
                    break;
            }
            //if (!loadSearched)
            //{
            //    if (!bwLoadSales.IsBusy)
            //        bwLoadSales.RunWorkerAsync();
            //}
            //else
            //{
            //    _vm.LoadSalesBySearchTextCommand.Execute(null);
            //    dataGrid.ItemsSource = _vm.Sales;
            //    lblProgress.Visibility = Visibility.Collapsed;
            //}

            if (!bwLoadSales.IsBusy)
                bwLoadSales.RunWorkerAsync();
        }
예제 #4
0
        private void SalesTabControl_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (e.Source.GetType() != typeof(TabControl))
                return;
            if (_vm == null)
                _vm = DataContext as ListPOSSalesViewModel;
            _vm.CurrentPage = 1;
            _vm.SearchText = "";

            if (DataPager != null)
            {
                DataPager.EnableOrDisableButtons(_vm.CurrentPage, _vm.PageCount);
                DataPager.txtPage.Text = _vm.CurrentPage.ToString();
            }

            ClearAllDataGrids();
            TabControl tabCntr = sender as TabControl;
            TabItem tabItem = tabCntr.SelectedItem as TabItem;
            OtherUtilities.SelectedTabPos = tabCntr.SelectedIndex;

            LoadSales(tabItem);
        }
예제 #5
0
        private void hlnkView_Click(object sender, RoutedEventArgs e)
        {
            Hyperlink hpb = (Hyperlink)sender;
            _vm = DataContext as ListPOSSalesViewModel;
            var orderId = new Guid(hpb.Tag.ToString());
            var uri = "";
            if (_vm == null) return;

            if (SalesTabControl.SelectedIndex == SalesTabControl.Items.IndexOf(OutstandingTabItem))
            {
                uri = "/views/TransactionStatement/TransactionStatement.xaml?OrderId=" + orderId;
                OtherUtilities.SelectedTabPos = 4;
                OtherUtilities.StrBackUrl = "/views/pos/listpossales.xaml";
                NavigationService.Navigate(new Uri(uri, UriKind.Relative));
                return;
            }
            _vm.OrderIdLookup = orderId;
            _vm.SelectViewerAndGoCommand.Execute(null);
        }