コード例 #1
0
        //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);
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: GrieThomas/ProjektGrieBra
 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;
     }
 }
コード例 #3
0
ファイル: Form1.cs プロジェクト: GrieThomas/ProjektGrieBra
        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";
        }
コード例 #4
0
ファイル: FormMenu.cs プロジェクト: GrieThomas/ProjektGrieBra
        //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;
        }
コード例 #5
0
ファイル: FormMenu.cs プロジェクト: GrieThomas/ProjektGrieBra
        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);
            }
        }
コード例 #6
0
 //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);
 }