Exemplo n.º 1
0
 /// <summary>
 /// Sends result to server.
 /// </summary>
 /// <param name="selectedListBoxItem">Information about result which should be send.</param>
 public void SendResult(ResultBasicInfo selectedListBoxItem)
 {
     ProgressBar.Information = Languages.AppResources.surveyViewModel_sendingProgressTitle;
     ProgressBar.IsEnabled   = true;
     SendingInProgress       = true;
     _resultSender.Send(SurveyId, selectedListBoxItem);
 }
Exemplo n.º 2
0
        private void OnBackToEditClick(object sender, RoutedEventArgs e)
        {
            ResultBasicInfo selectedListBoxItem = (sender as MenuItem).DataContext as ResultBasicInfo;

            _filterViewModel.UnmarkSent(selectedListBoxItem);
            _filterViewModel.Filter.ReloadResult(selectedListBoxItem.Id);
        }
Exemplo n.º 3
0
        private void OnEditExistingResult(object sender, RoutedEventArgs e)
        {
            ResultBasicInfo selectedResult = (sender as MenuItem).DataContext as ResultBasicInfo;

            _lastSender = selectedResult;
            NavigationService.Navigate(new Uri(string.Format("/View/FillingSurveyPage.xaml?SurveyId={0}&resultId={1}&resultTitle={2}", selectedResult.ParentId, selectedResult.Id, selectedResult.Title), UriKind.Relative));
        }
Exemplo n.º 4
0
 /// <summary>
 /// Standard WP7 method which is running always when user navigates to page.
 /// </summary>
 /// <param name="e">NavigationService argument</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     if ((Application.Current as App).ApplicationState == App.AplicationStates.Activated)
     {
         // Do what you have to do when application is activated and change state for runing.
         (Application.Current as App).ApplicationState = App.AplicationStates.Runing;
     }
     if (_lastSender != null)
     {
         _filterViewModel.Filter.ReloadResult(_lastSender.Id);
         _lastSender = null;
     }
     if (App.AppDictionary["FilteredResults"] != null)
     {
         if ((App.AppDictionary["FilteredResults"] as ObservableCollection <ResultsFilter.GroupedOC <ResultBasicInfo> >).Count == 0)
         {
             Status.Visibility = Visibility.Visible;
         }
         else
         {
             Status.Visibility = Visibility.Collapsed;
         }
     }
     base.OnNavigatedTo(e);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Sends result to server.
 /// </summary>
 /// <param name="selectedListBoxItem">Contains information of result that was selected by user and will be send on server.</param>
 public void SendResult(ResultBasicInfo selectedListBoxItem)
 {
     ProgressBar.Information = Languages.AppResources.surveyViewModel_sendingProgressTitle;
     ProgressBar.IsEnabled   = true;
     Operations = new OperationsOnListOfResults(selectedListBoxItem.ParentId);
     IsSending  = true;
     ResultSender.Send(selectedListBoxItem.ParentId, selectedListBoxItem);
 }
Exemplo n.º 6
0
        private void OnShowResult(object sender, RoutedEventArgs e)
        {
            ResultBasicInfo selectedListBoxItem = (sender as MenuItem).DataContext as ResultBasicInfo;

            String resultId    = selectedListBoxItem.Id;
            String resultTitle = selectedListBoxItem.Title;

            NavigationService.Navigate(new Uri(string.Format("/View/PreviewSurveyPage.xaml?SurveyId={0}&resultId={1}&resultTitle={2}", _viewModel.SurveyId, resultId, resultTitle), UriKind.Relative));
        }
Exemplo n.º 7
0
        private void OnDeleteResult(object sender, RoutedEventArgs e)
        {
            YesNoMessageBox messageBox = new YesNoMessageBox();

            messageBox.Title      = Languages.AppResources.surveyPage_deleteResultQuestionTitle;
            messageBox.Message    = Languages.AppResources.surveyPage_deleteResultQuestionMessage;
            messageBox.Completed += (object YesNosender, EventArgs args) =>
            {
                if (((YesNoMessageBox)YesNosender).Response == YesNoMessageBox.MessageResponse.Yes)
                {
                    try
                    {
                        ResultBasicInfo selectedListBoxItem = (sender as MenuItem).DataContext as ResultBasicInfo;
                        _viewModel.DeleteResult(selectedListBoxItem);
                    }
                    catch (IsolatedStorageException)
                    {
                        MessageBox.Show(Languages.AppResources.surveyPage_deleteResultError);
                    }
                }
            };
            messageBox.Show();
        }
Exemplo n.º 8
0
 /// <summary>
 /// Method to unmark result as sent. After unmark result as sent user can again modify the result.
 /// </summary>
 /// <param name="result">Information about which result was selected by user.</param>
 public void UnmarkSent(ResultBasicInfo result)
 {
     Operations = new OperationsOnListOfResults(result.ParentId);
     Operations.UnmarkSentResult(result.Id);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Default contructor to initial all data in class.
 /// </summary>
 public Survey()
 {
     ResultInfo = new ResultBasicInfo();
     Categories = new List <Category>();
 }
Exemplo n.º 10
0
 /// <summary>
 /// Unmarks sent results.
 /// </summary>
 /// <param name="result">Information about result which should be unmarked.</param>
 public void UnmarkSent(ResultBasicInfo result)
 {
     _operations.UnmarkSentResult(result.Id);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Deletes result from list (and from IsolatedStoraged).
 /// </summary>
 /// <param name="result">Information about result which should be delete.</param>
 public void DeleteResult(ResultBasicInfo result)
 {
     _operations.DeleteResult(result.Id);
 }
Exemplo n.º 12
0
        private void OnSendResult(object sender, RoutedEventArgs e)
        {
            ResultBasicInfo selectedListBoxItem = (sender as MenuItem).DataContext as ResultBasicInfo;

            _viewModel.SendResult(selectedListBoxItem);
        }
Exemplo n.º 13
0
 /// <summary>
 /// Default contructor to initial all data in class.
 /// </summary>
 public Survey()
 {
     ResultInfo = new ResultBasicInfo();
     Categories = new List<Category>();
 }