|
<br>
82N``VJZ]OOESMZUQM7K.jpg (70.99 KB, 下載次數: 177)
下載附件
保存到相冊
2014-1-14 11:48 上傳
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();
} |
|