Beispiel #1
0
        public KOTsendPage()
        {
            InitializeComponent();
            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
            }

            //this.BackgroundImage = "background.png";
            this.Title = "COMPLETE ORDER";
        }
        public SelectMode()
        {
            InitializeComponent();

            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
            }

            //this.BackgroundImage = "background.png";
            this.Title = "SELECT MODE";

            //  resul = numb;

            if (CrossConnectivity.Current.IsConnected)
            {
                try
                {
                    // GetJSON();
                    //  BindingContext = new JsonStuwardModel();

                    //  var device = Hardware.Default.DeviceId;
                }
                catch (Exception ex)
                {
                    // Console.WriteLine("An error occurred: '{0}'", ex);
                }
            }

            else
            {
                // write your code if there is no Internet available

                DisplayAlert("NETWORK ERROR", "SYSTEM IS OFFLINE", "Ok");
            }
        }
Beispiel #3
0
        public FoodTabPage(string categoryName, IList <ResturentItems> foodList)
        {
            InitializeComponent();
            // ImageService.Instance.Initialize();
            //this.BackgroundImage = "background.png";
            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)

            //TicketQuery y = new TicketQuery();
            //SQLiteConnection d;
            //d = DependencyService.Get<ISQLite>().GetConnection();
            //d.Table<TicketNumber>();
            //var tikcount = d.ExecuteScalar<string>("SELECT max(TicketNum) FROM TicketNumber");
            //DisplayAlert("tiket numb", tikcount, "OK");
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
            }


            // createEventsList();
            Title = categoryName;
            mealsListView.ItemsSource = foodList;
            NavigationPage.SetHasBackButton(this, false);
            //_foodList= ListViewCachingStrategy.RetainElement;

            _foodList = foodList;



            // mealsListView.ItemsSource = UpdateDetails;
        }
        public JsonDetailsPage(long id, ResturentItems item, String name, string code, String description, decimal price, bool isservicecharge, bool isaddonapplicable, decimal costprice)
        {
            //var yourImageSource = new ResturentItemToImageSourceConverter().Convert(item, typeof(ImageSource), null, System.Globalization.CultureInfo.CurrentCulture);
            //ProductImage.Source = yourImageSource as ImageSource;
            //BindingContext = this;
            //Item = item;

            InitializeComponent();
            var yourImageSource = new ResturentItemToImageSourceConverter().Convert(item, typeof(ImageSource), null, System.Globalization.CultureInfo.CurrentCulture);

            ProductImage.Source = yourImageSource as ImageSource;

            // this.BackgroundImage = "background.png";
            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)

            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
            }

            this.Title = "Product Details";           // CachedImageRenderer.Init();


            thiTable = JsonTable.tablenew;
            // picker.TextColor = Color.White;
            // GridDetails.BindingContext = SelectedContact;
            ItemID.Text = Convert.ToString(id);
            itId        = id;

            //Image.Source = ImageSource.FromStream(() => new MemoryStream(image));
            // ImageSource.FromStream(() => new MemoryStream());
            // this.Item = item;
            Name.Text                  = name;
            codedetails.Text           = code;
            Description.Text           = description;
            Price.Text                 = Convert.ToString(price);
            isservicechargeinfo.Text   = Convert.ToString(isservicecharge);
            isaddonapplicableinfo.Text = Convert.ToString(isaddonapplicable);
            CostPriceDetail.Text       = Convert.ToString(costprice);
            // ResturentItems = Convert.ToString(Item);
            // Image.Text = image;
            // CustomCachedImage.Source= ImageSource.FromStream(() => new MemoryStream(image));
            // CustomStreamImageSource.FromResource = ImageSource.FromStream(() => new MemoryStream(image));
            // DisplayAlert("Addon Not applicable", "Not Available", "OK");
            // Image.Source =ImageService.Instance.LoadCompiledResource(nameOfResource).Into(_imageView);
            // pimage = image;

            pprice = price;
            //addonitemdetail = isaddonapplicable;

            //long freeMemory = Java.Lang.Runtime.GetRuntime().FreeMemory();
            //DisplayAlert("freemomory", Convert.ToString(freeMemory), "OK");
            //DisplayAlert("end 1","end 1","ok");

            //Widget widget = new Widget()
            //widget.Name = "test"
            //widget.Price = 1;
            //HttpClient client = new HttpClient();
            //client.BaseAddress = new Uri("http://localhost:44268/api/test");
            //client.SendAsync(new HttpRequestMessage<Widget>(widget)).ContinueWith((postTask) => postTask.Result.EnsureSuccessStatusCode());


            var images = new List <String>
            {
                "https://www.gourmetguide.co.uk/shop/wp-content/uploads/2016/06/Resturant-Food-400x200.jpg",
                "http://beranisehat.com/wp-content/uploads/2015/06/Healthy-Breakfast-Food-Ideas-400x200.jpg",
                "http://empireoftheincasrestaurant.com/wp-content/uploads/2016/05/Papa-a-la-huaicaina-3-400x200.jpg"
            };

            //var names = new List<String>
            //{
            //    "Sam","Pan","Jam"
            //};

            MainCarouselView.ItemsSource = images;

            if (isaddonapplicable == true)
            {
                DisplayAlert("Addon applicable", Convert.ToString(isaddonapplicable), "OK");
            }
            else
            {
                DisplayAlert("Addon Not applicable", "Not Available", "OK");
            }

            // titlesimi.Text = "this is text";
            // GetSimilerJSON();
            // GC.Collect(1);

            //mGridGallery.ItemClick -= OnItemClicked;
            //mGridGallery.ItemClick += OnItemClicked;
            // testJason();

            Device.StartTimer(TimeSpan.FromSeconds(3), (Func <bool>)(() =>
            {
                MainCarouselView.Position = (MainCarouselView.Position + 1) % images.Count;

                return(true);
            }));
        }
        public MainVedioPage(int flgtab)
        {
            InitializeComponent();
            NavigationPage.SetHasBackButton(this, false);
            tabresult = flgtab;
            //SlidePosition = 0;
            //SlidePositionTemp = 0;

            //this.BackgroundColor = Color.Black;
            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "bone")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "btwo")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else
            {
                this.BackgroundImage = "backnewtwo.png";
            }
            // stat = detail;
            var queue = CrossMediaManager.Current.MediaQueue;

            TableQuery       y = new TableQuery();
            SQLiteConnection K;

            K = DependencyService.Get <ISQLite>().GetConnection();
            K.Table <TempTbl>();
            var NowTable = K.ExecuteScalar <string>("SELECT TblNumbe FROM TempTbl ORDER BY Id DESC LIMIT 1");

            tikettable = NowTable;

            //CrossMediaManager.Current.Play(VedioUrl, MediaFileType.Video);
            //CrossMediaManager.Current.PlaybackController.PlayPreviousOrSeekToStart();
            //CrossMediaManager.Current.PlaybackController.Play();
            //this.volumeLabel.Text = "Volume (0-" + CrossMediaManager.Current.VolumeManager.MaxVolume + ")";
            ////Initialize Volume settings to match interface
            //int.TryParse(this.volumeEntry.Text, out var vol);
            //CrossMediaManager.Current.VolumeManager.CurrentVolume = vol;
            //CrossMediaManager.Current.VolumeManager.Muted = false;

            //CrossMediaManager.Current.PlayingChanged += (sender, e) =>
            //{
            //    Device.BeginInvokeOnMainThread(() =>
            //    {
            //        ProgressBar.Progress = e.Progress;
            //        Duration.Text = "" + e.Duration.TotalSeconds + " seconds";
            //    });
            //};



            //var images = new List<String>
            //{
            //    //"https://www.gourmetguide.co.uk/shop/wp-content/uploads/2016/06/Resturant-Food-400x200.jpg",
            //    //"http://beranisehat.com/wp-content/uploads/2015/06/Healthy-Breakfast-Food-Ideas-400x200.jpg",
            //    //"http://empireoftheincasrestaurant.com/wp-content/uploads/2016/05/Papa-a-la-huaicaina-3-400x200.jpg"

            //    "http://www.nefful.com.hk/wp-content/uploads/revslider/food-carousel/food5-768x576.jpg",
            //    "http://www.nefful.com.hk/wp-content/uploads/revslider/food-carousel/food4-768x576.jpg",
            //    "http://www.nefful.com.hk/wp-content/uploads/revslider/food-carousel/muesli-768x576.jpg",
            //    "http://www.nefful.com.hk/wp-content/uploads/revslider/food-carousel/food3-768x576.jpg",
            //    "http://www.nefful.com.hk/wp-content/uploads/revslider/food-carousel/food2-768x576.jpg",
            //    "http://www.nefful.com.hk/wp-content/uploads/revslider/food-carousel/food1-768x576.jpg"
            //};
            // Getslidetimer();
            //mainCarosel.ItemsSource = images;

            ////MainCarouselViewone.ItemsSource = images;
            //Device.StartTimer(TimeSpan.FromSeconds(5), (Func<bool>)(() =>
            //{
            //// public static int SlidePosition = 0;
            // // SlidePositionTemp = 0;
            //    if (SlidePosition < images.Count)
            //    {
            //        if (SlidePositionTemp != 0 && SlidePositionTemp == SlidePosition)
            //        { SlidePosition--; SlidePositionTemp--; }
            //        else { SlidePosition++; }

            //        if (SlidePosition == images.Count)
            //        {
            //            //SlidePosition= 0;


            //            SlidePosition= images.Count- 1;

            //            SlidePositionTemp = SlidePosition;

            //        }

            //    }
            //    mainCarosel.Position = SlidePosition;
            //    // mainCarosel.Position = (mainCarosel.Position + 1) % images.Count;

            //    return _isTimerStart;


            //}));


            var names = new List <String>
            {
                "BEST DEALS AND PROMOTIONS AT T-LOUNGE CUSTOMERS ONLY ON THIS SESSION", "ENJOY THE FUNTASTIC PROMOTIONS ONLY IN T-LOUNGE ARCADE", "EXITING PROMOTIONS ONLY FOR LOYALITY CUSTOMERS"
            };

            //mainCarosel.ItemSelected += (sender, args) =>
            //{
            //    DisplayAlert("yes","yes","OK");
            //    //var zoo = args.SelectedItem as Zoo;
            //    //if (zoo == null)
            //    //    return;

            //    //Title = zoo.Name;
            //};

            //return new DataTemplate(() =>
            //{
            //    Image v = images.Count;
            //    TapGestureRecognizer imageTap = new TapGestureRecognizer();
            //    imageTap.Tapped += (sender, e) =>
            //    {
            //        Navigation.PushAsync(new FoodTabbedPage());
            //    };
            //    v.GestureRecognizers.Add(imageTap);
            //    Count++;
            //    return v;
            //});

            //wordheading.ItemsSource = names;

            //Device.StartTimer(TimeSpan.FromSeconds(3), (Func<bool>)(() =>
            //{
            //    wordheading.Position = (wordheading.Position + 1) % names.Count;

            //    return true;
            //}));
        }
Beispiel #6
0
        public Login()
        {
            InitializeComponent();

            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
            }
            //this.BackgroundImage = "background.png";
            this.Title = "Login";

            var username = new Entry {
                Placeholder = "Username", PlaceholderColor = Color.Gray, TextColor = Color.White, BackgroundColor = Color.Black, Opacity = 0.7
            };
            var password = new Entry {
                IsPassword = true, Placeholder = "Password", PlaceholderColor = Color.Gray, TextColor = Color.White, BackgroundColor = Color.Black, Opacity = 0.7
            };
            var login = new Button {
                Text = "Login"
            };
            var lbl_signup = new Label {
                Text = "Not a Member? Click the button and sign up now!", TextColor = Color.White
            };
            var signup = new Button {
                Text = "Sign up"
            };

            signup.Clicked += (object sender, EventArgs e) =>
            {
                Navigation.PushAsync(new SignUp());
            };

            login.Clicked += (object sender, EventArgs e) =>
            {
                CustomersDB   _CustomerDB    = new CustomersDB();
                CustomerQuery _CustomerQuery = new CustomerQuery();



                CustomersDB c = _CustomerQuery.GetCustName(username.Text);
                if (c != null)
                {
                    if (password.Text == c.Password)
                    {
                        //   DisplayAlert("Alert", "login succesful", "OK");
                        //Navigation.PushAsync(new PayNow());
                        Navigation.PushAsync(new IPaccessPage());
                    }
                    else
                    {
                        DisplayAlert("Alert", "login failed", "OK");
                    }
                }
                //     DisplayAlert("Alert", "ID: " + c.Id + "  UserName: "******" Password: "******"OK");
            };

            //var btnStack = new StackLayout
            //{
            //    Orientation = StackOrientation.Horizontal,
            //    HorizontalOptions = LayoutOptions.FillAndExpand,
            //    Children = {
            //       login, signup
            //    }
            //};

            Content = new StackLayout
            {
                VerticalOptions   = LayoutOptions.Center,
                HorizontalOptions = LayoutOptions.Center,
                Children          = { username, password, login, lbl_signup, signup }
            };
        }
Beispiel #7
0
        public IPaccessPage()
        {
            // bone = "background.png";
            // btwo = "backgroundnew.png";


            InitializeComponent();
            //bone = "background.png";
            //themeName.Title = "select";
            themeName.Items.Add("Style1");
            themeName.Items.Add("Style2");
            themeName.Items.Add("Style3");
            //themeName.Items.Add("Style4");

            //  btwo = "backgroundnew.png";
            //  this.BackgroundImage = "backnewtwo.png";
            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
                // splashscreen.gif
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
                //this.BackgroundImage = "backgroundSmoke.gif";
            }
            //else if (saveback == "Style4")
            //{
            //    // this.BackgroundImage = "backnewtwo.png";
            //    this.BackgroundImage = "backgroundSmoke.gif";
            //}
            //  this.BackgroundImage = saveback;
            //    this.BackgroundImage = bone;
            //}
            //else if(backnow == btwo)
            //{
            //    this.BackgroundImage = "backgroundnew.png";
            //}
            //this.BackgroundImage = backnow;


            DisplayAlert("Background massage", backnow, "OK");


            this.Title = "IP SETUP";

            IPQuery          IPR = new IPQuery();
            SQLiteConnection IPK;

            IPK = DependencyService.Get <ISQLite>().GetConnection();
            IPK.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var ipdiso = IPK.ExecuteScalar <string>("SELECT IPnumb FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            // var backnow = IPK.ExecuteScalar<string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");
            // DisplayAlert("Existing IP", ipdiso, "OK");

            ipaddressWIFItwo = ipdiso;

            //if (backnow == bone)
            //{
            //    this.BackgroundImage = "background.png";
            //}
            //else if (backnow == btwo)
            //{
            //    this.BackgroundImage = "backgroundnew.png";
            //}
            //else
            //{
            //    this.BackgroundColor = Color.White;
            //    DisplayAlert("No background", "No background", "OK");
            //}
            //  isOnline();

            // ipaddressWIFItwo = "http://172.16.101.236/";
            //WifiManager wifiManager = (WifiManager)context.GetSystemService(Service.WifiService);
            //int ip = wifiManager.ConnectionInfo.IpAddress;
        }
        public OnlineLoginPage()
        {
            InitializeComponent();
            Init();

            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
            }
            // this.BackgroundImage = "backgroundnew.png";
            this.Title = "Login";
            NavigationPage.SetHasBackButton(this, false);
            // GetIPAddress();
            //  Task<bool> IsRemoteReachable(string host, int port = 80, int msTimeout = 5000);
            // string ipaddress = DependencyService.Get<IIPAddressManager>().GetIPAddress();

            //  DisplayAlert("Net", ipaddress,"OK");

            //  DisplayAlert("Net", IPaccessPage.ipaddressWIFItwo, "OK");

            IPQuery          IPR = new IPQuery();
            SQLiteConnection IPK;

            IPK = DependencyService.Get <ISQLite>().GetConnection();
            IPK.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var ipdiso = IPK.ExecuteScalar <string>("SELECT IPnumb FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            // DisplayAlert("Existing IP", ipdiso, "OK");

            ipinfotop.Text = "EXISTING IP ADDRESS OF THE SYSTEM IS :" + ipdiso;

            //var saveButton = new Button { Text = "Save" };
            //saveButton.Clicked += (sender, e) => {
            //    DependencyService.Get<ISaveAndLoad>().SaveText("temp.txt", input.Text);
            //};
            //var loadButton = new Button { Text = "Load" };
            //loadButton.Clicked += (sender, e) => {
            //    output.Text = DependencyService.Get<ISaveAndLoad>().LoadText("temp.txt");
            //};
            //Java.Util.IEnumeration networkInterfaces = NetworkInterface.NetworkInterfaces;

            //while (networkInterfaces.HasMoreElements)
            //{
            //    Java.Net.NetworkInterface netInterface =
            //                              (Java.Net.NetworkInterface)networkInterfaces.NextElement();
            //    DisplayAlert("network", netInterface.ToString(), "OK");

            //   // Console.WriteLine(netInterface.ToString());
            //}
            try
            {
                int         newnumber = 1;
                ToolbarItem cartItem  = new ToolbarItem();
                cartItem.Order = ToolbarItemOrder.Primary;
                cartItem.Text  = "IP SETUP";
                // cartItem.Icon = "orderNewThree.png";

                //cartItem.Command = new Command(() => Navigation.PushAsync(new IPaccessPage()));
                cartItem.Command = new Command(() => Navigation.PushAsync(new Login()));

                ToolbarItems.Add(cartItem);

                //SQLiteConnection m;
                //m = DependencyService.Get<ISQLite>().GetConnection();
                //TempTbl mit = new TempTbl();
                //m.Table<TempTbl>();
                //m.DeleteAll<TempTbl>();
            }
            catch (Exception ex)
            {
                // Console.WriteLine("An error occurred: '{0}'", ex);
            }
        }
        public JsonTable(int numb)
        {
            //InitializeComponent();
            InitializeComponent();
            // this.BackgroundImage = "background.png";

            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
            }


            this.Title = "Tables";
            resul      = numb;
            // DisplayAlert("identity", Convert.ToString(resul), "ok");

            if (CrossConnectivity.Current.IsConnected)
            {
                try
                {
                    GetJSON();
                }
                catch (Exception ex)
                {
                    // Console.WriteLine("An error occurred: '{0}'", ex);
                }
            }

            else
            {
                // write your code if there is no Internet available

                DisplayAlert("NETWORK ERROR", "SYSTEM IS OFFLINE", "Ok");
            }

            // GetUsedTable();

            //  Higlight();

            //if (Newtab == Usetab)
            //{
            //    DisplayAlert("ocupied tables are", Convert.ToString(Usetab), "OK");
            ////    Button btn = new Button();
            ////    btn.BackgroundColor = Color.FromHex("#22ac38");
            //}


            BindingContext = new JsonTableClass();


            //int resul = numb;

            //DisplayAlert("identity", Convert.ToString(resul),"ok");
            // CrossConnectivity.Current.ConnectivityChanged += Current_ConnectivityChanged;
            // decimal toti = 0;
            // ToolbarItem cartItem = new ToolbarItem();
            //// cartItem.Text = "My Cart";
            // cartItem.Order = ToolbarItemOrder.Primary;
            // cartItem.Icon = "ShoppingCart9.png";
            // cartItem.Command = new Command(() => Navigation.PushAsync(new OnlineCart(toti)));
            // ToolbarItems.Add(cartItem);

            //StuwaQuery n = new StuwaQuery();
            //SQLiteConnection k;
            //k = DependencyService.Get<ISQLite>().GetConnection();
            //k.Table<StuwardTbl>();
            //var cou = k.ExecuteScalar<string>("SELECT max(StuwaName) FROM StuwardTbl");
            //var stid = k.ExecuteScalar<int>("SELECT max(StuwaID) FROM StuwardTbl");

            //DisplayAlert("Stuwa Name", cou,Convert.ToString(stid), "OK");
        }
        //public Command DeleteCommand { get; }

        public OnlineCart(decimal totalnew)
        {
            InitializeComponent();
            IPQuery          IPBC = new IPQuery();
            SQLiteConnection IPB;

            IPB = DependencyService.Get <ISQLite>().GetConnection();
            IPB.Table <IPaddressDB>();
            //  var tikcount = d.ExecuteScalar<string>("SELECT TicketNum FROM TicketNumber");
            var backnow = IPB.ExecuteScalar <string>("SELECT backgrund FROM IPaddressDB ORDER BY Id DESC LIMIT 1");

            //if (backnow == bone)
            //{
            // this.BackgroundImage = saveback;
            saveback = backnow;
            if (saveback == "Style1")
            {
                this.BackgroundImage = "background.png";
            }
            else if (saveback == "Style2")
            {
                this.BackgroundImage = "backgroundnew.png";
            }
            else if (saveback == "Style3")
            {
                this.BackgroundImage = "backnewtwo.png";
            }

            //this.BackgroundImage = "background.png";
            NavigationPage.SetHasBackButton(this, true);
            this.Title = "MENU";
            GC.Collect(1);

            if (CrossConnectivity.Current.IsConnected)
            {
                try
                {
                    if (totalnew > 0)
                    {
                        // DisplayAlert("one", "1", "OK");
                        foodback.IsVisible = false;
                    }
                    else
                    {
                        //  DisplayAlert("two", "2", "OK");
                        foodback.IsVisible = true;
                    }

                    try
                    {
                        int         newnumber = 2;
                        ToolbarItem cartItem  = new ToolbarItem();
                        cartItem.Order = ToolbarItemOrder.Primary;
                        cartItem.Text  = "START NEW ORDER";
                        // cartItem.Icon = "orderNewThree.png";

                        cartItem.Command = new Command(() => Navigation.PushAsync(new JsonTable(newnumber)));
                        ToolbarItems.Add(cartItem);

                        //SQLiteConnection m;
                        //m = DependencyService.Get<ISQLite>().GetConnection();
                        //TempTbl mit = new TempTbl();
                        //m.Table<TempTbl>();
                        //m.DeleteAll<TempTbl>();
                    }
                    catch (Exception ex)
                    {
                        // Console.WriteLine("An error occurred: '{0}'", ex);
                    }


                    try
                    {
                        // int newnumber = 2;
                        ToolbarItem RefreshPage = new ToolbarItem();
                        RefreshPage.Order = ToolbarItemOrder.Primary;
                        RefreshPage.Text  = "REFRESH";
                        // cartItem.Icon = "orderNewThree.png";
                        //decimal tot;
                        RefreshPage.Command = new Command(() => Navigation.PushAsync(new OnlineCart(totalnew)));
                        ToolbarItems.Add(RefreshPage);

                        //SQLiteConnection m;
                        //m = DependencyService.Get<ISQLite>().GetConnection();
                        //TempTbl mit = new TempTbl();
                        //m.Table<TempTbl>();
                        //m.DeleteAll<TempTbl>();
                    }
                    catch (Exception ex)
                    {
                        // Console.WriteLine("An error occurred: '{0}'", ex);
                    }
                    // this.ToolbartItems.Add(new ToolbarItem { Text = "BTN 1", Icon = "myicon.png" });
                    //CrossConnectivity.Current.ConnectivityChanged += Current_ConnectivityChanged;

                    //var items = new List<JsonCartone>();
                    //cartone.ItemsSource = items;
                    //decimal tot;
                    TotalTbl         tbr = new TotalTbl();
                    SQLiteConnection s;
                    s = DependencyService.Get <ISQLite>().GetConnection();
                    s.Table <TotalTbl>();
                    // tbr.ItmID = id;
                    tbr.ItmTotal = totalnew;
                    //tbr.TblName = Convert.ToString(data.ID);
                    TotalQuery c = new TotalQuery();
                    c.InsertDetails(tbr);
                    // this.total = totalnav;


                    // decimal tot ;
                    // tot =+ totalnew ;
                    // total.Text = c.GetTotal() + "";
                    // decimal tax = 15;
                    total.Text = c.GetTotal() + "";
                    decimal tota = Convert.ToDecimal(total.Text);
                    // gandtot.Text = Convert.ToString(tota + tax);
                    // ItemInfo.Text += Convert.ToString(id);
                    // cartone.SelectedItem += ItemInfo.Text;
                    cartone.ItemsSource = update_Item;

                    // DisplayAlert("item IDs", ItemInfo.Text, "OK");

                    // cartone.IsPullToRefreshEnabled = true;
                    GetJSON();

                    //long freeMemory = Java.Lang.Runtime.GetRuntime().FreeMemory();
                    //DisplayAlert("freemomory", Convert.ToString(freeMemory), "OK");
                }
                catch (Exception ex)
                {
                    // Console.WriteLine("An error occurred: '{0}'", ex);
                }
            }

            else
            {
                // write your code if there is no Internet available

                DisplayAlert("NETWORK ERROR", "SYSTEM IS OFFLINE", "Ok");
            }
        }