private void FormCustomerEdit_Load(object sender, EventArgs e) { this.textBoxCredit.Text = "0"; this.textBoxVatRate.Text = "17"; if (!m_isAdd) { this.buttonAdd.Enabled = false; this.buttonCustomerGroup.Enabled = false; if (m_isEditCustomer) { m_customer = Customer.getInctance().getCustomerInfoFromPkey(m_customerPkey); } else { m_customerType = CustomerType.getInctance().getCustomerTypeInfoFromPkey(m_customerGroupPkey); m_isCustomerGroup = true; } setPageActiveState(); setPageActiveValue(); } // 初始化区域下拉框值 ComboBoxExtend.initComboBox(this.comboBoxArea, "BASE_AREA_LIST"); }
private void modifyCustomerType() { CustomerTypeTable customerType = new CustomerTypeTable(); customerType.name = this.textBoxCustomerGroupName.Text.ToString(); customerType.desc = this.textBoxCustomerGroupDesc.Text.ToString(); if (customerType.name.Length == 0) { MessageBoxExtend.messageWarning("组名称不能为空,请重新填写!"); return; } CustomerType.getInctance().update(m_customerGroupPkey, customerType); }
private void SuppierGroupDelete_Click(object sender, EventArgs e) { if (MessageBoxExtend.messageQuestion("确定删除[" + m_customerGroupName + "]分组信息吗?")) { if (m_customerRecordCount > 0) { MessageBoxExtend.messageWarning("[" + m_customerGroupName + "] 删除失败,请先删除客户记录然后重试."); } else { CustomerType.getInctance().delete(m_customerGroupPkey); CustomerOrgStruct.getInctance().delete(CustomerOrgStruct.getInctance().getPkeyFromValue(m_customerGroupPkey)); refreshTreeView(); } } }
private void processDutyOrgNode(int parentID, TreeNode node) { string nodeName = ""; TreeNode currentNode; ArrayList nodeList = CustomerOrgStruct.getInctance().getNodesFormParentID(parentID); for (int i = 0; i < nodeList.Count; i++) { CustomerOrgStructTable record = (CustomerOrgStructTable)nodeList[i]; nodeName = CustomerType.getInctance().getCustomerTypeNameFromPkey(record.value); currentNode = m_tree.addNode(node, nodeName, 0, 1, Convert.ToString(record.value)); processDutyOrgNode(record.pkey, currentNode); } }
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 addCustomerType() { CustomerTypeTable customerType = new CustomerTypeTable(); customerType.name = this.textBoxCustomerGroupName.Text.ToString(); customerType.desc = this.textBoxCustomerGroupDesc.Text.ToString(); if (customerType.name.Length == 0) { MessageBoxExtend.messageWarning("组名称不能为空,请重新填写!"); return; } CustomerType.getInctance().insert(customerType); // 客户组织结构 CustomerOrgStructTable customerOrgInfo = new CustomerOrgStructTable(); customerOrgInfo.parentPkey = CustomerOrgStruct.getInctance().getPkeyFromValue(m_customerGroupPkey); customerOrgInfo.value = CustomerType.getInctance().getMaxPkey(); CustomerOrgStruct.getInctance().insert(customerOrgInfo); }