Exemplo n.º 1
0
        private void InitialPage()
        {
            UserSessionModel.choosedBranch.branchID = UserSessionModel.loginUser.branchID;
            UIReturn       uiReturn = UserActionServiceController.getInstance().getServices(UserSessionModel.choosedBranch);
            List <Service> services = (List <Service>)uiReturn.returnObject;

            foreach (Service s in services)
            {
                String       groupID   = s.groupID;
                String       groupName = s.groupName;
                GroupService group     = new GroupService();
                group.groupID   = groupID;
                group.groupName = groupName;
                group.services  = services.FindAll(sv => sv.groupID.Equals(groupID));
                if (UserSessionModel.groupServices.FindAll(gs => gs.groupID.Equals(groupID)).Count <= 0)
                {
                    UserSessionModel.groupServices.Add(group);
                }
            }

            foreach (GroupService tempGS in UserSessionModel.groupServices)
            {
                //String showText = "";
                //foreach (Service tempS in tempGS.services)
                //{
                //    showText+=tempS.serviceName+",";
                //}
                //chooseService.Items.Add(showText.Substring(0,showText.Length-1));

                String showText = tempGS.groupName;
                chooseService.Items.Add(showText);
            }

            chooseService.Unfocused += (sender, args) =>
            {
                if (chooseService.SelectedIndex >= 0 && chooseService.SelectedIndex < UserSessionModel.groupServices.ToArray().Length)
                {
                    UserSessionModel.choosedGroup = UserSessionModel.groupServices.ToArray()[chooseService.SelectedIndex];
                }
            };

            UserQ.Text = UserSessionModel.loginUser.firstName + " " + UserSessionModel.loginUser.lastName;
        }
Exemplo n.º 2
0
        public void OnImageSubmit(object sender, System.EventArgs args)
        {
            if (CrossConnectivity.Current.IsConnected)
            {
                if (chooseCouter.SelectedItem != null)
                {
                    App.CounterUser = chooseCouter.SelectedItem.ToString();

                    UIReturn uiReturn = UserActionServiceController.getInstance().openService(UserSessionModel.choosedBranch, UserSessionModel.choosedGroup, App.CounterUser);
                    if (uiReturn.isSuccess)
                    {
                        Navigation.PushAsync(new UserActionQueuePage());
                    }
                    else
                    {
                        DisplayAlert(App.AppicationName, uiReturn.getDescription(), "cancel");
                    }
                }
            }
            else
            {
                DisplayAlert(App.AppicationName, App.NoInternet, "Close");
            }
        }