private void ShowSection(Section section)
        {
            if (section is TopicSection)
            {
                ViewModelNavigator.PushAsync(new TopicPageViewModel(section.SectionId));
                return;
            }

            var telSection = section as TelSection;

            if (telSection != null)
            {
                //Device.OpenUri(new Uri(string.Format("tel:{0}", telSection.PhoneNumber)));
                ViewModelNavigator.PushAsync(new TopicPageViewModel("Calling...", telSection.PhoneNumber));
                return;
            }

            if (section is EndSection)
            {
                return;
            }

            if (section.HasSubSections)
            {
                ViewModelNavigator.PushAsync(new SectionPageViewModel(section.SectionId));
                return;
            }
        }
Esempio n. 2
0
        public async void Login()
        {
            IsBusy         = true;
            LoadingMessage = "Authenticating, please wait.";
            await Task.Delay(2000);

            await AccountsRepository.Login(new Services.DTO.LoginModelDTO()
            {
                Username = LoginModel.UserName,
                Password = LoginModel.Password
            })
            .ContinueWith(task =>
            {
                if (task.Status == TaskStatus.RanToCompletion)
                {
                    IsBusy   = false;
                    var data = task.Result;

                    LoadingMessage = data.responsemsg;

                    if (data.responsecode == 1)
                    {
                        LoginModel.Password = null;
                        LoadingMessage      = string.Empty;
                        ViewModelNavigator.NavigateToView("Main");
                    }
                }
            });
        }
Esempio n. 3
0
        public void Register()
        {
            IsBusy         = true;
            LoadingMessage = "Please wait";

            AccountsRepository.SignUp(
                new Services.DTO.RegisterAccountModelDTO()
            {
                UserName      = RegisterModel.UserName,
                Password      = RegisterModel.Password,
                FirstName     = RegisterModel.FirstName,
                LastName      = RegisterModel.LastName,
                Address       = RegisterModel.Address,
                ContactNumber = RegisterModel.ContactNumber,
                Email         = RegisterModel.Email
            }).ContinueWith(async task =>
            {
                if (task.Status == TaskStatus.RanToCompletion)
                {
                    var data = task.Result;


                    if (data.responsecode == 1)
                    {
                        IsBusy         = false;
                        LoadingMessage = "Account Created!";
                        await Task.Delay(3000);
                        ViewModelNavigator.NavigateToView("AddJobProfile");
                    }
                    else
                    {
                        IsBusy         = false;
                        LoadingMessage = data.responsemsg;
                    }
                }
            });
        }
Esempio n. 4
0
        public void AddProfile()
        {
            IsBusy = true;
            ProfileRepository.AddJobProfile(new AddJobProfileModelDTO
            {
                End_date       = AddJobProfileModel.End_date,
                Id_user        = 1,
                Job_title      = AddJobProfileModel.Job_title,
                Is_current_job = true,
                Start_date     = AddJobProfileModel.Start_date,
                Id_job         = 1,
                Id_image_url   = null
            }).ContinueWith(async task =>
            {
                var data = task.Result;

                if (data.responsecode == 1)
                {
                    IsBusy         = false;
                    LoadingMessage = "Success";
                    ViewModelNavigator.NavigateToView("Main");
                }
            });
        }
Esempio n. 5
0
 private void ShowSectionPage(string sectionId)
 {
     ViewModelNavigator.PushAsync(new SectionPageViewModel(sectionId));
 }
 private void Back()
 {
     ViewModelNavigator.PopAsync();
 }
Esempio n. 7
0
 public void GotoRegister()
 {
     ViewModelNavigator.NavigateToView("Register");
 }
Esempio n. 8
0
 public void GotoLogin()
 {
     ViewModelNavigator.NavigateToView("Login");
 }
Esempio n. 9
0
 public MainWindow()
 {
     InitializeComponent();
     DataContext        = new ViewModelNavigator();
     tempDG.ItemsSource = context.Recipes.ToList();
 }