Resolve large. NET ERP System Core Components Query Designer Report Designer Form Designer Workflow Designer Task Scheduler Designer

Source: Internet
Author: User

Enterprise management Software contains a number of common components that must be considered in each new project stage. The core of the stability of the function, convenient system development and maintenance, but also for the system two times the development of a lot of convenience. For example, the general rights management system, general purpose attachment management, general query and other components, if the project is prepared before the development of these components, to ensure that the project on schedule delivery.

    • Query Designer supports selecting one or more database tables, constructing query results by left and right connections, supporting direct handwritten SQL statement design queries, supporting calling stored procedure queries, and supporting code design queries.
    • Report Designer supports configuring the Report Parameters dialog box, supports multiple languages of reports, supports report parameter setting and printing
    • Form Designer Forms designers support the layout and appearance (appearance) of user-defined interface controls, enabling users to modify the search criteria for interface controls
    • Workflow Designer Workflow Designer supports custom processes, supports custom message notifications, supports custom events, and supports scheduled tasks
    • Task Scheduler designer Schedule Designer support Scheduled Tasks

Query Designer Queries Designer

In the system maintenance process, constantly add new fields, generally do not immediately rewrite the system's existing queries, but need a way to immediately see the system changes, or the system's existing queries can not meet the needs of customers, query Designer is to solve the problem of the system query function development.

I have considered the following kinds of query methods, briefly describe how they are implemented for reference.

1 SQL statement SQL statements

Assuming that the customer's system maintenance personnel understand the SQL statements, after years of customer accumulation of systems, software companies also have many common query statements, these query statements into a query function to execute, you can get data.

Refer to the following example of the SQLDBX program, the interface can be simplified in the system, only the input SQL statements and display the results of the query place.

To facilitate end-user analysis of the resulting data, the system needs to provide functions such as export of query results data (Microsoft Excel), filtering, sorting, grouping, and so on.

ERP system will save each query, the next time the user only need to hit the query number to see the results of the query, and the results of the operation of the data.

2 graphical query Design GUI Query Designer

If the user does not understand the SQL statement, the system considers providing a graphical way for the user to design the query. Remember 10 years ago when I was learning SQL statements, is very looking forward to have an intelligent tool, you can let me choose to query the data table and fields, and then set the Data Table Association, and finally get the query I need. The system references the Query Designer for access, referring to the classic Access query design interface:

The Query Designer for access in Microsoft Office suite after years of development, there should be enough reason to believe that this interface is the most easily accepted by non-it people of the query design interface. Just use the mouse to select the table to query, and then choose the fields to display, the system automatically generates the corresponding SQL statement.

Drawing query Design This feature often appears in Report Designer, the Report Designer usually attaches a graphical query design tool, where we can find its interface prototype, after simplifying to become the ERP system query design tool.

3 Stored procedure queries query by Stored Procedure

If the SQL Statement or table association does not satisfy the query requirements of the data, the system may consider increasing the stored procedure support to meet the more complex query requirements. In the ERP financial statements, various financial statistical reports are indeed quite cumbersome, non-use stored procedures are not. We need to think about how to pass parameters to the stored procedure and display the return results of the stored procedure to meet this requirement. To do this, the following query statements are designed:

EXEC  Sprpt_orderamttotal  % 1,%2   

The next two parameters of a stored procedure are placeholder symbols that indicate that parameters need to be passed to this stored procedure. Therefore, you also need to design a parameter mapping, set the type of parameters, length, run this query, the user input values are replaced in the above two placeholder, passed into the stored procedure.

The definition of a stored procedure already defines its parameter type, and when the system runs the query, the system needs to convert the value represented by the value of%1 above into the type of parameter required by the stored procedure, such as the date from in% 1, and the system requires the user's input values to be coerced into a datetime type. It is then passed to the stored procedure to get the returned result.

4 program queries query by programs

Write query with program code can be divided into two cases, document query, list query. The document query only needs to inherit the original document edit form, the setup form is not editable, so the document query is completed. List query refers to the need for users to enter one or several filter conditions, according to filter conditions to get query results.

The code of the document query is very simple, just reset several properties, refer to the following code example.

 Public Partial class salescontractenquiry:foundation.sales.entry.salescontractentry{public         costsheetenquiry ()        {              InitializeComponent ();                  This false;                             This false;               This false;        }

The new, deleted, and edited actions of the document are disabled in the program code so that the document form becomes the query form.

The interface of the list query is as follows, the filter input control is above the interface, and the query result is shown below. The query results can be exported to Excel, filtered, grouped, or graphically rendered.

Report Designer

Report Designer is divided into two components, one is report design, the other is the report, the former is design, and the latter is render. There are many report design tools on the market, and I am more familiar with the Crystal Report and Reporting Services (SQL Server Reporting Services). When I first graduated from the Open Source Report Designer, RDLC Designer, is an open source implementation of Microsoft Reporting Services. Contact Crystal Report At work more time, my technical director wrote a Crystal Report viewer, full of reflection calls made of the Report Viewer, do not rely on the version of the Crystal Report, found Crystal Report pairs. NET support is fairly stable, from Crystal Reports for Visual Studio runtime to the present Crystal Report 13.10, almost no changes to the code can be perfect to run the technical director of the Code, Crystal reporting is. NET report-making industry standards.

Limited capacity, there is no energy to maintain a Report designer code, report design using the SAP Crystal Report Designer, this tool has not been updated for many years, the latest version can be found is Crystal Reports SP2.

So this part of the content is measured in the report rendering (render), and strive to design a perfect report reader. As a core feature, the following requirements are listed:

    • After the report design is complete, it is not required. NET programming to invoke reports, the main difficulty is parameter passing.
    • Reports support multiple languages, that is, support English, simplified, traditional three languages display reports.
    • Reports are easy to deploy and can be run with a single crystal Report runtime installed.
    • Report customization is easy, users can either use the standard report provided by the system, or modify the report by custom.
1 Parameter Pass Dynamic Parameter

The Crystal report is divided into three types of parameters and adjusts the three values to change the data of the Crystal Report. Define the following enumeration:

 Public enum reportfieldtype{        [DisplayText ("Selection Formula"), StringValue ("0")]        Selectionformula = 0,        [DisplayText ("Formula Field"), StringValue ("1")]        Formulafield = 1,        [DisplayText ("Parameter"), StringValue ("2")]        Parameter = 2       }

The above three definitions of various ways, with the following Crystal Reports can be more clearly understand their meaning:

0 represents the table record selection criteria, 1 for the formula, and 2 for the parameter. In these three ways, you can define the following table structure:

When you run the report, the control is generated based on the parameter table above, and the value of the control is passed to the Crystal report, which completes the parameter passing.

The benefit of this development is that the technical support staff can independently produce and develop reports, without the need for development department to develop a parameter selection interface for each interface.

2 Multi-lingual Localization

How to design only one report, but it lets it display reports in three localized languages at the same time. has undergone the following evolutionary approaches.

1) define a languagecode formula or parameter that is passed into the report by the system and represents the language that is currently being displayed. Each text label in the Crystal Report is represented by a formula, and the example of the formula Ccy is as follows:

if  "Currency"  Else if languagecode=2 then "Money"else   "Currency"

As you can see from the formula, 1 is English, 2 is traditional Chinese, and the other numbers represent Simplified Chinese. This shows the value of the text label according to the value of the passed-in Languagecode, which realizes the multi-language display of the report.

2) using the. NET localization scenario, define three resource files, respectively, Resource.en-us.resx,resource.zh-cn.resx, Resource.zh-tw.resx, when the assembly is compiled, three child assemblies with a language identity are generated, and the. NET runtime finds the appropriate resource file based on the language, invoking the language-paired resource. The key code calls are as follows:

New CultureInfo (culturename);

3) Translate Crystal Report control Textobject

This method is to use the Crystal Report. NET API, to find the Crystal Report needs to translate the object, generally textobject, translate it into the corresponding localized language again display, this scheme is favored by the report developers, the development of the report only need to follow the standard English version of the practice, Automatically translates to a localized language when it needs to be displayed in another language. You can refer to the code snippet below for a deeper understanding.

IEnumerator reportobjectenumerator = (IEnumerator) reflectionhelper.invokemethod (reportobjects,"GetEnumerator"); while(Reportobjectenumerator.movenext ()) {Try{ObjectReportObject = reportobjectenumerator.current;ObjectObjectKind = Reflectionhelper.getpropertyvalue (ReportObject,"Kind");stringObjectkindname = Enum.getname (Objectkind.gettype (), objectkind);if(string. CompareOrdinal (Objectkindname,"Textobject") = = 0 | |string. CompareOrdinal (Objectkindname,"Fieldheadingobject") = = 0) {stringText = (string) Reflectionhelper.getpropertyvalue (ReportObject,"Text");if(!string. IsNullOrEmpty (text)) {stringTranslatedtext = Componentcommon.translatetext (text,false);if(string. CompareOrdinal (text, translatedtext)! = 0) Reflectionhelper.setpropertyvalue (reportobje Ct"Text", Translatedtext); }                        }                    }Catch{                    }                }

Reflection calls an object to implement the effect of foreach, you need to call the GetEnumerator method.

3 Deployment Deployment

Write a Crystal Report runtime detection program that detects the installed version of the Crystal Report. The Crystal Report control is all called by the reflection method, the following code example, so that the compile time does not depend on the Crystal Report version of the effect, deployment more flexible and convenient.

 Reflectionhelper.setpropertyvalue (this . _crystalreportviewer,  "ReportSource" , this . _report); Reflectionhelper.invokemethod (this . _crystalreportviewer,  "Update" ); Reflectionhelper.invokemethod (this . _crystalreportviewer,  "Zoom" , new  system.type[] {typeof  (int )}, new  object  [] {1}); Reflectionhelper.invokemethod (this . _crystalreportviewer,  "Zoom" , new  system.type[] {typeof  (int )}, new  object  [] {this . _              Zoomfactor}); 
4 Report Customization

Introducing the concept of an alternative report (Alternate reports), embedding a standard report in an assembly, or placing it in a standard report directory, and also supporting a path option for an alternate report, when the system reads the report, first finds the report file in the alternate report path, and finds it in an alternate report. Otherwise, you will continue to find the report in the standard report path. Because the two reports are placed in different paths, the same report files do not affect and overwrite each other, which solves the problem of custom report and System report choice. The concept of substitution (Alternate) is also used in the replacement material of the bill of Materials, when the production of materials when the material is not enough, you can find alternative materials, such as we are thirsty to drink soda, you can also choose to drink herbal tea.

Forms Designer Form Designers

The form designer is widely used in the Erp/mis realm, and Visual studio itself is a well-designed form designer. The BOS system of Kingdee ERP all relies on its form designer, on this basis to do data binding and plug-in development. Microsoft InfoPath is also a custom form job that is often used to customize forms for OA systems. Just graduated that will also very like to study form designer Re-host technology, unfortunately has not found a technical breakthrough, do not know whether such design is reasonable. Once touched by the "like building blocks to do software," the book is based on a form designer to do expression evaluation, do event binding and attribute binding, do not need to encode and develop enterprise management software.

Yet this wonderful technology is an illusion, and Visual Studio is still the most popular development tool, and form development is still the focus of enterprise management software development. The form designer produces code that has only a small amount of indirect use. I did not go into this topic in depth, but the knowledge points I know are listed below.

1 The Form designer can generate cs/vb/xml three code formats. NET dynamic compilation technology is already very mature, directly call the. NET API can compile CS/VB code into an assembly, here I choose the third format, I do not need to use the form designer to fully develop a new feature, which involves data binding, master-slave data and a series of challenges, I just need the designer to generate the XML format, I can load this custom layout first, so the XML format is sufficient.

2 The Form object to be designed is an existing system feature. The user may want to modify the layout or appearance of the interface control. During the implementation, it was seen that many customers liked to label the controls red or blue to speed up reading, but when the screen was full of colorful controls, it reduced the speed of reading comprehension. The other is the layout of the control, a tab that some users do not need, and controls can be hidden through the form designer.

3 The most important part of the form designer is the ability to modify the lookup of the interface control. Reference.

The form designer can modify the filter criteria for the Find button in the Customer no, and this important feature greatly reduces the burden on developers.

4 The Form designer cannot be used to completely re-develop a new feature, from interface design to data binding, to data validation, and to data checking

References, the implementation of these features cannot be done by dragging and dropping the controls on the mouse. Even with a large number of two development, like Kingdee to make Bos, its scalability and flexibility is still that to control. such as unit price * Quantity = amount, in order to enter the unit price or quantity, automatically calculate the amount. BOS has too many items to consider, and I'm finally completely abandoning this development pattern, using only a small subset of the form designer's features: control appearance and layout modification, control lookup customization.

Workflow Designer Workflow Designer

Four basic functions of workflow implementation: Notification reminders, approving, scheduling tasks, calling custom code.

In order to achieve this goal, Microsoft's. NET WF has done the following to achieve these goals.

1 defining the Activity library activities

An activity is a code execution unit in a workflow, and a workflow definition is itself an activity. Based on business needs, the following activity libraries are defined:

Document batch activity, send message activity, send mail activity, invoke. NET code activity, execute Database query activity, report generation activity.

2 Defining the Workflow type Workflow

Define the following types of business, depending on your business needs:

Document class: Document saving, document updating, document deletion, document new.

Business class: Document review, document approval, business posting, business completion, business cancellation.

Task Scheduler: Workflow execution at scheduled times

3 Workflow Designer Workflow designer Rehost

An example of the Rehost Workflow Designer is available in MSDN, which can be referenced directly, add custom activity components and custom workflow types, and then save the Workflow Designer output format as xoml to complete most of the Workflow designer's functionality.

One of the more complex is the custom conditional expression, which requires an evaluation tool with the object expression. There are many examples of conditional expressions in Code project, and the difficulty is how to hook up the state of a business document with a workflow.

4 Workflow Monitor Workflow monitor

The system needs a visual tool to see the nodes that each process is currently running, and there are examples from MSDN for reference.

5 Workflow Persistence Workfllow Persistence

. NET provides the underlying service, creates a workflow state to save the database, and a workflow tracking database.

6 Workflow Server Workflow Server

The interaction between the workflow and the business part of the system, which specifically opens a separate port for data reading and writing.

Task Scheduler Designer Schedule Designer

Job scheduling in enterprise applications, common operations are as follows: Mail alerts and alarms, perform file transfer operations, create complex reports.

The system is divided into two scheduling Task Scheduler, one is based on SQL Server Agent implementation, timed SQL statement execution, the other is based on the Quartz Framework library implementation, with. NET Code Development Task Scheduler.

1 based on SQL Server Agent

The SQL Server job is an object that executes the script periodically, giving it a time option to complete the SQL Server Agent-based scheduler.

Depending on the value of the control, the interface generates a SQL Server Job with different parameters, referring to the following program snippet:

 Private voidBtnok_click (Objectsender, EventArgs e) {if(Schedule = =NULL) Schedule =NewSqlschedule (); Schedule.name = TxtName.Text.Trim ();if(chkenabled.checked) schedule.enabled = 1;Elseschedule.enabled = 0;if(Cmbscheduletype.selectedindex = = 1) {schedule.freq_type = 1;//One-timeSchedule.active_start_date = Dtonetimeoccurdate.value; Schedule.active_end_date =NewDateTime (9999, 12, 31);                Schedule.active_start_time = Dtonetimeoccurtime.value; Schedule.active_end_time =NewDateTime (2000, 1, 1, 23, 59, 59); }Else{if(Cmbfrequencyoccurs.selectedindex = = 0) {schedule.freq_type = 4;//DailySchedule.freq_interval = (int) Numfrequencyrecurs.value; }if(Cmbfrequencyoccurs.selectedindex = = 1) {Schedule.freq_type = 8;//Weekly                    intfreq_interval = 0;if(chkfrequencyrecurssun.checked) Freq_interval + = 1;if(chkfrequencyrecursmon.checked) Freq_interval + = 2;if(chkfrequencyrecurstue.checked) Freq_interval + = 4;

This tool comes from an article on code project that you can try to find using SQL Agent Job Editor.

2 quartz.net Task Scheduling framework

This is a famous project that was transformed by a Java project, and its logic was re-established with. NET code. See the source code for one of the simplest task plans.

 Public class hellojob:ijob{                Privatestatic ILog _log = Logmanager.getlogger (typeof(Hellojob));                 Public Hellojob ()        {        } public                virtualvoid  Execute ( Ijobexecutioncontext context)        {            //Say Helloto the world and display the Date/time            _log. Info (string. Format ("Hello world! -{0} ", System.DateTime.Now.ToString (" R ")));}        }

Quartz.net has handled all the details about the scheduling of tasks, it's easy to get started, and the official examples are quite rich.

Resolve large. NET ERP System Core Components Query Designer Report Designer Form Designer Workflow Designer Task Scheduler Designer

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.