public void OkOp(object o) { systemConfig.SetConfig <string>("ServiceAddress", serviceAdr); systemConfig.WriteConfig(); RaiseOkCompleted(); currentView.DialogResult = true; currentView.Close(); }
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; }
private void OKButton_Click(object sender, RoutedEventArgs e) { BusyIndicator1.IsBusy = true; BusyIndicator1.BusyContent = "Changing Home Name ..."; string homeName = txtHomeName.Text.Trim(); if (homeName != _homeName) { if (homeName == string.Empty) { homeName = null; } _mrsClient.UpdateHomeNameCompleted += new EventHandler <UpdateHomeNameCompletedEventArgs>(_mrsClient_UpdateHomeNameCompleted); _mrsClient.UpdateHomeNameAsync(_estimateRevisionId, homeName, (App.Current as App).CurrentUserId); } else { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = false; window.Close(); } } }
private void OKButton_Click(object sender, RoutedEventArgs e) { RadWindow window = this.ParentOfType <RadWindow>(); string selecteditemids = ""; string selectedstandardinclusionids = ""; foreach (SimplePAG item in upgradelist) { if (item.Selected) // here reuse this column to hold the selection of check box { selecteditemids = item.HomeDisplayOptionID.ToString(); } } p.SelectedItemID = selecteditemids; p.SelectedStandardInclusionID = selectedstandardinclusionids; p.StudioMQANDA = ""; p.Action = "OPTIONTREE"; if (window != null) { window.DataContext = p; window.DialogResult = true; window.Close(); } }
void mrsClient_SetContractStatusCompleted(object sender, SetContractStatusCompletedEventArgs e) { BusyIndicator1.IsBusy = false; if (e.Error == null) { if (!e.Result) { DialogParameters param = new DialogParameters(); param.Header = "Update failed"; param.Content = "Update failed!\r\nPlease contact the System Administrator."; RadWindow.Alert(param); } else { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } } else { ExceptionHandler.PopUpErrorMessage(e.Error, "SetContractStatusCompleted"); } }
public void ZMX_CerrarPopupVisorPrompt() { if (rw != null) { Window.GetWindow(this).IsEnabled = true; rw.Close(); } }
private void CancelButton_Click(object sender, RoutedEventArgs e) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.Close(); } }
private void CloseRadWindow() { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.Close(); } }
private void CancelButton_Click(object sender, RoutedEventArgs e) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = _documentTypeAcive ? true : false; window.Close(); } }
void ValidationWin_Closed(object sender, WindowClosedEventArgs e) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } }
private void ContinueButton_Click(object sender, RoutedEventArgs e) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } }
void mrsClient_CreateSalesEstimateLogCompleted(object sender, CreateSalesEstimateLogCompletedEventArgs e) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } }
private void CancelButton_Click(object sender, RoutedEventArgs e) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DataContext = p; window.DialogResult = false; window.Close(); } }
private void Deactivated(object sender, DeactivationEventArgs e) { if (!e.WasClosed) { return; } ((IDeactivate)model).Deactivated -= Deactivated; if (deactivatingFromView) { return; } deactivateFromViewModel = true; actuallyClosing = true; view.Close(); actuallyClosing = false; deactivateFromViewModel = false; }
public static void SetDialogResult(RadWindow radWindow, bool?value) { if (radWindow != null) { radWindow.SetValue(RadWindow.DialogResultProperty, value); if (value != null) { radWindow.Close(); } } }
private void PopupPrintWindowGrid(bool fullcomparison) { System.Windows.Browser.HtmlPage.Window.Navigate(new Uri("../PrintEstimateComparison.aspx?Source=" + _sourceId + "&Destination=" + _destinationId + "&fullcomparison=" + fullcomparison.ToString() + "&filter=" + filterlist, UriKind.Relative), "_blank", "toolbar=0,menubar=1,location=0,status=0,top=0,left=0,resizable=1"); this.DialogResult = true; RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.Close(); } }
public static void Print(this RadGridView grid, PrintSettings settings) { var rtb = CreateRadRichTextBox(grid, settings); var window = new RadWindow() { Height = 0, Width = 0, Opacity = 0, Content = rtb, Owner = WpfHelper.GetActiveWindow() }; rtb.PrintCompleted += (s, e) => { window.Close(); }; window.Show(); rtb.Print("MyDocument", Telerik.Windows.Documents.UI.PrintMode.Native); }
private void OKButton_Click(object sender, RoutedEventArgs e) { if (confirmStep == 1) { confirmStep = 2; OKButton.Visibility = Visibility.Collapsed; UndoButton.Visibility = Visibility.Visible; textBlockMessage.Text = "This Action is not reversible." + Environment.NewLine; textBlockReason.Text = "Enter reason for Undoing."; txtReason.Visibility = Visibility.Visible; } else { if (txtReason.Text.Trim() != "") { BusyIndicator1.IsBusy = true; RetailSystemClient mrsClient = new RetailSystemClient(); mrsClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(Internal.Utilities.GetMetriconRetailSystemWcfClientEndpointUrl()); mrsClient.UndoThisRevisionCompleted += delegate(object o, UndoThisRevisionCompletedEventArgs es) { if (es.Error == null) { if (es.Result != null) { Int32.TryParse(es.Result.ToString(), out _previousRevisionId); CreateLog(es.Result.ToString()); RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } } else { ExceptionHandler.PopUpErrorMessage(es.Error, "UndoThisRevisionCompleted"); } }; mrsClient.UndoThisRevisionAsync(_bcContractNumber, _sourceEstimateNo, _selectedEstimateRevisionId, _ownerId, txtReason.Text); } else { MessageBox.Show("Please enter a reason for undo."); } } }
void mrsClient_AddNewNotesTemplateCompleted(object sender, AddNewNotesTemplateCompletedEventArgs e) { if (e.Error == null) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } else { ExceptionHandler.PopUpErrorMessage(e.Error, "AddNewNotesTemplateCompleted"); } }
private void ContinueButton_Click(object sender, RoutedEventArgs e) { string reason = cmbReason.SelectedValue == null ? "" : cmbReason.SelectedValue.ToString(); if (reason == "0") { DialogParameters param = new DialogParameters(); param.Header = "Reason to Remove is required"; param.Content = "Please select a Reason to Remove the item."; RadWindow.Alert(param); } else if (reason == "1" && String.IsNullOrEmpty(txtReason.Text)) { DialogParameters param = new DialogParameters(); param.Header = "Deletion Comments Required"; param.Content = "Please enter Deletion Comments."; RadWindow.Alert(param); } else if (!string.IsNullOrWhiteSpace(reason)) { _mrsClient.DeleteProductCompleted += delegate(object o, DeleteProductCompletedEventArgs es) { if (es.Error == null) { if (es.Result != null) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } } else { ExceptionHandler.PopUpErrorMessage(es.Error, "DeleteProductCompleted"); } }; foreach (EstimateDetails ed in pag) { _mrsClient.DeleteProductAsync(ed.EstimateRevisionDetailsId, txtReason.Text, int.Parse(cmbReason.SelectedValue.ToString()), (App.Current as App).CurrentUserId); } } }
private void OKButton_Click(object sender, RoutedEventArgs e) { if (confirmStep == 1) { confirmStep = 2; OKButton.Visibility = Visibility.Collapsed; UndoButton.Visibility = Visibility.Visible; textBlockMessage.Text = "Please enter the reason for undo."; txtReason.Visibility = Visibility.Visible; } else { if (txtReason.Text.Trim() != "") { BusyIndicator1.IsBusy = true; RetailSystemClient mrsClient = new RetailSystemClient(); mrsClient.Endpoint.Address = new System.ServiceModel.EndpointAddress(Internal.Utilities.GetMetriconRetailSystemWcfClientEndpointUrl()); mrsClient.UndoCurrentMilestoneCompleted += delegate(object o, UndoCurrentMilestoneCompletedEventArgs es) { if (es.Error == null) { if (es.Result != null) { CreateLog(es.Result.ToString()); RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } } else { ExceptionHandler.PopUpErrorMessage(es.Error, "ResetCurrentMilestoneCompleted"); } }; mrsClient.UndoCurrentMilestoneAsync(_selectedEstimateRevisionId, (App.Current as App).CurrentUserId, txtReason.Text); } else { MessageBox.Show("Please enter a reason for undo."); } } }
void mrsClient_CreateSalesEstimateLogCompleted(object sender, CreateSalesEstimateLogCompletedEventArgs e) { BusyIndicator1.IsBusy = false; if (e.Error != null) { ExceptionHandler.PopUpErrorMessage(e.Error, "CreateSalesEstimateLogCompleted"); } RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } }
void mrsClient_ChangeHomeCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { if (e.Error == null) { CreateLog(); RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } else { BusyIndicator1.IsBusy = false; ExceptionHandler.PopUpErrorMessage(e.Error, "ChangeHomeCompleted"); } }
void mrsClient_UpdateDifficultyRatingCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { BusyIndicator1.IsBusy = false; if (e.Error == null) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } else { ExceptionHandler.PopUpErrorMessage(e.Error, "UpdateDifficultyRatingCompleted"); } }
void win_AddOptionClosed(object sender, WindowClosedEventArgs e) { RadWindow dlg = (RadWindow)sender; ParameterClass p = (ParameterClass)dlg.DataContext; if (p != null) { EstimateDetails pag = p.SelectedPAG; bool?result = dlg.DialogResult; if (result.HasValue && result.Value) { if (p.SelectedItemID != "" || p.SelectedStandardInclusionID != "") { //((EstimateViewModel)LayoutRoot.DataContext).SaveSelectedOptionsFromTreeToEstimate(p.SelectedItemID, // p.SelectedStandardInclusionID, // EstimateList.SelectedEstimateRevisionId.ToString(), // p.StudioMQANDA, // (App.Current as App).CurrentUserId.ToString(), // p.SelectedDerivedCosts, // p.SelectedCostExcGSTs, // p.SelectedQuantities, // p.SelectedPrices, // p.SelectedIsAccepteds, // p.SelectedAreaIds, // p.SelectedGroupIds, // p.SelectedPriceDisplayCodeIds, // p.SelectedIsSiteWorks, // p.SelectedProductDescriptions, // p.SelectedAdditionalNotes, // p.SelectedExtraDescriptions, // p.SelectedInternalDescriptions); RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DataContext = p; window.DialogResult = true; window.Close(); } } } } }
void mrsClient_CompleteEstimateCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { _mrsClient.CompleteEstimateCompleted -= new EventHandler <System.ComponentModel.AsyncCompletedEventArgs>(mrsClient_CompleteEstimateCompleted); BusyIndicator1.IsBusy = false; if (e.Error == null) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } /* Commented on 20130722 - It causes error intermittently when complete/reject estimates * _mrsClient.SynchroniseCustomerDetailsCompleted += delegate(object o, SynchroniseCustomerDetailsCompletedEventArgs es) * { * BusyIndicator1.IsBusy = false; * * if (es.Error == null) * { * RadWindow window = this.ParentOfType<RadWindow>(); * if (window != null) * { * window.DialogResult = true; * window.Close(); * } * } * else * ExceptionHandler.PopUpErrorMessage(es.Error, "SynchronizeCustomerDetails"); * * }; * * _mrsClient.SynchroniseCustomerDetailsAsync(Convert.ToInt32(_estimatenumber)); */ } else { //ExceptionHandler.PopUpErrorMessage(e.Error, "CompleteEstimateCompleted"); //BusyIndicator1.IsBusy = false; } }
void mrsClient_UpdateCustomerDocumentDetailsCompleted(object sender, UpdateCustomerDocumentDetailsCompletedEventArgs e) { if (e.Error == null) { _customerDocumentId = e.Result; RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = chkActive.IsChecked.HasValue && chkActive.IsChecked.Value ? true : false; window.Close(); } } else { ExceptionHandler.PopUpErrorMessage(e.Error, "UpdateCustomerDocumentDetailsCompleted"); } BusyIndicator1.IsBusy = false; }
void mrsClient_CreateSalesEstimateLogCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { _mrsClient.CreateSalesEstimateLogCompleted -= new EventHandler <CreateSalesEstimateLogCompletedEventArgs>(mrsClient_CreateSalesEstimateLogCompleted); BusyIndicator1.IsBusy = false; if (e.Error == null) { RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } else { ExceptionHandler.PopUpErrorMessage(e.Error, "CreateSalesEstimateLogCompleted"); } }
void mrsClient_CreateSplitStudioMRevisionsCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { BusyIndicator1.IsBusy = false; if (e.Error == null) { (App.Current as App).SelectedStatusId = 1; //In Progress RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } } else { ExceptionHandler.PopUpErrorMessage(e.Error, "CreateSplitStudioMRevisionsCompleted"); } }
void mrsClient_CreateSalesEstimateLogCompleted(object sender, CreateSalesEstimateLogCompletedEventArgs e) { BusyIndicator1.IsBusy = false; MessageBoxResult result = MessageBox.Show("Estimate revision created successfully!\r\n\r\nDo you want to view the newly created revision?\r\nClick OK to view the new revision, or Cancel to go back to Ready for Studio M revision.", "Estimate Revision Created", MessageBoxButton.OKCancel); if (result == MessageBoxResult.OK) { (App.Current as App).SelectedRevisionTypeId = _estimateRevisionTypeId; (App.Current as App).SelectedStatusId = 1; //In Progress } RadWindow window = this.ParentOfType <RadWindow>(); if (window != null) { window.DialogResult = true; window.Close(); } }
public static void Print(this RadGridView grid, PrintSettings settings) { var rtb = CreateRadRichTextBox(grid, settings); var window = new RadWindow { Height = 0, Width = 0, Opacity = 0, Content = rtb }; rtb.PrintCompleted += (s, e) => window.Close(); window.Show(); rtb.Print("MyDocument", Telerik.Windows.Documents.UI.PrintMode.Native); }