/// <summary> /// 删除某个item /// </summary> /// <param name="item"></param> public static void Delete(PasswordItem item) { using (var conn = Conn) { conn.Execute("DELETE FROM PasswordItem WHERE Id = ? ", item.Id); } }
/// <summary> /// 更新某个item /// </summary> /// <param name="item"></param> public static void Update(PasswordItem item) { item.Password = Crypto.Encrypt(item.Password); using (var conn = Conn) { conn.Update(item); } item.Password = Crypto.Decrypt(item.Password); }
/// <summary> /// 添加到数据库 /// </summary> /// <param name="item"></param> public static void Add(PasswordItem item) { item.Password = Crypto.Encrypt(item.Password); using (var conn = Conn) { conn.Insert(item); } item.Password = Crypto.Decrypt(item.Password); }