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