private void backBtn_Click(object sender, EventArgs e) { MainMenuPanel mainMenu = new MainMenuPanel(MainForm); MainForm.emptyMainFormPanel(); MainForm.WindowPanel.Controls.Add(mainMenu); }
private void myButtonHandler(object sender, EventArgs e) { try { LoadProductToDatabase(); MessageBox.Show("Productos agregados correctamente"); MainForm.emptyMainFormPanel(); MainMenuPanel mainMenu = new MainMenuPanel(MainForm); MainForm.WindowPanel.Controls.Add(mainMenu); } catch (FileNotFoundException) { MessageBox.Show("No existe la ruta especificada"); } catch (Exception) { MessageBox.Show("No se pudo ingresar los prodcutos. Verifique el formato."); } }
private void loginBtn_Click(object sender, EventArgs e) { string userName = usernameInput.Text; string password = passwordInput.Text; LoginValidator validator = new LoginValidator(userName, password); try { validator.validateLogin(); MainForm.LogController.saveInLog("Ingreso|" + DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss") + "|" + userName); MainForm.UserName = userName; MainMenuPanel mainMenu = new MainMenuPanel(MainForm); MainForm.emptyMainFormPanel(); MainForm.WindowPanel.Controls.Add(mainMenu); } catch (Exception ex) { errorLabel.Text = ex.Message; } }