Example #1
0
        private void getDistrict()
        {
            Province p = new Province();

            p.provinceID = "01";
            UIReturn result = SearchController.getInstance().getDistricts(p);
        }
        public SummaryPage(Service selectedService, Branch selectedBranch)
        {
            InitializeComponent();

            searchServece = selectedService;
            searchBranch  = (Branch)SearchController.getInstance().getBranchDetail(selectedBranch).returnObject;
        }
Example #3
0
        private void getBranchQ()
        {
            Branch b = new Branch();

            b.branchID = "01";
            UIReturn result = SearchController.getInstance().getBranchQueue(b);
        }
        public void gennaratepicker()
        {
            //List<Province> provinces = (List<Province>)SearchController.getInstance().getProvinces().returnObject;
            //foreach (Province p in provinces)
            //{
            //	ColumnPicker.Items.Add(p.provinceNameTh);

            //}
            //ColumnPicker.Unfocused += (sender, args) =>
            //{
            //	if (ColumnPicker.SelectedIndex >= 0)
            //	{
            //		Province p = provinces.ToArray()[ColumnPicker.SelectedIndex];
            //		List<District> districts = (List<District>)SearchController.getInstance().getDistricts(p).returnObject;
            //		ColumnPicker2.Items.Clear();
            //		searchDistrict = new District();
            //		foreach (District d in districts)
            //		{
            //			ColumnPicker2.Items.Add(d.districtNameTh);
            //		}
            //		searchProvince = p;
            //		ColumnPicker2.Unfocused += (sender2, args2) =>
            //		{
            //			if (ColumnPicker2.SelectedIndex >= 0)
            //			{
            //				District d = districts.ToArray()[ColumnPicker2.SelectedIndex];
            //				searchDistrict = d;
            //			}
            //		};
            //	}
            //};

            if (App.TextSearch != "")
            {
                var searchtxt = App.TextSearch.Trim();
                mSearchEntry.Text = searchtxt;
                UIReturn      uiR    = SearchController.getInstance().getBranches(searchtxt);
                List <Branch> Branch = (List <Branch>)uiR.returnObject;
                BranchView.ItemsSource = Branch;
                if (!uiR.isSuccess)
                {
                    DisplayAlert(App.AppicationName, uiR.getDescription(), "Cancel");
                }
            }
            else
            {
                var           searchtxt = "";
                UIReturn      uiR       = SearchController.getInstance().getBranches(searchtxt);
                List <Branch> Branch    = (List <Branch>)uiR.returnObject;
                BranchView.ItemsSource = Branch;
                if (!uiR.isSuccess)
                {
                    DisplayAlert(App.AppicationName, uiR.getDescription(), "Cancel");
                }
            }
        }
Example #5
0
        public ServicePage(Branch selectedBranch)
        {
            InitializeComponent();

            if (CrossConnectivity.Current.IsConnected)
            {
                getService(selectedBranch);
                branchName.Text = selectedBranch.branchName;
                searchBranch    = (Branch)SearchController.getInstance().getBranchDetail(selectedBranch).returnObject;
            }
        }
Example #6
0
        private void getBranch()
        {
            Province p = new Province();

            p.provinceID = "01";
            District d = new District();

            d.districtID = "01";
            UIReturn result = SearchController.getInstance().getBranches(p, d);
            //OR
            UIReturn result1 = SearchController.getInstance().getBranches("test");
        }
        public void OnImageSearch(object sender, System.EventArgs args)
        {
            //if (ColumnPicker.SelectedIndex >= 0)
            //{
            //	UIReturn uiR = SearchController.getInstance().getBranches(searchProvince, searchDistrict);
            //	List<Branch> Branch = (List<Branch>)uiR.returnObject;
            //	BranchView.ItemsSource = Branch;
            //	if (!uiR.isSuccess)
            //	{
            //		DisplayAlert("", uiR.getDescription(), "Cancel");
            //	}
            //}
            //        else if (mSearchEntry.Text != null)
            //        {
            //            var searchtxt = mSearchEntry.Text;
            //            UIReturn uiR = SearchController.getInstance().getBranches(searchtxt);
            //List<Branch> Branch = (List<Branch>)uiR.returnObject;
            //BranchView.ItemsSource = Branch;
            //if (!uiR.isSuccess)
            //{
            //	DisplayAlert("", uiR.descriptionEN, "Cancel");
            //}
            //}

            if (CrossConnectivity.Current.IsConnected)
            {
                if (mSearchEntry.Text != null)
                {
                    var searchtxt = mSearchEntry.Text;
                    App.TextSearch = searchtxt;
                    UIReturn      uiR    = SearchController.getInstance().getBranches(searchtxt);
                    List <Branch> Branch = (List <Branch>)uiR.returnObject;
                    BranchView.ItemsSource = Branch;
                    if (!uiR.isSuccess)
                    {
                        DisplayAlert(App.AppicationName, uiR.getDescription(), "Cancel");
                    }
                }
            }
            else
            {
                DisplayAlert(App.AppicationName, App.NoInternet, "Close");
            }
        }
Example #8
0
        public MapViewPage(Branch selectedBranch)
        {
            InitializeComponent();

            if (CrossConnectivity.Current.IsConnected)
            {
                searchBranch       = (Branch)SearchController.getInstance().getBranchDetail(selectedBranch).returnObject;
                branchName.Text    = selectedBranch.branchName;
                branchAddress.Text = Utils.getLabel(LabelConstants.MAPVIEW_PAGE_ADDRESS) + " : " + selectedBranch.address;
                branchTel.Text     = Utils.getLabel(LabelConstants.MAPVIEW_PAGE_TEL) + " : " + selectedBranch.telNo;
                branchEmail.Text   = Utils.getLabel(LabelConstants.MAPVIEW_PAGE_EMAIL) + " : " + searchBranch.email;

                if (selectedBranch.latitude != "")
                {
                    latitude = double.Parse(selectedBranch.latitude);
                }

                if (selectedBranch.longitude != "")
                {
                    longitude = double.Parse(selectedBranch.longitude);
                }

                var pin = new CustomPin
                {
                    Pin = new Pin
                    {
                        Type     = PinType.Place,
                        Position = new Position(latitude, longitude),
                        Label    = selectedBranch.branchName,
                        Address  = selectedBranch.address
                    },
                    //Id = "Xamarin",
                    //Url = "http://xamarin.com/about/"
                };

                customMap.CustomPins = new List <CustomPin> {
                    pin
                };
                customMap.Pins.Add(pin.Pin);
                customMap.MoveToRegion(MapSpan.FromCenterAndRadius(new Position(latitude, longitude), Distance.FromMiles(1.0)));
            }
        }
        public void itemTapped(object sender, System.EventArgs args)
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                if (SessionModel.bookingQ == null || String.IsNullOrEmpty(SessionModel.bookingQ.queueNumber))
                {
                    Branch  b         = new Branch();
                    Branch  BranchID  = new Branch();
                    History BranchHis = (History)mListview.SelectedItem;
                    b.branchID = BranchHis.branchID;
                    UIReturn uiR = SearchController.getInstance().getBranchDetail(b);
                    BranchID = (Branch)uiR.returnObject;

                    Navigation.PushAsync(new ServicePage(BranchID));
                    App.TextSearch = "";
                    App.SearchID   = 1;
                }
            }
            else
            {
                DisplayAlert(App.AppicationName, App.NoInternet, "Close");
            }
        }
Example #10
0
        public void QRCode()
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                App.TextSearch = "";
                bool CheckQR = false;
                if (SessionModel.bookingQ == null || String.IsNullOrEmpty(SessionModel.bookingQ.queueNumber))
                {
                    Branch b        = new Branch();
                    Branch BranchID = new Branch();
                    double BranchNumber;
                    var    scanPage = new ZXingScannerPage();
                    scanPage.Title = "Scan QR Code";
                    // Navigate to our scanner page
                    Navigation.PushAsync(scanPage);

                    scanPage.OnScanResult += (result) =>
                    {
                        // Stop scanning
                        scanPage.IsScanning = false;

                        // Pop the page and show the result
                        Device.BeginInvokeOnMainThread(async() =>
                        {
                            await Navigation.PopAsync();
                            //await DisplayAlert("Scanned Barcode", result.Text, "OK");
                            try
                            {
                                BranchNumber = Convert.ToDouble(result.Text.Substring(1));
                                CheckQR      = true;
                            }
                            catch
                            {
                                await DisplayAlert(App.AppicationName, Utils.getLabel(LabelConstants.MAIN_PAGE_NOINFORMATION), "Close");
                                CheckQR = false;
                            }

                            if (CheckQR == true)
                            {
                                b.branchID = result.Text;
                                if (b.branchID != null || b.branchID != "")
                                {
                                    UIReturn uiR = SearchController.getInstance().getBranchDetail(b);
                                    if (!uiR.isSuccess)
                                    {
                                        await DisplayAlert(App.AppicationName, uiR.getDescription(), "Close");
                                    }
                                    else
                                    {
                                        BranchID = (Branch)uiR.returnObject;
                                        await Navigation.PushAsync(new ServicePage(BranchID));
                                        App.SearchID = 2;
                                    }
                                }
                            }
                        });
                    };

                    var options = new MobileBarcodeScanningOptions
                    {
                        AutoRotate = false,
                        UseFrontCameraIfAvailable = true,
                        TryHarder       = true,
                        PossibleFormats = new List <ZXing.BarcodeFormat>
                        {
                            ZXing.BarcodeFormat.EAN_8, ZXing.BarcodeFormat.EAN_13
                        }
                    };

                    //add options and customize page
                    scanPage = new ZXingScannerPage(options)
                    {
                        IsAnalyzing                   = true,
                        DefaultOverlayTopText         = "Align the barcode within the frame",
                        DefaultOverlayBottomText      = string.Empty,
                        DefaultOverlayShowFlashButton = true
                    };
                }
                else
                {
                    DisplayAlert(App.AppicationName, Utils.getLabel(LabelConstants.MAIN_PAGE_QBLOCK), "Close");
                }
            }
            else
            {
                DisplayAlert(App.AppicationName, App.NoInternet, "Close");
            }
        }
Example #11
0
 private void getProvince()
 {
     UIReturn result = SearchController.getInstance().getProvinces();
 }
Example #12
0
        public void getService(Branch selectedBranch)
        {
            List <Service> Service = (List <Service>)SearchController.getInstance().getBranchQueue(selectedBranch).returnObject;

            ServiceListview.ItemsSource = Service;
        }