Exemple #1
0
        public NewPasswordDialog(DataEntity d)
        {
            //
            // The InitializeComponent() call is required for Windows Forms designer support.
            //
            InitializeComponent();

            data = d;

            textTitle.Text    = data.title;
            textAccount.Text  = data.account;
            textRemark.Text   = data.remark;
            textPassword.Text = data.password;
            textConfirm.Text  = data.password;
        }
Exemple #2
0
        private static List <DataEntity> GetEverything()
        {
            var command = new SQLiteCommand(connection);


            command.CommandText = "SELECT * FROM `password`";
            var reader = command.ExecuteReader();

            var ret = new List <DataEntity>();

            while (reader.Read())
            {
                var data = new DataEntity(reader);
                data.password = Decrypt(data.password);
                ret.Add(data);
            }

            reader.Close();

            return(ret);
        }
Exemple #3
0
        public static DataEntity GetById(int id)
        {
            var command = new SQLiteCommand(connection);

            command.CommandText = "SELECT * FROM `password` WHERE `id` = ?";
            command.Parameters.Add(new SQLiteParameter(DbType.Int32)
            {
                Value = id
            });

            var reader = command.ExecuteReader();

            reader.Read();

            var data = new DataEntity(reader);

            data.password = Decrypt(data.password);

            reader.Close();

            return(data);
        }