private void FormSupplierEdit_Load(object sender, EventArgs e) { this.textBoxCredit.Text = "0"; this.textBoxVatRate.Text = "17"; if (!m_isAdd) { this.buttonAdd.Enabled = false; this.buttonSupplierGroup.Enabled = false; if (m_isEditSupplier) { m_supplier = Supplier.getInctance().getSupplierInfoFromPkey(m_supplierPkey); } else { m_supplierType = SupplierType.getInctance().getSupplierTypeInfoFromPkey(m_supplierGroupPkey); m_isSupplierGroup = true; } setPageActiveState(); setPageActiveValue(); } // 初始化区域下拉框值 ComboBoxExtend.initComboBox(this.comboBoxArea, "BASE_AREA_LIST"); }
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 modifySupplierType() { 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().update(m_supplierGroupPkey, supplierType); }
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 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); }