Example #1
0
        private async void OnSelectSidebar(SelectionModel obj)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                // Thuc hien cong viec tai day
                var sidebar = SideBarBindProp.FirstOrDefault(i => i.IsSelected);
                if (sidebar != null)
                {
                    sidebar.IsSelected = false;
                }
                obj.IsSelected = true;
                switch (obj.Name)
                {
                case "Doanh thu tổng quan":
                    OverallVisibleBindProp    = true;
                    TopSellersVisibleBindProp = false;
                    Title = "Doanh thu tổng quan";
                    if (IsDateRange)
                    {
                        RevenuePerDayVisibleBindProp = true;
                    }
                    else
                    {
                        RevenuePerDayVisibleBindProp = false;
                    }
                    GetOverallData();
                    break;

                case "Mặt hàng bán chạy":
                    TopSellersVisibleBindProp = true;
                    OverallVisibleBindProp    = false;
                    Title = "Mặt hàng bán chạy";
                    GetTopSeller();
                    break;
                }
            }
            catch (Exception e)
            {
                await ShowErrorAsync(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #2
0
        private async void OnSelectSidebar(SelectionModel obj)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                // Thuc hien cong viec tai day
                var sidebar = SideBarBindProp.FirstOrDefault(i => i.IsSelected);
                if (sidebar != null)
                {
                    sidebar.IsSelected = false;
                }
                obj.IsSelected = true;
                switch (obj.Name)
                {
                case "Danh sách hàng tồn":
                    ListItemVisibleBindProp           = true;
                    ListItemOutOfStockVisibleBindProp = false;
                    HistoryVisibleBindProp            = false;
                    break;

                case "Danh sách hàng sắp hết":
                    ListItemOutOfStockVisibleBindProp = true;
                    ListItemVisibleBindProp           = false;
                    HistoryVisibleBindProp            = false;
                    break;

                case "Lịch sử":
                    HistoryVisibleBindProp            = true;
                    ListItemVisibleBindProp           = false;
                    ListItemOutOfStockVisibleBindProp = false;
                    break;

                default:
                    break;
                }
            }
            catch (Exception e)
            {
                await ShowErrorAsync(e);
            }
            finally
            {
                IsBusy = false;
            }
        }
        private async void OnSelectSidebar(SelectionModel obj)
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                // Thuc hien cong viec tai day
                var sidebar = SideBarBindProp.FirstOrDefault(i => i.IsSelected);
                if (sidebar != null)
                {
                    sidebar.IsSelected = false;
                }
                obj.IsSelected = true;
                switch (obj.Name)
                {
                case "Phiên làm việc của két tiền":
                    Title = "Phiên làm việc của két tiền";
                    SessionVisibleBindProp        = Application.Current.Properties.ContainsKey("session") ? false : true;
                    SessionDetailVisibleBindProp  = !SessionVisibleBindProp;
                    SessionHistoryVisibleBindProp = false;
                    break;

                case "Lịch sử két tiền":
                    Title = "Lịch sử két tiền";
                    SessionVisibleBindProp        = false;
                    SessionDetailVisibleBindProp  = false;
                    SessionHistoryVisibleBindProp = true;
                    break;
                }
                CurrentSessionDetailVisibleBindProp = false;
            }
            catch (Exception e)
            {
                await ShowErrorAsync(e);
            }
            finally
            {
                IsBusy = false;
            }
        }