For ERP/MIS software, some auxiliary tools are usually developed to accelerate development, suchCodeGenerator, a data dictionary generation tool. With the accumulation of time, these gadgets will become more and more. Although the development speed will be fast and convenient, it will be difficult to find these gadgets because they cannot be found. The reason is very simple. After a lot of effort has been made into a tool, you will naturally not consider using a very primitive method to complete the task.
Example
For plug-in development, we usually do a good job of interface functions first, and then add this function to the system function list to enable the function for this purpose, you can use the following SQL script to complete
Insert system_function (module, function, description)
Values ('ventory ', 'icmisr', 'ventory receipt ')
In this way, the new warehouse receiving and ordering function is added to the system function to enable the function.
However, this is usually not the case. It is usually necessary to set which users and roles have the permission to execute the warehouse import function, and so on.
One way to improve is to make all these functions into script files. After one call, the function is added and permissions are assigned.
For example, this is a simple tool.
The theme I want to talk about is how to integrate these gadgets into a container for convenient calling after a long time.
First, while looking at the image and saying
Here, I integrate many tools, such
Dataset Reader is a tool used to read dataset.
Translation tools in multiple languages,
Stringbuilder string construction tool, for example, I want
Select functioncode from DBO. audittrail is converted to a string and passed to SQL Server.
To integrate the warehouse receiving function into this tool, you need to handle the following:
Modify the inheritance base class of the form to formbase and add the functioncode feature to the form class. This feature is used to find the form in reflection.
Modify the listitem. xml file and add an item,
Content is
<Item index = "10" text = "inventoryreceept" tag = "inventory receept" imageindex = "35"> </item>
The content of listitem, that is, the content to be displayed in the task list task box. Text is the title, tag is the value of function functioncode, and imageindex is the image index.
In fact, more control can be done here. For exampleSource code, The call function must be reflectedProgramTo achieve this goal, you also need to add item. Assembly to point to all its assemblies;
If the source code of the function is not written by. Net code, you must add parameters when necessary to enable the tool in process. Start mode.
Go to the source code and see how the tool is constructed.
Mainform is the main form. Here the infragistics2.win. ultrawintabbedmdi component is used to replace the outdated MDI form organization form,
Newproject is the task list task form, which is an integrated project displayed by function. CTRL + n start this form, and listitem. XML is its configuration item.
Other menus in the main form are not used
Startup is the main form displayed at startup. The Shortcut of some common tools can be displayed here.
To obtain the same blue theme effect as Office 2007, you can comment out the following code:
Toolstripmanager. Renderer = new winui. Misc. office2007renderer ();
Statusstrip. Renderer = new winui. Misc. office2007renderer ();
The effects of menus and status bars are as follows:
Reflection is used to find the features of a form, find out its definition, and display it. The code framework is as follows:
Assembly = assembly. getexecutingassembly ();
Object entryform = activator. createinstance (formbasetype) as form;
Entryform. mdiparent = this;
Entryform. Show ();
Entryform. Activate ();
This is the most valuable tool. It also achieved the effect proposed at the beginning, only the development function and the configuration of the listitem file, indeed achieve the purpose of the plug-in.
Go to epn.codeplex.com to obtain the latest source code. Use Visual Studio 2008 to compile the code.
Because some of the plug-in tools mentioned in the figure have been applied to actual production, source code download is not provided.