protected void TestUpdate_Click(object sender, EventArgs e) { FullItemDataRepository dataRepository = new FullItemDataRepository(); FullItem item = dataRepository.GetItemById(new Guid("42dec287-ae97-616c-accb-ff00009b0b8b")); item.ShortText = "new 22 ;) updated"; item.LongText = "uhaaaa"; item.SetChoicesSingle("1"); item.SetChoicesMultiple(new string[] { "2" }); item.YesNo = false; item.DateTime = new DateTime(2000, 1, 1); item.GuidField = new Guid("32200000-0000-0000-0000-000000000223"); item.ArrayOfGuids = new Guid[] { item.GuidField, item.GuidField, item.GuidField }; Address oldAddress = item.Address; oldAddress.City = "Kanzas"; item.Address = oldAddress; //////// item.ClearRelatedDynamicModuleMultiple(); item.AddRelatedDynamicModuleMultiple(this.GetRelatedItem(2)); item.SetRelatedDynamicModuleSingle(this.GetRelatedItem(0)); item.AddNewsRelatedDataMultiple(this.GetNewItem(2)); item.SetNewsRelatedDataSingle(this.GetNewItem(2)); item.SetFirstClassification(this.GetFirstTaxonItem(1).Id); item.ClearSecondClassification(); item.AddSecondClassification(this.GetSecondTaxonItem(0).Id, this.GetSecondTaxonItem(1).Id); item.ClearMultipleImageField(); item.AddMultipleImageField(this.GetImage(2)); item.AddMultipleImageField(this.GetImage(3)); item.SetSingleImageField(this.GetImage(1)); item.AddMultipleVideoField(this.GetVideo(2)); item.ClearSingleVideoField(); /////// dataRepository.Commit(); dataRepository.Publish(item); dataRepository.Commit(); }
protected void TestCreateButton_Click(object sender, EventArgs e) { FullItemDataRepository dataRepository = new FullItemDataRepository(); //FullItem item1 = this.CreateItem("new 11 :)", dataRepository); //FullItem item2 = this.CreateItem("new 22 :)", dataRepository); //dataRepository.Commit(); //dataRepository.Publish(item1); //dataRepository.Commit(); FullItem item = dataRepository.GetItemById(new Guid("42dec287-ae97-616c-accb-ff00009b0b8b")); dataRepository.Publish(item); dataRepository.Commit(); }