public void Insert(ScriptTypeM Type) { SQLiteHelper.ExecuteNonQuery(@"insert into TB_ScriptType(ScriptTypeId,ScriptType,IsUsing) Values(@ScriptTypeId,@ScriptType,1)", new SQLiteParameter("ScriptTypeId", Type.ScriptTypeId), new SQLiteParameter("ScriptType", Type.ScriptType)); }
public void Update(ScriptTypeM Type) { SQLiteHelper.ExecuteNonQuery(@"update TB_ScriptType set ScriptType=@ScriptType, IsUsing=@IsUsing where ScriptTypeId=@ScriptTypeId", new SQLiteParameter("ScriptType", Type.ScriptType), new SQLiteParameter("IsUsing", Type.IsUsing), new SQLiteParameter("ScriptTypeId", Type.ScriptTypeId)); }
public ScriptTypeM ToScriptType(DataRow row) { ScriptTypeM type = new ScriptTypeM(); type.ScriptTypeId = (Guid)row["ScriptTypeId"]; type.ScriptType = (string)row["ScriptType"]; type.IsUsing = (bool)row["IsUsing"]; return(type); }
public ScriptTypeM[] Search(string sql, List <SQLiteParameter> parameterList) { DataTable table = SQLiteHelper.GetDataTable(sql, parameterList.ToArray()); ScriptTypeM[] type = new ScriptTypeM[table.Rows.Count]; for (int i = 0; i < table.Rows.Count; i++) { type[i] = ToScriptType(table.Rows[i]); } return(type); }
public ScriptTypeM[] ListAll() { DataTable table = SQLiteHelper.GetDataTable("select * from TB_ScriptType where IsUsing=1"); ScriptTypeM[] type = new ScriptTypeM[table.Rows.Count]; for (int i = 0; i < table.Rows.Count; i++) { type[i] = ToScriptType(table.Rows[i]); } return(type); }