protected void WindowDesignerLoaded(object sender, RoutedEventArgs e) { document.DataModel = document.LoadDataModel(); if (document.DataModel == null) { this.disableOptions(); this.showLabelNoDataModelLoaded(); } loadComboBoxDataModel(document.DataModel); if (document.ServiceEntity.CustomerServiceData != null) { if (document.Load()) { document.RedrawDocument(true); UpdateComboBoxDataModels(); } else { Util.ShowInformationDialog(UtnEmall.ServerManager.Properties.Resources.LoadServiceDesignFailed, "Warning"); this.disableOptions(); } } loadComboBoxStartForm(); formNumber = document.Components.Count + 1; }
/// <summary> /// Metodo llamado cuando se presiona en guardar. El metodo guarda todos los cambios realizados en el formulario de menu /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonOK_Click(object sender, RoutedEventArgs e) { try { foreach (FormMenuItemWpf formMenuItem in menuItemsDeleted) { formMenuItem.Reset(null); } menuFormWPF.MenuItems.Clear(); foreach (FormMenuItemWpf item in listOptionMenuForm.Items) { item.Parent = menuFormWPF; menuFormWPF.MenuItems.Add(item); } menuFormWPF.MakeCanvas(); document.RedrawDocument(); this.Close(); } catch (Exception error) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.UnhandledError + ": " + error.Message); } }
/// <summary> /// Funcion llamada cuando el boton guardar es presionado. Guarda los cambios realizados sobre el formulario de ingreso de datos /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonSave_Click(object sender, RoutedEventArgs e) { try { if (!ValidateField()) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.AllFieldsRequired); return; } form.OutputDataContext = form.InputDataContext; form.ChangeTitle(); serviceDocument.RedrawDocument(); this.Close(); } catch (Exception error) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.UnhandledError + ": " + error.Message); } }
void ServiceStatistics_Loaded(object sender, RoutedEventArgs e) { document.DataModel = document.LoadDataModel(); if (document.DataModel == null) { this.disableOptions(); } if (document.ServiceEntity.CustomerServiceData != null) { if (document.Load()) { document.RedrawDocument(); } else { Util.ShowOKMessage("No se puede cargar el documento", "Advertencia"); this.disableOptions(); } } }
/// <summary> /// Metodo llamado cuando se presiona guardar. Se guardan los cambios y se cierra la ventana /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonOK_Click(object sender, RoutedEventArgs e) { try { if (tempComponents.Count == 0) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.NoDisplayedField); return; } showDataFormWPF.OutputDataContext = showDataFormWPF.InputDataContext; this.showDataFormWPF.Title = this.textBoxTitle.Text; showDataFormWPF.TemplateListFormDocument.ClearAllComponents(); foreach (TemplateListItemWpf item in tempComponents) { showDataFormWPF.TemplateListFormDocument.AddTemplateListItem(item); } templateListFormDocument.SaveComponentPositions(); showDataFormWPF.ChangeTitle(); serviceDocument.RedrawDocument(); this.Close(); } catch (NullReferenceException error) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.UnhandledError + ": " + error.Message); } catch (Exception error) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.UnhandledError + ": " + error.Message); } }
/// <summary> /// Metodo llamado cuando se presiona el boton guardar. Guarda los cambios realizados sobre el formulario de lista /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void buttonOK_Click(object sender, RoutedEventArgs e) { try { if (String.IsNullOrEmpty(textBoxTitle.Text)) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.EmptyText); return; } if (tempComponents.Count == 0) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.NoDisplayedField); return; } if (radioRegister.IsChecked == true) { listformWPF.OutputDataContext = listformWPF.InputDataContext; } else { listformWPF.OutputDataContext = comboBoxOutput.SelectedItem as LogicalLibrary.DataModelClasses.Table; } if (this.previousDataContext != null && String.Compare(this.previousDataContext.Name, this.listformWPF.OutputDataContext.Name, StringComparison.OrdinalIgnoreCase) != 0) { bool result = Util.ShowConfirmDialog(UtnEmall.ServerManager.Properties.Resources.ResetConnectionAndForm, UtnEmall.ServerManager.Properties.Resources.OutputDataContextChanged); if (result) { this.listformWPF.OutputConnectionPoint.Reset(null); this.serviceDocument.RedrawDocument(); } else { return; } } listformWPF.TemplateListFormDocument.ClearAllComponents(); foreach (TemplateListItemWpf item in tempComponents) { listformWPF.TemplateListFormDocument.AddTemplateListItem(item); } templateListFormDocument.SaveComponentPositions(); this.listformWPF.Title = this.textBoxTitle.Text; listformWPF.ChangeTitle(); serviceDocument.RedrawDocument(); this.Close(); } catch (NullReferenceException error) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.UnhandledError + ": " + error.Message); } catch (Exception error) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.UnhandledError + ": " + error.Message); } }