//private string path = @"CustomerData.crypt"; //private string passwordPath = @"init\passwordFile.crypt"; //private string selLangPath = @"init\languageFile.lng"; //private string initdir = @"init"; public FormChangeAttr() { InitializeComponent(); myDatabase1 = new CustomerDatabase(); myDatabase1.ReadPassword(passwordPath); myDatabase1.readStoredData(path); }
private void btnpsw_Click(object sender, EventArgs e) { myDatabase.ReadPassword(passwordPath); try { if (txtboxPsw.Text.Equals(myDatabase.Password)) { //switch to Form Menu FormMenu dialog = new FormMenu(); dialog.language = comboBox1.SelectedItem.ToString(); dialog.passwordPath = passwordPath; dialog.ShowDialog(); txtboxPsw.Clear(); } else { throw new ArgumentException("Wrong password"); } } catch (Exception ex) { epErrorMsg.SetError(txtboxPsw, ex.Message); //e.Cancel = false; } }
public Form1() { InitializeComponent(); myDatabase = new CustomerDatabase(); if (!Directory.Exists(initdir)) { Directory.CreateDirectory(initdir); } if (File.Exists(selLangPath)) { StreamReader sr = new StreamReader(selLangPath); selLang = sr.ReadLine(); sr.Close(); } myDatabase.ReadPassword(passwordPath); myDatabase.readStoredData(path); comboBox1.Items.Add("English"); comboBox1.Items.Add("Deutsch"); comboBox1.SelectedItem = selLang; this.Text = "Start"; }
//private string path = @"CustomerData.crypt"; //public string passwordPath = @"init\passwordFile.crypt"; //private string selLangPath = @"init\languageFile.lng"; //private string initdir = @"init"; public FormMenu() { InitializeComponent(); myDatabase = new CustomerDatabase(); myDatabase.ReadPassword(passwordPath); myDatabase.readStoredData(path); dataGridView2.Columns.Add("1", "Customer ID"); dataGridView2.Columns.Add("2", "First Name"); dataGridView2.Columns.Add("3", "Last Name"); dataGridView2.Columns.Add("4", "E-Mail"); dataGridView2.Columns.Add("5", "Account balance"); dataGridView2.Columns.Add("6", "Last change"); // btnFindPers.Enabled = false; }
private void btnshowall_Click(object sender, EventArgs e) { dataGridView2.Rows.Clear(); myDatabase = new CustomerDatabase(); myDatabase.ReadPassword(passwordPath); myDatabase.readStoredData(path); foreach (Customer customer in myDatabase.Customers) { dataGridView2.Rows.Add( customer.CustomerID, customer.FirstName, customer.LastName, customer.Email, customer.AccountBalance, customer.LastChange); } }
//private string path = @"CustomerData.crypt"; //private string passwordPath = @"init\passwordFile.crypt"; //private string selLangPath = @"init\languageFile.lng"; //private string initdir = @"init"; public FormOptions() { InitializeComponent(); myDatabase = new CustomerDatabase(); myDatabase.ReadPassword(passwordPath); }