Beispiel #1
0
 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));
 }
Beispiel #2
0
 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));
 }
Beispiel #3
0
        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);
        }
Beispiel #4
0
        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);
        }
Beispiel #5
0
        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);
        }