Esempio n. 1
0
 /// <summary>
 /// 通过对象删除记录
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 public bool Del( TbSysOther item)
 {
     bool res = false;
     using (var connection = DataBase.GetOpenConnection())
     {
         res = connection.Delete< TbSysOther>(item);
     }
     return res;
 }
Esempio n. 2
0
 /// <summary>
 /// 通过ID删除记录
 /// </summary>
 /// <param name="id">需要删除的对象的ID</param>
 /// <returns></returns>
 public bool Del(int id)
 {
     bool res = false;
     TbSysOther item = new TbSysOther();
     using (var connection = DataBase.GetOpenConnection())
     {
         item = GetByID(id);
         res = connection.Delete<TbSysOther>(item);
     }
     return res;
 }
Esempio n. 3
0
 /// <summary>
 /// 插入一个对象
 /// </summary>
 /// <param name="item">需要插入的对象</param>
 /// <returns></returns>
 public int Insert(TbSysOther item)
 {
     int id = 0;
     using (var connection = DataBase.GetOpenConnection())
     {
         id = (int)connection.Insert<TbSysOther>(item);
     }
     return id;
 }