Пример #1
0
 /// <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);
     }
 }
Пример #2
0
 /// <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);
 }
Пример #3
0
 /// <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);
 }