Exemplo n.º 1
0
        public void itemTapped(object sender, System.EventArgs args)
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                Service serviceID = (Service)ServiceListview.SelectedItem;
                //Service s = new Service();
                //s.serviceID = serviceID.serviceID;
                //s.branchID = serviceID.branchID;

                //var answer = await DisplayAlert(Utils.getLabel(LabelConstants.MAIN_PAGE_BOOKING), Utils.getLabel(LabelConstants.SERVICE_PAGE_CONFIRMBOOKING) + " " + serviceID.serviceName​, "Yes", "No");
                //if (answer == true)
                //{
                //UIReturn ChkQ = ReserveQController.getInstance().reserveQueue(s);
                UIReturn ChkQ = ReserveQController.getInstance().reserveQueue(serviceID);
                if (!ChkQ.isSuccess)
                {
                    App.TextSearch = "";
                    DisplayAlert(App.AppicationName, ChkQ.getDescription(), "Close");
                    SessionModel.bookingQ = null;
                }
                else
                {
                    App.RePage     = false;
                    App.TextSearch = "";
                    //App.timerStart();
                    Navigation.PushAsync(new MainPage());
                }
                //}
            }
            else
            {
                DisplayAlert(App.AppicationName, App.NoInternet, "Close");
            }
        }
Exemplo n.º 2
0
        public void OnImageDelete(object sender, System.EventArgs args)
        {
            if (SessionModel.bookingQ != null)
            {
                DependencyService.Get <IFNotification>().SendNotification("คิวเลขที่ " + SessionModel.bookingQ.queueNumber, "ยกเลิกการจองคิวแล้ว");

                UIReturn uiReturn = ReserveQController.getInstance().cancelQueue(SessionModel.bookingQ);
                if (uiReturn.isSuccess)
                {
                    App.fristtime  = true;
                    App.timercheck = false;
                    CountstartQ    = false;
                    Navigation.PushAsync(new MainPage());
                    App.Massage0  = true;
                    App.Massage5  = true;
                    App.Massage15 = true;
                }
                else
                {
                    App.timercheck = false;
                    CountstartQ    = false;
                    DisplayAlert("", uiReturn.getDescription(), "Close");
                }
            }
        }
Exemplo n.º 3
0
        private void reserveQ()
        {
            Service s = new Service();

            s.serviceID = "0001";
            s.branchID  = "01";
            UIReturn result = ReserveQController.getInstance().reserveQueue(s);
        }
Exemplo n.º 4
0
        async void OnImageDelete(object sender, System.EventArgs args)
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                if (App.RePagemain == true)
                {
                    App.RePagemain = false;
                    await Navigation.PushAsync(new MainPage());
                }
                else
                {
                    App.TextSearch = "";
                    if (SessionModel.bookingQ != null)
                    {
                        var answer = await DisplayAlert(Utils.getLabel(LabelConstants.MAIN_PAGE_CANCEL), Utils.getLabel(LabelConstants.MAIN_PAGE_CONFIRMCANCEL) + " " + SessionModel.bookingQ.queueNumber, "Yes", "No");

                        if (answer == true)
                        {
                            DependencyService.Get <IFNotification>().SendNotification(Utils.getLabel(LabelConstants.MAIN_PAGE_YOURQUEUE) + " " + SessionModel.bookingQ.queueNumber, " " + Utils.getLabel(LabelConstants.MAIN_PAGE_BOOKINGCANCEL));

                            UIReturn uiReturn = ReserveQController.getInstance().cancelQueue(SessionModel.bookingQ);
                            if (uiReturn.isSuccess)
                            {
                                App.fristtime  = true;
                                App.timercheck = false;
                                CountstartMain = false;
                                //Navigation.PushAsync(new MainPage());
                                App.Massage0          = true;
                                App.Massage5          = true;
                                App.Massage15         = true;
                                TimesQ.Text           = "00:00:00";
                                NumberQ.Text          = "-";
                                NumberQ2.Text         = "-";
                                DetailQ.Text          = "";
                                btn_cancel.IsVisible  = false;
                                btn_cancel2.IsVisible = false;

                                b_booking1.IsVisible = true;
                                b_booking2.IsVisible = false;
                                b_qr1.IsVisible      = true;
                                b_qr2.IsVisible      = false;
                            }
                            else
                            {
                                App.timercheck = false;
                                CountstartMain = false;
                                await DisplayAlert(App.AppicationName, uiReturn.getDescription(), "Close");
                            }
                        }
                    }
                }
            }
            else
            {
                App.RePagemain = false;
                await DisplayAlert(App.AppicationName, App.NoInternet, "Close");
            }
        }
Exemplo n.º 5
0
        public static void init_Member()
        {
            if (Constants.isAppForMember())
            {
                TempDB.setProvinces();
                TempDB.setDistrict();
                TempDB.setBranches();
                TempDB.setServices();

                SessionModel.loginMember = getMemberFormDB();
                if (SessionModel.loginMember != null)
                {
                    UIReturn uiReturn = ReserveQController.getInstance().getMemberSession(SessionModel.loginMember);
                }
            }
        }
Exemplo n.º 6
0
        public void OnImageJoin1(object sender, System.EventArgs args)
        {
            Service s = new Service();

            s.serviceID = searchServece.serviceID;
            s.branchID  = searchServece.branchID;
            UIReturn ChkQ = ReserveQController.getInstance().reserveQueue(s);

            if (!ChkQ.isSuccess)
            {
                DisplayAlert("", ChkQ.getDescription(), "Close");
                SessionModel.bookingQ = null;
            }
            else
            {
                App.timerStart();
                Navigation.PushAsync(new QueuePage());
            }
        }
Exemplo n.º 7
0
 public void OnImageRating4(object sender, System.EventArgs args)
 {
     if (CrossConnectivity.Current.IsConnected)
     {
         SessionModel.bookingQ.rank = "5";
         UIReturn uiReturn = ReserveQController.getInstance().ratingStaff(SessionModel.bookingQ);
         if (uiReturn.isSuccess)
         {
             App.Massage0  = true;
             App.Massage5  = true;
             App.Massage15 = true;
             Navigation.PushAsync(new MainPage());
         }
         else
         {
             DisplayAlert(App.AppicationName, uiReturn.getDescription(), "Close");
         }
     }
     else
     {
         DisplayAlert(App.AppicationName, App.NoInternet, "Close");
     }
 }
Exemplo n.º 8
0
        public void Process()
        {
            CountstartMain = true;
            Service s = new Service();

            s.serviceID = SessionModel.bookingQ.serviceID;
            s.branchID  = SessionModel.bookingQ.branchID;
            UIReturn ChkQueue = ReserveQController.getInstance().reserveQueue(SessionModel.bookingQ);

            if (App.fristtime)
            {
                App.fristtime  = false;
                ChkTime        = SessionModel.bookingQ.estimateTime.GetHashCode() * 60;
                App.timercount = ChkTime;
                if (App.timercount < 900)
                {
                    App.Massage15 = false;
                }
            }

            if (App.RePage == false)
            {
                Device.StartTimer(new TimeSpan(0, 0, 1), () =>
                {
                    if (SessionModel.bookingQ != null)
                    {
                        if (CrossConnectivity.Current.IsConnected)
                        {
                            if (CountstartMain == true)
                            {
                                App.Recount = App.Recount + 1;
                            }

                            TimeSpan time = TimeSpan.FromSeconds(App.timercount);

                            TimesQ.Text = time.ToString(@"hh\:mm\:ss");
                            if (App.timercount == 0)
                            {
                                App.Massage15 = false;
                                App.Massage5  = false;
                            }

                            if (App.timercount <= 900 && App.Massage15 == true)
                            {
                                DependencyService.Get <IFNotification>().SendNotification(Utils.getLabel(LabelConstants.MAIN_PAGE_YOURQUEUE) + " " + SessionModel.bookingQ.queueNumber, Utils.getLabel(LabelConstants.MAIN_PAGE_NOTIFICATION1));
                                App.Massage15 = false;
                            }

                            if (App.timercount == 300 && App.Massage5 == true)
                            {
                                DependencyService.Get <IFNotification>().SendNotification(Utils.getLabel(LabelConstants.MAIN_PAGE_YOURQUEUE) + " " + SessionModel.bookingQ.queueNumber, Utils.getLabel(LabelConstants.MAIN_PAGE_NOTIFICATION2));
                                App.Massage5 = false;
                            }

                            if (App.timercount == 0 && App.Massage0 == true)
                            {
                                DependencyService.Get <IFNotification>().SendNotification(Utils.getLabel(LabelConstants.MAIN_PAGE_YOURQUEUE) + " " + SessionModel.bookingQ.queueNumber, String.Format(ChkQueue.getDescription(), SessionModel.bookingQ.queueBefore));
                                App.Massage0 = false;
                            }

                            if (!ChkQueue.isSuccess)
                            {
                                DisplayAlert(App.AppicationName, ChkQueue.getDescription(), "Close");
                                TimesQ.Text    = "00:00:00";
                                App.timercheck = false;
                            }
                            else
                            {
                                DetailQ.Text  = String.Format(ChkQueue.getDescription(), SessionModel.bookingQ.queueBefore);
                                NumberQ.Text  = SessionModel.bookingQ.queueNumber;
                                NumberQ2.Text = SessionModel.bookingQ.queueBefore.ToString();
                                if (SessionModel.loginMember != null)
                                {
                                    UserNames.Text = Utils.getLabel(LabelConstants.MAIN_PAGE_HELLO) + " " + SessionModel.loginMember.firstName + "  " + SessionModel.loginMember.lastName;
                                }

                                Main_History.Text = Utils.getLabel(LabelConstants.MAIN_PAGE_HISTORY);
                                Main_Booking.Text = Utils.getLabel(LabelConstants.MAIN_PAGE_BOOKING);
                                Main_QR.Text      = Utils.getLabel(LabelConstants.MAIN_PAGE_QR);
                                YourQ.Text        = Utils.getLabel(LabelConstants.MAIN_PAGE_YOURQUEUE);
                                AllQ.Text         = Utils.getLabel(LabelConstants.MAIN_PAGE_ALLQUEUE);
                                WaitTime.Text     = Utils.getLabel(LabelConstants.MAIN_PAGE_WATETIME);

                                if (App.Thai == true)
                                {
                                    btn_cancel.IsVisible  = false;
                                    btn_cancel2.IsVisible = true;
                                }
                                else
                                {
                                    btn_cancel.IsVisible  = true;
                                    btn_cancel2.IsVisible = false;
                                }

                                if (App.timercount == 0)
                                {
                                    TimesQ.Text = "00:00:00";
                                }
                            }

                            if (App.Recount == App.TimeReface)
                            {
                                App.Recount = 0;

                                Queue Queue = (Queue)ReserveQController.getInstance().reserveQueue(SessionModel.bookingQ).returnObject;
                                ChkTime2    = SessionModel.bookingQ.estimateTime * 60;


                                if (ChkTime2 < App.timercount)
                                {
                                    ChkTime        = SessionModel.bookingQ.estimateTime * 60;
                                    App.timercount = SessionModel.bookingQ.estimateTime * 60;
                                    NumberQ2.Text  = SessionModel.bookingQ.queueBefore.ToString();
                                }
                                else
                                {
                                    if (App.timercount == 0)
                                    {
                                        App.timercount = ChkTime2;
                                    }
                                }

                                ChkQueue = ReserveQController.getInstance().reserveQueue(SessionModel.bookingQ);
                                if (!ChkQueue.isSuccess)
                                {
                                    App.timercheck = false;
                                    DisplayAlert(App.AppicationName, ChkQueue.getDescription(), "Close");
                                    TimesQ.Text = "00:00:00";
                                }
                                else
                                {
                                    if (ChkQueue.id == 58)
                                    {
                                        DependencyService.Get <IFNotification>().SendNotification(Utils.getLabel(LabelConstants.MAIN_PAGE_YOURQUEUE) + " " + SessionModel.bookingQ.queueNumber, ChkQueue.getDescription());
                                        DetailQ.Text   = ChkQueue.getDescription();
                                        App.timercheck = false;
                                        CountstartMain = false;
                                        App.fristtime  = true;
                                        Navigation.PushAsync(new RatingPage());
                                        TimesQ.Text          = "00:00:00";
                                        b_booking1.IsVisible = true;
                                        b_booking2.IsVisible = false;
                                        b_qr1.IsVisible      = true;
                                        b_qr2.IsVisible      = false;
                                    }
                                    else if (ChkQueue.id == 63)
                                    {
                                        DependencyService.Get <IFNotification>().SendNotification(Utils.getLabel(LabelConstants.MAIN_PAGE_YOURQUEUE) + " " + SessionModel.bookingQ.queueNumber, ChkQueue.getDescription());
                                        SessionModel.clearQueue();
                                        DetailQ.Text          = ChkQueue.getDescription();
                                        NumberQ.Text          = "-";
                                        App.timercheck        = false;
                                        CountstartMain        = false;
                                        App.fristtime         = true;
                                        TimesQ.Text           = "00:00:00";
                                        b_booking1.IsVisible  = true;
                                        b_booking2.IsVisible  = false;
                                        b_qr1.IsVisible       = true;
                                        b_qr2.IsVisible       = false;
                                        btn_cancel.IsVisible  = false;
                                        btn_cancel2.IsVisible = false;
                                    }
                                    else
                                    {
                                        if (SessionModel.bookingQ != null)
                                        {
                                            DetailQ.Text = String.Format(ChkQueue.getDescription(), SessionModel.bookingQ.queueBefore);
                                        }
                                    }
                                }
                            }
                        }
                    }
                    return(App.timercheck);
                });
            }
        }
Exemplo n.º 9
0
        public void Process()
        {
            Service s = new Service();

            s.serviceID = SessionModel.bookingQ.serviceID;
            s.branchID  = SessionModel.bookingQ.branchID;
            UIReturn ChkQueue = ReserveQController.getInstance().reserveQueue(SessionModel.bookingQ);

            if (App.fristtime)
            {
                ChkTime        = SessionModel.bookingQ.estimateTime.GetHashCode() * 60;
                App.fristtime  = false;
                App.timercount = ChkTime;
                if (App.timercount < 900)
                {
                    App.Massage15 = false;
                }
            }

            Device.StartTimer(new TimeSpan(0, 0, 1), () =>
            {
                if (SessionModel.bookingQ != null)
                {
                    if (CountstartQ == true)
                    {
                        App.Recount = App.Recount + 1;
                    }

                    TimeSpan time = TimeSpan.FromSeconds(App.timercount);

                    TimesQ.Text = time.ToString(@"hh\:mm\:ss");

                    if (App.timercount <= 900 && App.Massage15 == true)
                    {
                        DependencyService.Get <IFNotification>().SendNotification("คิวเลขที่ " + SessionModel.bookingQ.queueNumber, "อีก 15 นาทีจะถึงคิวของคุณ");
                        App.Massage15 = false;
                    }

                    if (App.timercount <= 300 && App.Massage5 == true)
                    {
                        DependencyService.Get <IFNotification>().SendNotification("คิวเลขที่ " + SessionModel.bookingQ.queueNumber, "อีก 5 นาทีจะถึงคิวของคุณ");
                        App.Massage5 = false;
                    }

                    if (App.timercount == 0 && App.Massage0 == true)
                    {
                        DependencyService.Get <IFNotification>().SendNotification("คิวเลขที่ " + SessionModel.bookingQ.queueNumber, String.Format(ChkQueue.getDescription(), SessionModel.bookingQ.queueBefore));
                        App.Massage0 = false;
                    }

                    if (!ChkQueue.isSuccess)
                    {
                        App.timercheck = false;
                        DisplayAlert("", ChkQueue.getDescription(), "Close");
                        TimesQ.Text = "00:00:00";
                    }
                    else
                    {
                        if (SessionModel.bookingQ != null)
                        {
                            DetailQ.Text = String.Format(ChkQueue.getDescription(), SessionModel.bookingQ.queueBefore);
                        }

                        if (App.timercount == 0)
                        {
                            TimesQ.Text = "00:00:00";
                        }
                    }

                    if (App.Recount == 10)
                    {
                        App.Recount = 0;

                        Queue Queue = (Queue)ReserveQController.getInstance().reserveQueue(SessionModel.bookingQ).returnObject;
                        ChkTime2    = SessionModel.bookingQ.estimateTime.GetHashCode() * 60;
                        if (ChkTime2 < App.timercount)
                        {
                            ChkTime        = SessionModel.bookingQ.estimateTime.GetHashCode() * 60;
                            App.timercount = SessionModel.bookingQ.estimateTime.GetHashCode() * 60;
                        }

                        ChkQueue = ReserveQController.getInstance().reserveQueue(SessionModel.bookingQ);
                        if (!ChkQueue.isSuccess)
                        {
                            App.timercheck = false;
                            DisplayAlert("", ChkQueue.getDescription(), "Close");
                            TimesQ.Text = "00:00:00";
                        }
                        else
                        {
                            if (ChkQueue.id == 58)
                            {
                                DependencyService.Get <IFNotification>().SendNotification("คิวเลขที่ " + SessionModel.bookingQ.queueNumber, ChkQueue.getDescription());
                                DetailQ.Text   = ChkQueue.getDescription();
                                App.timercheck = false;
                                CountstartQ    = false;
                                Navigation.PushAsync(new RatingPage());
                                TimesQ.Text = "00:00:00";
                            }
                            else if (ChkQueue.id == 63)
                            {
                                DependencyService.Get <IFNotification>().SendNotification("คิวเลขที่ " + SessionModel.bookingQ.queueNumber, ChkQueue.getDescription());
                                DetailQ.Text = ChkQueue.getDescription();
                                SessionModel.clearQueue();
                                NumberQ.Text   = "-";
                                App.timercheck = false;
                                CountstartQ    = false;
                                Navigation.PushAsync(new MainPage());
                                TimesQ.Text = "00:00:00";
                            }
                            else
                            {
                                if (SessionModel.bookingQ != null)
                                {
                                    DetailQ.Text = String.Format(ChkQueue.getDescription(), SessionModel.bookingQ.queueBefore);
                                }
                            }
                        }
                    }
                }
                return(App.timercheck);
            });
        }