public static void Delete(ZuTuo entity) { string sql = string.Empty; sql = "delete from zutuo where sn='" + entity.Sn + "'"; SqliteDbFactory.GetSqliteDbOperator().ExecuteNonQuery(sql); }
public static bool CheckExists(ZuTuo entity) { string sql = string.Empty; sql = "select * from zutuo where sn='" + entity.Sn + "'"; DataTable dt = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sql); return(dt != null && dt.Rows.Count == 1); }
/* * create table zutuo(id integer primary key autoincrement * ,tph varchar(20),sn varchar(20),xxjh varchar(20), * scaner varchar(30),scantime datetime); */ public static void Save(ZuTuo entity) { string sql = string.Empty; sql = "insert into zutuo(tph,sn,xxjh,scaner,scantime) values('" + entity.Tph + "','" + entity.Sn + "','" + entity.Xxjh + "','" + entity.Scaner + "','" + entity.date.ToString("s") + "')"; SqliteDbFactory.GetSqliteDbOperator().ExecuteNonQuery(sql); }