private bool addMaterielType() { MaterielTypeTable materielType = new MaterielTypeTable(); materielType.name = this.textBoxMaterielGroupName.Text.ToString(); materielType.num = this.textBoxGroupNum.Text.ToString(); materielType.desc = this.textBoxMaterielGroupDesc.Text.ToString(); if (materielType.name.Length == 0) { MessageBoxExtend.messageWarning("物料分组保存失败, 组名称不能为空,请重新输入!"); return(false); } if (materielType.num.Length == 0 || materielType.num.Length > 10) { MessageBoxExtend.messageWarning("物料分组保存失败, 组编号长度必须为1-10位,请重新输入!"); return(false); } MaterielType.getInctance().insert(materielType); // 物料组织结构 MaterielOrgStructTable materielOrgInfo = new MaterielOrgStructTable(); materielOrgInfo.parentPkey = MaterielOrgStruct.getInctance().getPkeyFromValue(m_materielGroupPkey); materielOrgInfo.value = MaterielType.getInctance().getMaxPkey(); MaterielOrgStruct.getInctance().insert(materielOrgInfo); return(true); }
private void processDutyOrgNode(int parentID, TreeNode node) { string nodeName = ""; TreeNode currentNode; ArrayList nodeList = MaterielOrgStruct.getInctance().getNodesFormParentID(parentID); for (int i = 0; i < nodeList.Count; i++) { MaterielOrgStructTable record = (MaterielOrgStructTable)nodeList[i]; nodeName = MaterielType.getInctance().getMaterielTypeNameFromPkey(record.value); currentNode = m_tree.addNode(node, nodeName, 0, 1, Convert.ToString(record.value)); processDutyOrgNode(record.pkey, currentNode); } }
/* * 各种测试代码如下 * * */ private bool addMaterielTypeTest(int materielGroupPkey) { MaterielTypeTable materielType = new MaterielTypeTable(); materielType.name = "addMaterielTypeTest"; materielType.num = "0"; materielType.desc = "addMaterielTypeTest desc"; MaterielType.getInctance().insert(materielType, false); // 物料组织结构 MaterielOrgStructTable materielOrgInfo = new MaterielOrgStructTable(); materielOrgInfo.parentPkey = MaterielOrgStruct.getInctance().getPkeyFromValue(materielGroupPkey); materielOrgInfo.value = MaterielType.getInctance().getMaxPkey(); MaterielOrgStruct.getInctance().insert(materielOrgInfo, false); return(true); }
private void addMaterielType() { MaterielTypeTable materielType = new MaterielTypeTable(); materielType.name = this.textBoxMaterielGroupName.Text.ToString(); materielType.desc = this.textBoxMaterielGroupDesc.Text.ToString(); if (materielType.name.Length == 0) { MessageBoxExtend.messageWarning("组名称不能为空,请重新输入!"); return; } MaterielType.getInctance().insert(materielType); // 物料组织结构 MaterielOrgStructTable materielOrgInfo = new MaterielOrgStructTable(); materielOrgInfo.parentPkey = MaterielOrgStruct.getInctance().getPkeyFromValue(m_materielGroupPkey); materielOrgInfo.value = MaterielType.getInctance().getMaxPkey(); MaterielOrgStruct.getInctance().insert(materielOrgInfo); }