Exemple #1
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);
        }
        async Task <bool> LoadData()
        {
            UserProfileRowId = UserOptions.GetUserProfileRowId();
            IsNewRow         = (UserProfileRowId == default(Guid));

            Model = new LoginModel
            {
                IsNewRow = true,
            };
            if (U.IsDebug)
            {
                //Model.email = "*****@*****.**"; Model.password = "******";
                Model.email = "*****@*****.**"; Model.password = "******";
            }

            SetupModel(Model);

            return(true);
        }
Exemple #3
0
        public override async Task Init()
        {
            //UserProfileRowId = new Guid("881C381C-2EEF-420B-9398-39B5190E9CEC");
            UserProfileRowId = UserOptions.GetUserProfileRowId();

            HeaderTitle   = Globalization.T("Orders");
            IsBackVisible = U.IsBackVisible;

            ItemTapCommand = new Command <ItemTapCommandContext>(ItemTap);
            NavigationBarButton1Command = CommandFunc.CreateAsync(ProfileViewModel.OpenPage);

            U.RequestMainThread(async() =>
            {
                if (!await LoadData())
                {
                    return;
                }
                CalcAll();
            });
        }