/// <summary> /// Alternative contructor. Creates the Form and also load it's data using table '' Primary key. /// </summary> public FormWPFCustomerDemographics(WPFConfig config, string CustomerTypeID, Frame mainFrame) { this.config = config; this.FrameMainWindow = mainFrame; dataConnection = new WPFCustomerDemographicsDB(config); string error = null; CustomerDemographicsDataContext = dataConnection.GetDataContext(CustomerTypeID, out error); DataContext = CustomerDemographicsDataContext; InitializeComponent(); }
/// <summary> /// Default constructor. /// </summary> /// <param name="config">Default config object</param> public FormWPFCustomerDemographics(WPFConfig config) { this.config = config; dataConnection = new WPFCustomerDemographicsDB(config); string error = null; CustomerDemographicsDataContext = dataConnection.GetEmptyDataContext(out error); if (error != null) { MessageBox.Show(error); } DataContext = CustomerDemographicsDataContext; InitializeComponent(); }
public ListWPFCustomerDemographics(WPFConfig config, bool loadGrid, Frame mainFrame) { this.config = config; this.FrameMainWindow = mainFrame; if (config.connectionType == WPFConfig.ConnectionType.REST) { dataConnection = new WPFCustomerDemographicsRest(config); } else { dataConnection = new WPFCustomerDemographicsDB(config); } InitializeComponent(); if (loadGrid) { LoadGrid(); } txtFilter.KeyDown += new KeyEventHandler(btnFilterKeyDown); }