Exemplo n.º 1
0
        /// <summary>
        /// Alternative contructor. Creates the Form and also load it's data using table '' Primary key.
        /// </summary>
        public FormWPFSuppliers(WPFConfig config, int SupplierID, Frame mainFrame)
        {
            this.config          = config;
            this.FrameMainWindow = mainFrame;
            dataConnection       = new WPFSuppliersDB(config);
            string error = null;

            SuppliersDataContext = dataConnection.GetDataContext(SupplierID, out error);
            DataContext          = SuppliersDataContext;
            InitializeComponent();
        }
Exemplo n.º 2
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        /// <param name="config">Default config object</param>
        public FormWPFSuppliers(WPFConfig config)
        {
            this.config    = config;
            dataConnection = new WPFSuppliersDB(config);
            string error = null;

            SuppliersDataContext = dataConnection.GetEmptyDataContext(out error);
            if (error != null)
            {
                MessageBox.Show(error);
            }
            DataContext = SuppliersDataContext;
            InitializeComponent();
        }
Exemplo n.º 3
0
 public ListWPFSuppliers(WPFConfig config, bool loadGrid, Frame mainFrame)
 {
     this.config          = config;
     this.FrameMainWindow = mainFrame;
     if (config.connectionType == WPFConfig.ConnectionType.REST)
     {
         dataConnection = new WPFSuppliersRest(config);
     }
     else
     {
         dataConnection = new WPFSuppliersDB(config);
     }
     InitializeComponent();
     if (loadGrid)
     {
         LoadGrid();
     }
     txtFilter.KeyDown += new KeyEventHandler(btnFilterKeyDown);
 }