private void FormBaseSupplier_Load(object sender, EventArgs e) { m_tree = new TreeViewExtend(this.treeViewSupplierOrg); m_rootNodePkey = SupplierOrgStruct.getInctance().getRootNodePkey(); int rooNodeValue = SupplierOrgStruct.getInctance().getNoteValueFromPkey(m_rootNodePkey); string rootName = SupplierType.getInctance().getSupplierTypeNameFromPkey(rooNodeValue); m_rootNode = this.treeViewSupplierOrg.Nodes.Add(Convert.ToString(m_rootNodePkey), rootName); refreshTreeView(); }
private void processDutyOrgNodeSupplier(int parentID, TreeNode node) { string nodeName = ""; TreeNode currentNode; ArrayList nodeList = SupplierOrgStruct.getInctance().getNodesFormParentID(parentID); for (int i = 0; i < nodeList.Count; i++) { SupplierOrgStructTable record = (SupplierOrgStructTable)nodeList[i]; nodeName = SupplierType.getInctance().getSupplierTypeNameFromPkey(record.value); currentNode = m_tree.addNode(node, nodeName, 0, 1, Convert.ToString(record.value)); processDutyOrgNodeSupplier(record.pkey, currentNode); } }
private void SuppierGroupDelete_Click(object sender, EventArgs e) { if (MessageBoxExtend.messageQuestion("确定删除[" + m_supplierGroupName + "]分组信息吗?")) { if (m_supplierRecordCount > 0) { MessageBoxExtend.messageWarning("[" + m_supplierGroupName + "] 删除失败,请先删除供应商记录然后重试."); } else { SupplierType.getInctance().delete(m_supplierGroupPkey); SupplierOrgStruct.getInctance().delete(SupplierOrgStruct.getInctance().getPkeyFromValue(m_supplierGroupPkey)); refreshTreeView(); } } }
private void refreshTreeView() { if (m_tree != null && treeViewMaterielOrg.Nodes.Count > 0) { treeViewMaterielOrg.Nodes.Clear(); } m_tree = new TreeViewExtend(this.treeViewMaterielOrg); if (m_type == 1) { int rootNodePkey = MaterielOrgStruct.getInctance().getRootNodePkey(); int rooNodeValue = MaterielOrgStruct.getInctance().getNoteValueFromPkey(rootNodePkey); string rootName = MaterielType.getInctance().getMaterielTypeNameFromPkey(rooNodeValue); m_rootNode = this.treeViewMaterielOrg.Nodes.Add(Convert.ToString(rooNodeValue), rootName); processDutyOrgNodeMateriel(rootNodePkey, m_rootNode); } else if (m_type == 2) { int rootNodePkey = CustomerOrgStruct.getInctance().getRootNodePkey(); int rooNodeValue = CustomerOrgStruct.getInctance().getNoteValueFromPkey(rootNodePkey); string rootName = CustomerType.getInctance().getCustomerTypeNameFromPkey(rooNodeValue); m_rootNode = this.treeViewMaterielOrg.Nodes.Add(Convert.ToString(rooNodeValue), rootName); processDutyOrgNodeCustomer(rootNodePkey, m_rootNode); } else if (m_type == 3) { int rootNodePkey = SupplierOrgStruct.getInctance().getRootNodePkey(); int rooNodeValue = SupplierOrgStruct.getInctance().getNoteValueFromPkey(rootNodePkey); string rootName = SupplierType.getInctance().getSupplierTypeNameFromPkey(rooNodeValue); m_rootNode = this.treeViewMaterielOrg.Nodes.Add(Convert.ToString(rooNodeValue), rootName); processDutyOrgNodeSupplier(rootNodePkey, m_rootNode); } m_rootNode.Expand(); }
private SortedDictionary <int, SupplierTable> getCurrentNodeAllChildNodesSupplier() { SortedDictionary <int, SupplierTable> supplierList = new SortedDictionary <int, SupplierTable>(); SortedDictionary <int, int> childNodeValues = SupplierOrgStruct.getInctance().getAllChildNodeValue(m_supplierGroupPkey); if (!childNodeValues.ContainsKey(m_supplierGroupPkey)) { childNodeValues.Add(m_supplierGroupPkey, m_supplierGroupPkey); } foreach (KeyValuePair <int, int> index in childNodeValues) { SortedDictionary <int, SupplierTable> temp = Supplier.getInctance().getSupplierInfoFromSupplierType(index.Value); foreach (KeyValuePair <int, SupplierTable> i in temp) { SupplierTable supplier = new SupplierTable(); supplierList.Add(supplierList.Count, (SupplierTable)i.Value); } } return(supplierList); }
private void addSupplierType() { SupplierTypeTable supplierType = new SupplierTypeTable(); supplierType.name = this.textBoxSupplierGroupName.Text.ToString(); supplierType.desc = this.textBoxSupplierGroupDesc.Text.ToString(); if (supplierType.name.Length == 0) { MessageBoxExtend.messageWarning("组名称不能为空,请重新填写!"); return; } SupplierType.getInctance().insert(supplierType); // 供应商组织结构 SupplierOrgStructTable supplierOrgInfo = new SupplierOrgStructTable(); supplierOrgInfo.parentPkey = SupplierOrgStruct.getInctance().getPkeyFromValue(m_supplierGroupPkey); supplierOrgInfo.value = SupplierType.getInctance().getMaxPkey(); SupplierOrgStruct.getInctance().insert(supplierOrgInfo); }