protected override bool OnQvItemAdd(Common.IReportItem qvItem) { try { ReportConnection connection = qvItem as ReportConnection; if (string.IsNullOrWhiteSpace(connection.Name) || connection.QlikViewDocument == null) { MessageBox.Show("Name and QlikViewDocument are required."); return(false); } if (connection.IsServer && string.IsNullOrWhiteSpace(connection.ServerName)) { MessageBox.Show("Server Name is required."); return(false); } ReportConfig.ConnectionManager.AddItem(qvItem); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } return(true); }
protected override bool OnQvItemAdd(Common.IReportItem qvItem) { try { Recipient recipient = qvItem as Recipient; if (string.IsNullOrWhiteSpace(recipient.Name) || string.IsNullOrWhiteSpace(recipient.Email)) { MessageBox.Show("Name and Email are required."); return(false); } ReportConfig.RecipientManager.AddItem(qvItem); } catch (Exception ex) { MessageBox.Show(ex.Message); return(false); } return(true); }