Category cat1 = new Category();
cat1.Available = true;
cat1.CategoryCode = "CatCode1";
cat1.CategoryID = Guid.NewGuid();
cat1.IsProgramLevel = true;
cat1.ParentCategoryID = Guid.NewGuid();
cat1.StringID = Guid.NewGuid();
cat1.CategoryName = new LocalizationEntity();
cat1.CategoryName.LocalizedString = "Cat Name1";
cat1.CategoryName.LocalizedStringID = cat1.StringID;
cat1.CategoryName.PlatformLanguageID = Guid.NewGuid();
cat1.CategoryName.LocalizedStringID = Guid.NewGuid();
string xmldataCat = SerializationHelper.Serialize(typeof(Category), cat1);
SerializationHelper.SerializeBOData(typeof(Category), @"d:\testcat.xml",cat1);
Category catNew = (Category)SerializationHelper.DeSerialize(typeof(Category), xmldataCat);
Category catnewFile = (Category)SerializationHelper.DeserializeXml(typeof(Category), @"d:\testcat.xml");
//CIPAttribute attr1 = new CIPAttribute();
//CIPAttribute attr2 = new CIPAttribute();
//ca.Attributes.Add(attr1);
//ca.Attributes.Add(attr2);
//ca.CIPCategory = cat1;
// string xmlData = SerializationHelper.Serialize(typeof(CategoryAttribute), ca);
cat1.Available = true;
cat1.CategoryCode = "CatCode1";
cat1.CategoryID = Guid.NewGuid();
cat1.IsProgramLevel = true;
cat1.ParentCategoryID = Guid.NewGuid();
cat1.StringID = Guid.NewGuid();
cat1.CategoryName = new LocalizationEntity();
cat1.CategoryName.LocalizedString = "Cat Name1";
cat1.CategoryName.LocalizedStringID = cat1.StringID;
cat1.CategoryName.PlatformLanguageID = Guid.NewGuid();
cat1.CategoryName.LocalizedStringID = Guid.NewGuid();
string xmldataCat = SerializationHelper.Serialize(typeof(Category), cat1);
SerializationHelper.SerializeBOData(typeof(Category), @"d:\testcat.xml",cat1);
Category catNew = (Category)SerializationHelper.DeSerialize(typeof(Category), xmldataCat);
Category catnewFile = (Category)SerializationHelper.DeserializeXml(typeof(Category), @"d:\testcat.xml");
//CIPAttribute attr1 = new CIPAttribute();
//CIPAttribute attr2 = new CIPAttribute();
//ca.Attributes.Add(attr1);
//ca.Attributes.Add(attr2);
//ca.CIPCategory = cat1;
// string xmlData = SerializationHelper.Serialize(typeof(CategoryAttribute), ca);
No comments:
Post a Comment