private void buttonSave_Click(object sender, RoutedEventArgs e) { CustomerServiceDataEntity customerServiceDataEntity = document.Save(); if (customerServiceDataEntity == null) { Util.ShowErrorMessage("No se pudo guardar el servicio"); return; } document.ServiceEntity.CustomerServiceData = customerServiceDataEntity; Util.ShowOKMessage("Servicio guardado exitosamente", "Éxito"); this.result = true; this.Close(); }
private void ButtonSave_Click(object sender, RoutedEventArgs e) { try { document.StartWidget = comboBoxForms.SelectedItem as Widget; if (document.StartWidget == null) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.NoStartForm, ""); return; } Collection <Error> listOfDesignerError = document.CheckDesignerLogic(); if (listOfDesignerError.Count > 0) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.ServiceDesignLogicIncorrect, listOfDesignerError); return; } if (!document.CheckValidPathForms()) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.InvalidServicePath); return; } CustomerServiceDataEntity customerServiceDataEntity = document.Save(); if (customerServiceDataEntity == null) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.SaveServiceError); return; } document.ServiceEntity.CustomerServiceData = customerServiceDataEntity; this.result = true; this.Close(); } catch (Exception error) { Util.ShowErrorDialog(UtnEmall.ServerManager.Properties.Resources.UnhandledError + ": " + error.Message); } }