Ejemplo n.º 1
0
 public void EndFight()
 {
     fighting = false;
     entityGuids.Clear();
     //TEST
     UIFunc.GetInstance().AddMessage("战斗结束");
 }
Ejemplo n.º 2
0
        async Task <bool> LoadData()
        {
            UIFunc.ShowLoading();

            var items = await LoadOrders();

            if (items == null)
            {
                return(false);
            }

            if (!items.Any())
            {
                if (!await InsertEmptyOrder())
                {
                    return(false);
                }

                items = await LoadOrders();

                if (items == null)
                {
                    return(false);
                }
            }

            Items = items.ToObservableCollection();

            UIFunc.HideLoading();
            return(true);
        }
        public override async Task <bool> BeforePageClose()
        {
            if (!IsBackVisible)
            {
                return(false);
            }

            if (IsShowListMode)
            {
                return(true);
            }
            else
            {
                var patientOrderItemsJson = JsonConvert.SerializeObject(PatientOrderItems);
                if (patientOrderItemsJson != PatientOrderItemsJson0)
                {
                    if (!await UIFunc.ConfirmAsync(U.CloseWithoutSaving))
                    {
                        return(false);
                    }
                }

                return(true);
            }
        }
Ejemplo n.º 4
0
        public static async Task <bool> Logging()
        {
            var user = UserOptions.GetUser();

            if (string.IsNullOrEmpty(user))
            {
                return(false);
            }

            var model = new LoginModel
            {
                email    = user,
                password = UserOptions.GetPassword(),
            };

            UIFunc.ShowLoading(U.StandartLoggingText);
            var result = await WebServiceFunc.SubmitLogin(model);

            UIFunc.HideLoading();

            if (!result.Item1)
            {
                return(false);
            }

            var aspxauth = result.Item4;

            UserOptions.SetAspxauth(aspxauth);

            return(true);
        }
        //private void PropertyChangedAction(object sender, PropertyChangedEventArgs e)
        //{
        //	if (e.PropertyName == nameof())
        //}

        async Task <bool> LoadData()
        {
            UIFunc.ShowLoading();

            var task1 = WebServiceFunc.GetOrder(OrderRowId);
            var task2 = WebServiceFunc.GetInstitutionsForSchedule();
            var task3 = WebServiceFunc.GetStates(1);
            await Task.WhenAll(task1, task2, task3);

            if (task1.Result == null || task2.Result == null || task3.Result == null)
            {
                await UIFunc.AlertError(U.StandartErrorUpdateText);

                return(false);
            }

            Order           = task1.Result;
            DdlInstitutions = task2.Result.OrderBy(q => q.CompanyName).ToObservableCollection();
            DdlStates       = task3.Result.OrderBy(q => q.Name).ToArray();

            var institutionRowIds = DdlInstitutions.Select(q => q.RowId).ToArray();
            var slotTasks         = institutionRowIds.Select(q => WebServiceFunc.GetBookingSlots(q)).ToArray();
            await Task.WhenAll(slotTasks);

            if (slotTasks.Any(q => q.Result == null))
            {
                await UIFunc.AlertError(U.StandartErrorUpdateText);

                return(false);
            }

            AllBookingSlots = new Dictionary <Guid, ScheduleItemSlot[]>();
            for (int i = 0; i < institutionRowIds.Length; i++)
            {
                AllBookingSlots.Add(institutionRowIds[i], slotTasks[i].Result);
            }


            Model             = Order.UserProfile;
            PatientOrderItems = Order.Pois.OrderBy(q => q.Patient?.FullPatientName).ToObservableCollection();
            SetupPatientOrderItems(PatientOrderItems);

            PatientOrderItemsJson0 = JsonConvert.SerializeObject(PatientOrderItems);

            if (IsShowFromMode)
            {
                SelectedPatientOrderItem = PatientOrderItems.SingleOrDefault(q => q.RowId == InitSelectedPatientOrderItemRowId);
                if (SelectedPatientOrderItem == null)
                {
                    IsNewRow = true;
                    await InitNewPatient();
                }
                PatientHeaderModels[General].IsExpanded = true;
            }

            UIFunc.HideLoading();

            return(true);
        }
Ejemplo n.º 6
0
        public override async Task <bool> BeforePageClose()
        {
            if (isLogoutClose)
            {
                return(true);
            }

            if (!await UIFunc.ConfirmAsync("Exit from application?"))
            {
                return(false);
            }

            UIFunc.ExitApp();
            return(false);
        }
Ejemplo n.º 7
0
        public async Task Commit()
        {
            UIFunc.ShowLoading(U.StandartUpdatingText);
            var result = await WebServiceFunc.UpdatePassword(Model);

            UIFunc.HideLoading();

            if (!result.Item1)
            {
                await UIFunc.AlertError(U.GetErrorUpdateText(result.Item2));

                return;
            }

            await NavFunc.RestartApp();
        }
Ejemplo n.º 8
0
        async Task <bool> LoadData()
        {
            UserProfileRowId = UserOptions.GetUserProfileRowId();
            IsNewRow         = (UserProfileRowId == default(Guid));

            UIFunc.ShowLoading();

            var newModel = new UserProfile
            {
                IsNewRow = true,
                Type     = 1,
            };

            if (U.IsDebug)
            {
                newModel.FirstName            = "Test1";
                newModel.LastName             = "Test1";
                newModel.AddressLine1         = "AddressLine1";
                newModel.City                 = "City1";
                newModel.ProvinceOrStateRowId = new Guid("75D55A3F-FD2E-4EBA-A597-53E5A5BE532C");
                newModel.Postcode             = "Postcode1";
                newModel.Phone                = "123-45-67";
                newModel.Email                = "*****@*****.**";
                newModel.Password             = "******";
                newModel.PasswordRepeat       = "123456";
            }

            var task1 = !IsNewRow?WebServiceFunc.GetProfile(UserProfileRowId) : Task.FromResult(newModel);

            var task3 = WebServiceFunc.GetStates(1);
            await Task.WhenAll(task1, task3);

            if (task1.Result == null || task3.Result == null)
            {
                await UIFunc.AlertError(U.StandartErrorUpdateText);

                return(false);
            }

            DdlStates = task3.Result.OrderBy(q => q.Name).ToArray();

            Model = task1.Result;
            SetupModel(Model);

            UIFunc.HideLoading();
            return(true);
        }
Ejemplo n.º 9
0
        public async Task Commit()
        {
            if (IsNewRow)
            {
                var order = new Order
                {
                    IsNew       = true,
                    UserProfile = Model,
                    Pois        = new List <PatientOrderItem>(),
                };

                UIFunc.ShowLoading(U.StandartUpdatingText);
                var result = await WebServiceFunc.SubmitRegister(order);

                UIFunc.HideLoading();

                if (!result.Item1)
                {
                    await UIFunc.AlertError(U.GetErrorUpdateText(result.Item2));

                    return;
                }

                var userProfileRowId = result.Item3.UserProfileRowId;
                UserOptions.SetUsernamePassword(Model.Email, Model.Password, userProfileRowId);

                //NavFunc.RemovePages<Views.ProfileView>();
                //var viewmodel = new UserOrderListViewModel();
                //await NavFunc.NavigateToAsync(viewmodel);
                await NavFunc.RestartApp();
            }
            else
            {
                var userProfileRowId = await WebServiceFunc.CreateOrUpdateProfile(Model);

                UIFunc.HideLoading();

                if (userProfileRowId == default(Guid))
                {
                    await UIFunc.AlertError(U.StandartErrorUpdateText);

                    return;
                }

                await NavFunc.Pop();
            }
        }
Ejemplo n.º 10
0
        private UIManager()
        {
            _PathDictionary  = new Dictionary <UIType, string>();
            _PlaneDictionary = new Dictionary <UIType, UIPlane>();
            _CanvasTransform = GameObject.Find(UIConfig.UICanvasTransformName).transform;

            if (!UIConfig.LoadForAssetBundle)
            {
                _GetUIFunc += ShowUI;
            }
            else
            {
                //监听LoadAssetBundle的UI
            }

            LoadJson();
        }
        public async Task PatientDelete()
        {
            if (SelectedPatientOrderItem == null)
            {
                return;
            }
            if (!await UIFunc.ConfirmAsync($"Delete row \"{SelectedPatientOrderItem.Patient.FullPatientName}\"?"))
            {
                return;
            }

            await Delete();

            //PatientOrderItems.Remove(SelectedPatientOrderItem);
            //SelectedPatientOrderItem = PatientOrderItems.FirstOrDefault();
            //CalcAll();
        }
        async Task Delete()
        {
            UIFunc.ShowLoading(U.StandartUpdatingText);
            var result = await WebServiceFunc.RemovePatientOrderItem(SelectedPatientOrderItem);

            UIFunc.HideLoading();

            if (!result.Item1)
            {
                await UIFunc.AlertError(U.StandartErrorUpdateText);

                return;
            }

            IsCommit = true;
            await NavFunc.Pop(forceClose : true);
        }
Ejemplo n.º 13
0
        async Task <Order[]> LoadOrders()
        {
            var task1 = WebServiceFunc.GetUserOrders(UserProfileRowId);
            await Task.WhenAll(task1);

            if (task1.Result == null)
            {
                await UIFunc.AlertError(U.StandartErrorUpdateText);

                return(null);
            }

            var items = task1.Result;

            SetupItems(items);

            return(items);
        }
Ejemplo n.º 14
0
        public void Clear()
        {
            if (UIConfig.CanClearUIForAuto)
            {
                _PlaneDictionary.Clear();
                _PathDictionary.Clear();
            }


            if (!UIConfig.LoadForAssetBundle)
            {
                _GetUIFunc -= ShowUI;
            }
            else
            {
                //......
            }

            _GetUIFunc = null;
        }
Ejemplo n.º 15
0
        async Task Logout()
        {
            if (!await UIFunc.ConfirmAsync("Logout?"))
            {
                return;
            }

            isLogoutClose = true;
            var ret = await NavFunc.PopToRootAsync();

            isLogoutClose = false;

            if (!ret)
            {
                return;
            }

            UserOptions.Clear();
            var model = new LoginViewModel();
            await NavFunc.NavigateToAsync(model);
        }
Ejemplo n.º 16
0
        async public Task <Boolean> Run(string businessCode, string username, string password)
        {
            //var rezz = await WebServiceFunc.Login(businessCode, username, password);

            UIFunc.ShowLoading("Authorization...");
            var url0 = "Authenticate?businessCode=" + Uri.EscapeDataString(businessCode)
                       + "&username="******"&password="******"Error in authorization procedure");

                return(false);
            }

            var result = WebServiceFunc.DeserializeObjectFromStream <AuthenticateReturn>(rez.Value);

            if (!String.IsNullOrEmpty(result.Error))
            {
                UIFunc.HideLoading();
                await UIFunc.AlertError(result.Error);

                return(false);
            }

            var optrow = UserOptions.GetCurrent();

            optrow.Username      = username;
            optrow.Password      = password;
            optrow.UserRowId     = result.UserRowId;
            optrow.BusinessRowId = result.BusinessRowId;
            optrow.BusinessCode  = result.BusinessCode;
            DB.Update(optrow);

            UIFunc.HideLoading();
            return(true);
        }
        public async Task Commit()
        {
            var norder = JsonConvert.DeserializeObject <Order>(JsonConvert.SerializeObject(Order));

            norder.Pois = PatientOrderItems.ToList();

            UIFunc.ShowLoading(U.StandartUpdatingText);
            var result = await WebServiceFunc.SaveOrder(norder);

            UIFunc.HideLoading();

            if (!result.Item1)
            {
                await UIFunc.AlertError(U.StandartErrorUpdateText);

                return;
            }

            var newOrder = result.Item2;

            IsCommit = true;
            await NavFunc.Pop(forceClose : true);
        }
Ejemplo n.º 18
0
        public async Task Commit()
        {
            UIFunc.ShowLoading(U.StandartLoggingText);
            var result = await WebServiceFunc.SubmitLogin(Model);

            UIFunc.HideLoading();

            if (!result.Item1)
            {
                var errtext = (string.IsNullOrEmpty(result.Item3) ? Globalization.T("(!)LoginError") : result.Item3);
                await UIFunc.AlertError(errtext);

                return;
            }

            var userProfileRowId = result.Item2.Value;
            var aspxauth         = result.Item4;

            UserOptions.SetUsernamePassword(Model.email, Model.password, userProfileRowId);
            UserOptions.SetAspxauth(aspxauth);

            await NavFunc.RestartApp();
        }
Ejemplo n.º 19
0
 protected void setInfo()
 {
     UIFunc.GetInstance().setInfo(this);
 }
Ejemplo n.º 20
0
 // -------------ATTRS--------------end
 // -------show Message-----begin
 protected void AddMessage(string msg)
 {
     UIFunc.GetInstance().AddMessage(msg);
 }