Exemplo n.º 1
0
        public PickProduct(int terminalID)
        {
            InitializeComponent();

            cart  = new List <Product>();
            order = new Order()
            {
                ByTerminal = terminalID, Paid = false
            };

            try
            {
                // Get key string from App.config appsettings
                string _postgreBackEnd = ConfigurationManager.AppSettings.Keys[0];

                // Check if postgreSQL Back-End is set to true App.Config
                if (_postgreBackEnd.GetConfigSetting())
                {
                    _repo = new PostgreSQL.G3SystemsRepository();
                }
                else
                {
                    //MessageBox.Show("MSSQL", "Connected");
                    _repo = new SQLServer.G3SystemsRepository();
                }
            }
            catch
            {
                MessageBox.Show("Fel i App.config", "Error");
                throw;
            }
        }
Exemplo n.º 2
0
        public Login()
        {
            InitializeComponent();

            try
            {
                // Get key string from App.config appsettings
                string _postgreBackEnd = ConfigurationManager.AppSettings.Keys[0];

                // Check if postgreSQL Back-End is set to true App.Config
                if (_postgreBackEnd.GetConfigSetting())
                {
                    MessageBox.Show("PostgreSQL", "Connected");
                    _repo = new PostgreSQL.G3SystemsRepository();
                }
                else
                {
                    //MessageBox.Show("MSSQL", "Connected");
                    _repo = new SQLServer.G3SystemsRepository();
                }
            }
            catch
            {
                MessageBox.Show("Fel i App.config", "Error");
                throw;
            }

            cbConnectTo.SelectedIndex = 0;
        }
Exemplo n.º 3
0
        public Cashier(Employee puser)
        {
            InitializeComponent();
            user = puser;
            lbl_username.Text = user.Username;

            try
            {
                // Get key string from App.config appsettings
                string _postgreBackEnd = ConfigurationManager.AppSettings.Keys[0];

                // Check if postgreSQL Back-End is set to true App.Config
                if (_postgreBackEnd.GetConfigSetting())
                {
                    _repo = new PostgreSQL.G3SystemsRepository();
                }
                else
                {
                    //MessageBox.Show("MSSQL", "Connected");
                    _repo = new SQLServer.G3SystemsRepository();
                }
            }
            catch
            {
                MessageBox.Show("Fel i App.config", "Error");
                throw;
            }
        }