|
<br>
private void btn_新增大类_Click(object sender, EventArgs e)
{
var objFactory = new EAPLib.CxOtlObjectFactory();
var newPrdClass = objFactory.raw_create("ProductClassification");
var pset = new EAPLib.CxPropertySet();
object nm = this.text_大类名称.Text; ;
pset.define_property("name", ref nm);
(newPrdClass as EAPLib.ICxOtlAttribute).set_info(pset);
(newPrdClass as EAPLib.ICxOtlPersistObject).store();
var linkFactory = new EAPLib.CxOtlLinkFactory();
//var root = objFactory.raw_create("ProductClassification");
//(root as ICxOtlIdentifierObject).set_id(0);
var root = this.treeView1.SelectedNode.Tag as ICxOtlObject;
var newlink = linkFactory.create(null, root, "ParentProductClass", newPrdClass, "ChildProductClass");
(newlink as EAPLib.ICxOtlPersistObject).store();
} |
|