Esempio n. 1
0
 public ViewRequest(RequestModel model, MainWindow mainWindow)
     : this()
 {
     // TODO: Complete member initialization
     this.model = model;
     this.mainWindow = mainWindow;
     this.IsEnabled = false;
     async = new AsyncWork(mainWindow); async2 = new AsyncWork(mainWindow);
 }
        private void btnProceed_Click(object sender, RoutedEventArgs e)
        {
            if(dgRequests.SelectedIndex == -1){
                MessageBox.Show("Please select a request.");
                return;
            }

            model = (RequestModel)dgRequests.SelectedItem;
            mainWindow.TFrame.ShowPage(new ItemReceivingProcess(mainWindow, model.Id));
        }
        private void btnFinish_Click(object sender, RoutedEventArgs e)
        {
            if (dgRequests.SelectedIndex == -1) {
                MessageBox.Show("Please select a request.");
                return;
            }

            model = (RequestModel)dgRequests.SelectedItem;

            asyncMark.Do(MarkRequestAsFinished, MarkRequestAsFinished_Complete);
        }
        private void btnMarkCanvassed_Click(object sender, RoutedEventArgs e)
        {
            if (dgRequests.SelectedIndex == -1) {
                MessageBox.Show("Please select a request from the list");
                return;
            }

            model = (RequestModel)dgRequests.SelectedItem;

            async.Do(MarkFinished, MarkFinished_Complete);
        }
        private void btnView_Click(object sender, RoutedEventArgs e)
        {
            if (dgRequests.SelectedIndex == -1) {
                MessageBox.Show("Please select a request from the list");
                return;
            }

            model = (RequestModel)dgRequests.SelectedItem;

            viewDialog = new ViewRequest(model, mainWindow);

            viewDialog.ShowDialog();
        }
        private void btnProceed_Click(object sender, RoutedEventArgs e)
        {
            //Validation
            if (dgRequests.SelectedIndex == -1) {
                MessageBox.Show("Please select an item first.");
                return;
            }

            //Instantiation
            CsItemSelect csItemSelectDialog = new CsItemSelect(mainWindow);

            //Select Request Model
            model = (RequestModel)dgRequests.SelectedItem;
            csItemSelectDialog.RequestId = model.Id;
            // Show Page
            mainWindow.TFrame.ShowPage(csItemSelectDialog);
        }