private async Task GetData()
        {
            NotificationMsg.IsVisible = false;
            var wait = UserDialogs.Instance.Loading(null, null, null, true, MaskType.Black);

            wait.Show();
            JObject result = await IAllDataServices_data.GetAllNotiication();

            if (result != null)
            {
                string type = result["Type"].ToString();

                if (type == "1")
                {
                    _listData = JsonConvert.DeserializeObject <ObservableCollection <Notification_Class> >(result["Result"].ToString());
                    if (_listData.Count > 0)
                    {
                        NotificationList.ItemsSource = _listData;
                    }
                    else
                    {
                        NotificationMsg.IsVisible = true;
                    }
                }
                else
                {
                    await App.Current.MainPage.DisplayAlert("Error!", (string)result["ResponseMessage"], "Ok");
                }
            }
            else
            {
                await App.Current.MainPage.DisplayAlert("Oops!", "Please Refresh Page And try Again....", "Ok");
            }
            wait.Hide();
        }
Exemple #2
0
        public FranchiseMasterMasterViewModel(INavigation nov)
        {
            navigation = nov;

            LogoutComand          = new Command(async() => await Logout());
            IAllDataServices_data = new AllDataServices();
            _listData             = new ObservableCollection <Notification_Class>();
            Task task = Task.Run(async() =>
            {
                JObject result = await IAllDataServices_data.GetAllNotiication();
                if (result != null)
                {
                    string type = result["Type"].ToString();

                    if (type == "1")
                    {
                        _listData = JsonConvert.DeserializeObject <ObservableCollection <Notification_Class> >(result["Result"].ToString());
                        Count     = _listData.Count().ToString();
                        MenuItems = new ObservableCollection <FranchiseMasterMenuItem>(new[]
                        {
                            new FranchiseMasterMenuItem {
                                Title = "Notification", Icon = "menunoti", TargetType = typeof(NotificationPage), Count = Count
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Home", Icon = "menuhome", TargetType = typeof(HomePage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Amount Detail/Payment gateway", Icon = "menuatm", TargetType = typeof(FranchiseAdminPaymentDetail)
                            },
                            //new FranchiseMasterMenuItem {  Title = "Customer Registration", Icon = "customereegistration.png", TargetType = typeof(CustomerRegistrationPage)},
                            new FranchiseMasterMenuItem {
                                Title = "Sell", Icon = "menusell", TargetType = typeof(SellPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Stock", Icon = "menustock", TargetType = typeof(StockDetailPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "New Generated Order", Icon = "menuneworder", TargetType = typeof(UpComingStockRequestPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Send Request", Icon = "menusendreq", TargetType = typeof(StockRequestPage)
                            }
                            ,
                            new FranchiseMasterMenuItem {
                                Title = "All Send Request", Icon = "menusendreq", TargetType = typeof(AllStockRequestPage)
                            },

                            new FranchiseMasterMenuItem {
                                Title = "Change Password", Icon = "menucngpwd", TargetType = typeof(ChangePasswordPage)
                            },

                            new FranchiseMasterMenuItem {
                                Title = "Contact Us", Icon = "menucontact", TargetType = typeof(ContactUsPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Create Refund/Return", Icon = "menureturnref", TargetType = typeof(RefundReturnPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "View Refund/Return", Icon = "menuview", TargetType = typeof(ViewOnlyReturnRefund)
                            },

                            new FranchiseMasterMenuItem {
                                Title = "Goods Return", Icon = "menugoods", TargetType = typeof(GoodReturnPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "All Goods Return", Icon = "menugoods", TargetType = typeof(AllGoodsReturnPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Invoice", Icon = "menuinvoice", TargetType = typeof(InvoicePage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Ledger", Icon = "menuledger", TargetType = typeof(LedgerPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Profile", Icon = "menuprofile", TargetType = typeof(ProfilePage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Referral", Icon = "menureferral", TargetType = typeof(ReferralPage)
                            },
                            new FranchiseMasterMenuItem {
                                Title = "FeedBack", Icon = "menufeedback", TargetType = typeof(FeedbackPage)
                            },

                            new FranchiseMasterMenuItem {
                                Title = "FAQs", Icon = "menufaq", TargetType = null, Url = "http://www.theshirtshop.in/FAQ"
                            },
                            new FranchiseMasterMenuItem {
                                Title = "About Us", Icon = "menuabout_us", TargetType = null, Url = "http://www.theshirtshop.in/about"
                            },
                            new FranchiseMasterMenuItem {
                                Title = "Terms of Use", Icon = "menuterms_of_use", TargetType = null, Url = "http://www.theshirtshop.in/terms-of-use"
                            }
                        });
                    }
                    else
                    {
                        // UserDialogs.Instance.Alert( (string)result["ResponseMessage"], "Error!", "Ok");
                        // await App.Current.MainPage.DisplayAlert("Error!", (string)result["ResponseMessage"], "Ok");
                    }
                }
                else
                {
                    await App.Current.MainPage.DisplayAlert("Oops!", "Please Refresh Page And try Again....", "Ok");
                }
            });

            task.Wait();


            getData();
        }