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; }
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); }
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); }