public MainForm() { InitializeComponent(); dcdc = new DataClassesDataContext(connectionString); while(!TestConnection(dcdc.Connection)) { retry: ConnectionStringInput connStrForm = new ConnectionStringInput(); if (connStrForm.ShowDialog() != System.Windows.Forms.DialogResult.OK) Environment.Exit(0); try { dcdc.Connection.ConnectionString = ConnectionStringInput.ConnectionString; } catch (Exception e) { MessageBox.Show("Provided connection string is in wrong format!" + Environment.NewLine + "Details:" + Environment.NewLine + e.Message, "Logs Analyzer - Error", MessageBoxButtons.OK, MessageBoxIcon.Error); goto retry; } } setGroupBoxes(); CB_FirstChoice.DataSource = Enum.GetValues(typeof(Entities)); CB_FirstChoice.SelectedItem = null; CB_FirstChoice.Text = "Select Entity..."; DTP_From.Value = DTP_From.Value = DateTime.Now.AddYears(-2); DTP_To.Value = DTP_To.Value = DateTime.Now.Date; CLB_EventTypes.Items.AddRange((from et in dcdc.EventTypes select et).ToArray()); CLB_EventTypes.DisplayMember = "EventTypeName"; CLB_EventServices.Items.AddRange((from es in dcdc.EventServices select es).ToArray()); CLB_EventServices.DisplayMember = "ServiceName"; CLB_Applications.Items.AddRange((from app in dcdc.applications select app).ToArray()); CLB_Applications.DisplayMember = "AppName"; CLB_Users.Items.AddRange((from usr in dcdc.Users select usr).ToArray()); CLB_Users.DisplayMember = "UserName"; TTB_From.SetTime(DateTime.Now.TimeOfDay); TTB_To.SetTime(DateTime.Now.TimeOfDay); SetToolTips(); _setupCompleted = true; }
private Report(DataClassesDataContext dcdc) : this() { this.dcdc = dcdc; }
public Report(DataClassesDataContext dcdc, User ent) : this(dcdc) { CreateReportForUser((ent as User)); }