public void UpdateCategories(RaoVatCategory raoVatCategory) { this.sqlDb.RunQuery("update categories set name = @name, slug = @slug, parent_id = @parent_id, path=@path where id = @id", CommandType.Text, new SqlParameter[] { SqlDb.CreateParamteterSQL("id", raoVatCategory.id, SqlDbType.Int), SqlDb.CreateParamteterSQL("name", raoVatCategory.name, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("slug", raoVatCategory.slug, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("level", raoVatCategory.level, SqlDbType.Int), SqlDb.CreateParamteterSQL("path", raoVatCategory.path, SqlDbType.NVarChar), }); }
public void InsertCategory(RaoVatCategory raoVatCategory) { this.sqlDb.RunQuery(@"Insert Into Categories (id, name, slug, parent_id, level, path)" + "Values (@id, @name, @slug, @parent_id, @level, @path)", CommandType.Text, new SqlParameter[] { SqlDb.CreateParamteterSQL("id", raoVatCategory.id, SqlDbType.Int), SqlDb.CreateParamteterSQL("name", raoVatCategory.name, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("slug", raoVatCategory.slug, SqlDbType.NVarChar), SqlDb.CreateParamteterSQL("level", raoVatCategory.level, SqlDbType.Int), SqlDb.CreateParamteterSQL("parent_id", raoVatCategory.level, SqlDbType.Int), SqlDb.CreateParamteterSQL("path", raoVatCategory.path, SqlDbType.NVarChar), }); }