Exemple #1
0
        private void lstAcc_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            acc.SetInfo();
            Account.Info   selectedInfo   = acc.GetInfoAtIndex(lstAcc.SelectedIndex);
            frmDisplay     frm            = this;
            frmDisplayInfo frmDisplayInfo = new frmDisplayInfo(selectedInfo.account, selectedInfo.userName, selectedInfo.password, fileName, ref frm);

            frmDisplayInfo.Show();
        }
Exemple #2
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            Account.Info inputInfo = new Account.Info(txtAccount.Text, txtUsername.Text, txtPassword.Text);
            if (acc.UniqueInfo(inputInfo))
            {
                acc.AddInfo(inputInfo);
            }
            frmDisplay frmDisplay = new frmDisplay(file);

            frmDisplay.Show();
            Hide();
        }
Exemple #3
0
        private void btnClose_Click(object sender, EventArgs e)
        {
            if (btnClose.Text == "Save")
            {
                Account.Info oldInfo = new Account.Info(accName, username, password);
                string       newAccName, newUsername, newPassword;
                #region IfElse Statements
                if (txtAccount != null)
                {
                    newAccName = txtAccount.Text;
                }
                else
                {
                    newAccName = accName;
                }

                if (txtUsername != null)
                {
                    newUsername = txtUsername.Text;
                }
                else
                {
                    newUsername = username;
                }

                if (txtPassword != null)
                {
                    newPassword = txtPassword.Text;
                }
                else
                {
                    newPassword = password;
                }
                #endregion
                Account.Info newInfo = new Account.Info(newAccName, newUsername, newPassword);
                acc.ReplaceInfo(oldInfo, newInfo);
                frmParent.RefreshInfo();
                Hide();
            }
            else
            {
                Hide();
            }
        }