async Task OpenPatientOrderItem(PatientOrderItem item)
        {
            if (item != null)
            {
                SetSelectedPatientOrderItem(item);
            }

            var vmodel = new UserOrderViewModel
            {
                OrderRowId     = this.OrderRowId,
                IsShowListMode = false,
                InitSelectedPatientOrderItemRowId = item?.RowId,
            };
            await NavFunc.NavigateToAsync(vmodel);

            this.SubscribeOnClosed(vmodel, async() =>
            {
                if (vmodel.IsCommit)
                {
                    if (!await LoadData())
                    {
                        return;
                    }
                    CalcAll();
                }
            });
        }
Ejemplo n.º 2
0
        async Task ItemOpen(Order item)
        {
            SetSelectedPatientOrderItem(item);

            var viewModel = new UserOrderViewModel
            {
                OrderRowId = item.RowId,
            };
            await NavFunc.NavigateToAsync(viewModel);
        }
Ejemplo n.º 3
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.º 4
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();
            }
        }
        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.º 6
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.º 7
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();
        }
        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.º 9
0
 public async static Task OpenPage()
 {
     var viewModel = new ChangePasswordViewModel();
     await NavFunc.NavigateToAsync(viewModel);
 }
Ejemplo n.º 10
0
 public async Task Register()
 {
     var viewModel = new ProfileViewModel();
     await NavFunc.NavigateToAsync(viewModel);
 }
Ejemplo n.º 11
0
 public async static Task OpenPage()
 {
     var viewModel = new LoginViewModel();
     await NavFunc.NavigateToAsync(viewModel);
 }
Ejemplo n.º 12
0
 public async Task Logout()
 {
     U.Logout();
     await NavFunc.RestartApp();
 }
Ejemplo n.º 13
0
 public override async Task Init()
 {
     NavFunc.RemovePages <Views.LoginView>();
     //await LoadLabours();
 }