Example #1
0
        private void btn_AddCustomer_Click(object sender, System.EventArgs e)
        {
            FormsOpened <FrmCreateNewCustomer> .OpenForm(FrmCreateNewCustomer, _customerRepository, null);

            var customer = _customerRepository.GetAll();

            UpdateCustomerDataGrid(customer);

            this.Close();
        }
Example #2
0
        private void CustomerDataGrid_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.ColumnIndex != CustomerDataGrid.Columns["Edit"].Index)
            {
                return;
            }

            var customerId = CustomerDataGrid.SelectedCells[CustomerColumnId].FormattedValue.ToString();

            FormsOpened <FrmCreateNewCustomer> .OpenForm(FrmCreateNewCustomer, _customerRepository, int.Parse(customerId));
        }
Example #3
0
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            AppDomain.CurrentDomain.UnhandledException   += CurrentDomain_UnhandledException;
            AppDomain.CurrentDomain.FirstChanceException += CurrentDomain_FirstChanceException;
            try
            {
                _splashScreen               = new SplashScreen();
                _splashScreen.WindowState   = FormWindowState.Normal;
                _splashScreen.StartPosition = FormStartPosition.CenterScreen;

                if (_splashScreen.ShowDialog() == DialogResult.OK)
                {
                    if (!_splashScreen.DatabaseExists)
                    {
                        FormsOpened <FrmDataBaseConfig> .OpenForm(frmDataBaseConfig);
                    }

                    var container = BuildContainer();

                    var frm = new FrmLogin(container);

                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        frm.Close();
                        _frmMain = new FrmMain(container);

                        using (var scope = container.BeginLifetimeScope())
                            Application.Run(_frmMain);
                    }
                    else
                    {
                        Application.Exit();
                    }
                }
            }
            catch (Exception ex)
            {
                _splashScreen.Close();
                KryptonMessageBox.Show("Wystąpił błąd, treść : " + ex.Message, "Uwaga!", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);

                Application.Exit();
            }
        }
Example #4
0
 private void btn_Products_Click(object sender, EventArgs e)
 {
     ProductList = FormsOpened <FrmProductList> .OpenMDIForm(ProductList, this, _productRepository);
 }
Example #5
0
 private void btn_CustomerList_Click(object sender, EventArgs e)
 {
     CustomerList = FormsOpened <FrmCustomerList> .OpenMDIForm(CustomerList, this, _customerRepository);
 }
Example #6
0
 private void RegisterUser_Click(object sender, EventArgs e)
 {
     FormsOpened <FrmRegistration> .OpenForm(frmRegistration, _userRepository);
 }
Example #7
0
 private void btnDatabaseCfg_Click(object sender, EventArgs e)
 {
     FormsOpened <FrmDataBaseConfig> .OpenForm(frmDataBaseConfig);
 }
Example #8
0
        private void btn_AddCustomer_Click(object sender, System.EventArgs e)
        {
            FormsOpened <FrmAddEditProduct> .OpenForm(FrmAddEditProduct, _productRepository);

            LoadProductList();
        }