At the beginning of this series of essays, this paper introduces an important customer classification display interface of CRM system, which includes the implementation of loading classification from the dictionary, loading classification from existing data, loading classification in the grouped list, and dynamically configuring these nodes to realize the interface configuration processing of customer classification. This paper mainly from the point of view of logic code to explain the realization of the above functions, introduce the dynamic loading of the General dictionary module, Customer province City dynamic loading, customer group management, customer classification configuration Management module implementation.
In general, our customer classification requires dynamic loading, the management of this customer classification, including the following categories.
1. Dynamic loading of General dictionary module
The above nodes are dynamically loaded from the data of the dictionary module, and the contents are different according to the nodes.
First we need to create a table in the database to record the large classification nodes that need to be displayed, such as Customer status, customer type, customer level, and so on, as shown below.
According to the contents of this table, we are dynamically loading the child nodes inside.
TreeNode Topnode = new TreeNode ("All Customers", 0, 0);
THIS.TREEVIEW1.NODES.ADD (Topnode);
list<systemtreenodeinfo> proplist = Bllfactory<systemtree>. Instance.gettree ("Customer attribute Classification");
foreach (Systemtreenodeinfo nodeinfo in proplist)
{
if (Containtree (nodeinfo.id))
{
TreeNode subnode = new TreeNode (nodeinfo.treename, 1, 1);
Addsystemtree (Nodeinfo.children, subnode, 2);
THIS.TREEVIEW1.NODES.ADD (subnode);
}
This.treeView1.ExpandAll ();
for (int i = 0; i < This.treeView1.Nodes.Count i++)
{
TreeNode node = this.treeview1.nodes[i];
Adddictdata (node, 3);
}