public void DeleteContentType(ContentType contentType) { //Argument Contract Requires.NotNull("contentType", contentType); Requires.PropertyNotNegative("contentType", "ContentTypeId", contentType.ContentTypeId); _DataService.DeleteContentType(contentType); //Refresh cached collection of types DataCache.RemoveCache(_CacheKey); }
public int AddContentType(ContentType contentType) { //Argument Contract Requires.NotNull("contentType", contentType); Requires.PropertyNotNullOrEmpty("contentType", "ContentType", contentType.Type); contentType.ContentTypeId = _DataService.AddContentType(contentType); //Refresh cached collection of types DataCache.RemoveCache(_CacheKey); return contentType.ContentTypeId; }
private void LoadContentTypeList2DDL() { ContentType content_types_obj = new ContentType(); DataTable dt_content_types = content_types_obj.GetAll(); //select all the nodes from DB ddlContentTypes.Items.Clear(); ddlContentTypes.DataSource = dt_content_types; ddlContentTypes.DataTextField = "ContentType"; ddlContentTypes.DataValueField = "ContentTypeID"; ddlContentTypes.DataBind(); //ddlContentTypes.Items.Insert(0, new ListItem("- Chọn -", "")); ddlContentTypes.SelectedIndex = 0; ddlContentTypes.AutoPostBack = true; }