Exemple #1
0
        void _mrsClient_GetNextEstimateRevisionCompleted(object sender, GetNextEstimateRevisionCompletedEventArgs e)
        {
            if (e.Error == null)
            {
                //NextRevision nextRevision = e.Result;
                //if (nextRevision != null)
                //{
                //    if (nextRevision.Name != null)
                //        txtNotes.Text = "Next Revision: " + nextRevision.Name;
                //    else
                //        txtNotes.Text += "Next Revision: N/A";
                //    if (nextRevision.Notes != null)
                //        txtNotes.Text += "\r\n" + nextRevision.Notes;
                //}

                ObservableCollection <NextRevision> revisions = e.Result;

                if (revisions.Count > 1)
                {
                    revisions.Insert(0, new NextRevision {
                        RevisionTypeName = "Select", RevisionTypeId = -1, OwnerId = 0, Notes = "Please select the next Revision Type."
                    });
                }

                cmbRevision.ItemsSource = revisions;

                cmbRevision.SelectedIndex = 0;
            }
            else
            {
                ExceptionHandler.PopUpErrorMessage(e.Error, "GetNextEstimateRevisionCompleted");
            }

            BusyIndicator1.IsBusy = false;
        }
Exemple #2
0
        void _mrsClient_GetNextEstimateRevisionCompleted(object sender, GetNextEstimateRevisionCompletedEventArgs e)
        {
            RadWindow window = this.ParentOfType <RadWindow>();

            if (e.Error == null)
            {
                //NextRevision nextRevision = e.Result;
                //if (nextRevision != null)
                //{
                //    if (nextRevision.Name != null)
                //        txtNotes.Text = "Next Revision: " + nextRevision.Name;
                //    else
                //        txtNotes.Text += "Next Revision: N/A";
                //    if (nextRevision.Notes != null)
                //        txtNotes.Text += "\r\n" + nextRevision.Notes;
                //}

                List <NextRevision> revisions = e.Result.ToList();
                // if no TBA available due to NSR then don't allow to set as pc, contract or variation
                if (chkActive.IsChecked.HasValue && chkActive.IsChecked.Value &&
                    revisions.Where(w => w.RevisionTypeId == 0).FirstOrDefault() == null)
                {
                    DialogParameters param = new DialogParameters();
                    param.Header  = "Unable to Set as " + _documentType;
                    param.Content = "Unable to Set as " + _documentType + " as estimate contains items not accepted by the Sales Estimator.\r\nPlease send job to Sales Estimator to review items not accepted.";
                    RadWindow.Alert(param);
                    if (window != null)
                    {
                        window.DialogResult = false;
                        window.Close();
                    }
                }
                else
                {
                    UpdateCustomerDocumentDetails();
                    if (window != null)
                    {
                        window.Close();
                    }
                }
            }
            else
            {
                ExceptionHandler.PopUpErrorMessage(e.Error, "GetNextEstimateRevisionCompleted");
            }

            BusyIndicator1.IsBusy = false;
        }