public static void Delete(AnHuoYiKu entity) { string sql = string.Empty; sql = "delete from anhuoyiku where cp='" + entity.Cp + "'"; SqliteDbFactory.GetSqliteDbOperator().ExecuteNonQuery(sql); }
public static bool CheckExists(AnHuoYiKu entity) { string sql = string.Empty; sql = "select * from anhuoyiku where cp='" + entity.Cp + "'"; DataTable dt = SqliteDbFactory.GetSqliteDbOperator().SelectFromSql(sql); return(dt != null && dt.Rows.Count == 1); }
/* * create table anhuoyiku(id integer primary key autoincrement, * ykw varchar(20),cp varchar(20), * sl integer,mdkw varchar(20), * scaner varchar(30),scantime datetime); */ public static void Save(AnHuoYiKu entity) { string sql = string.Empty; sql = "insert into anhuoyiku(ykw,cp,mdkw,sl,scaner,scantime) values('" + entity.Ykw + "','" + entity.Cp + "','" + entity.MdKw + "'," + entity.Sl + ",'" + entity.Scaner + "','" + System.DateTime.Now.ToString("s") + "')"; SqliteDbFactory.GetSqliteDbOperator().ExecuteNonQuery(sql); }