private void btn_AddCustomer_Click(object sender, System.EventArgs e) { FormsOpened <FrmCreateNewCustomer> .OpenForm(FrmCreateNewCustomer, _customerRepository, null); var customer = _customerRepository.GetAll(); UpdateCustomerDataGrid(customer); this.Close(); }
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)); }
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(); } }
private void RegisterUser_Click(object sender, EventArgs e) { FormsOpened <FrmRegistration> .OpenForm(frmRegistration, _userRepository); }
private void btnDatabaseCfg_Click(object sender, EventArgs e) { FormsOpened <FrmDataBaseConfig> .OpenForm(frmDataBaseConfig); }
private void btn_AddCustomer_Click(object sender, System.EventArgs e) { FormsOpened <FrmAddEditProduct> .OpenForm(FrmAddEditProduct, _productRepository); LoadProductList(); }