예제 #1
0
        /// <summary>
        /// Alternative contructor. Creates the Form and also load it's data using table '' Primary key.
        /// </summary>
        public FormWPFCustomers(WPFConfig config, string CustomerID, Frame mainFrame)
        {
            this.config          = config;
            this.FrameMainWindow = mainFrame;
            dataConnection       = new WPFCustomersDB(config);
            string error = null;

            CustomersDataContext = dataConnection.GetDataContext(CustomerID, out error);
            DataContext          = CustomersDataContext;
            InitializeComponent();
        }
예제 #2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="config">Default config object</param>
        public FormWPFCustomers(WPFConfig config)
        {
            this.config    = config;
            dataConnection = new WPFCustomersDB(config);
            string error = null;

            CustomersDataContext = dataConnection.GetEmptyDataContext(out error);
            if (error != null)
            {
                MessageBox.Show(error);
            }
            DataContext = CustomersDataContext;
            InitializeComponent();
        }
예제 #3
0
 public ListWPFCustomers(WPFConfig config, bool loadGrid, Frame mainFrame)
 {
     this.config          = config;
     this.FrameMainWindow = mainFrame;
     if (config.connectionType == WPFConfig.ConnectionType.REST)
     {
         dataConnection = new WPFCustomersRest(config);
     }
     else
     {
         dataConnection = new WPFCustomersDB(config);
     }
     InitializeComponent();
     if (loadGrid)
     {
         LoadGrid();
     }
     txtFilter.KeyDown += new KeyEventHandler(btnFilterKeyDown);
 }