Ejemplo n.º 1
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.º 2
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.º 3
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.º 4
0
 public async Task Logout()
 {
     U.Logout();
     await NavFunc.RestartApp();
 }