Exemplo n.º 1
0
        private void btn_save_addData_Click(object sender, EventArgs e)
        {
            AccountDetails account = new AccountDetails();

            if (tb_save_siteName.Text != "")
            {
                account.SiteName    = Methods.Encrypt(tb_save_siteName.Text);
                account.Username    = Methods.Encrypt(tb_save_username.Text);
                account.Password    = Methods.Encrypt(tb_save_password.Text);
                account.Email       = Methods.Encrypt(tb_save_email.Text);
                account.Phone       = Methods.Encrypt(tb_save_phone.Text);
                account.Question    = Methods.Encrypt(tb_save_question.Text);
                account.Answer      = Methods.Encrypt(tb_save_answer.Text);
                account.OtherInfo   = Methods.Encrypt(tb_save_otherInfo.Text);
                account.DateCreated = Methods.Encrypt(DateTime.Now.ToString("yyyy/M/dd hh:mm tt"));

                DataAccess.AddAccount(account);
                MessageBox.Show("Account saved");
            }
            else
            {
                MessageBox.Show("please fill the required boxes");
            }
        }