Serial: (iii) gradual, through the XML configuration, the implementation of common to WinForm (. Net), WebForm (Asp.net+jquery+easyui) forms, reports-control files

Source: Internet
Author: User

Serial: (iii) Progressive, through XML configuration, to implement common to WinForm (. Net), WebForm (Asp.net+jquery+easyui) forms, reports--xml Control Files

Yangtze River tributary

in this chapter, C # is given to control file-related classes. NET source code, including control file Master Class Webmiscontroller, as well as control file components form and List filter fields field class, Callback function class Callbackfun.

Control files

The control file is described and parsed by the Webmis.servicemodel.webmiscontroller/webmiscontrollerserializer class.

The control file format is referenced as follows:

<?xmlversion= "1.0" encoding= "Utf-8"? ><webmiscontrollerserializerxmlns:xsi= "http://www.w3.org/2001/ Xmlschema-instance "xmlns:xsd=" Http://www.w3.org/2001/XMLSchema "> <Controller> <!--Note that the field in select is case- So the name node in field should be the same. Case Sensitive-<select>select id,dm,mc fromtest_entityaccessorm</select> <TableName> test_entityacce Ssorm </TableName> <!-Optional-<UpdateWhere> <value>where [email  protected]</value> </UpdateWhere> <DeleteWhere> <value& Gt Where [email protected] </value> </DeleteWhere> <CallbackFun> &L T Afterload></afterload> <AfterDeleted></AfterDeleted> </CallbackFun> & Lt fields> <Field> <ID>ID</ID> <Name>id</Name> <Title> logo id&l      T;/title>  <Align>right</Align> <Width>20</Width> </Field> <Field> <! The--id node represents the ID property of a control in Winform/webform or the Name property of a standard HTML element, in the same case-<ID>Code</ID> <!--the name node represents a Select Specify the name of the field in the same case-<Name>DM</Name> <Title> code </Title> </Field> <f ield> <ID>Name</ID> <Name>MC</Name> <Title> code </Title> &lt ;/field> </Fields> </Controller></WebMisControllerSerializer>


Field property descriptions, and many more, such as:

        

<Field>

<ID>Code</ID>

< name > mc</name >

<Title> code </Title>

<Type>String</Type>

<Save></Save>

<Visible></Visible>

<Sql></Sql>

<Value></Value>

<Excel></Excel>

<UserInputValue></UserInputValue>

<null>false</null>

<nulltitle> code cannot be empty , Please enter !</nulltitle>

</Field>

Control file namespaces

Namespace webmis.servicemodel{}


    • Control file Main class
    <summary>///Represents the mapping control relationship for UI form elements to query fields. </summary> [System.ComponentModel.TypeConverter (typeof (System.ComponentModel.ExpandableObjectConverter        )] [system.serializable] public class Webmiscontroller {//query SQL private string _select = "";          private string _tablename = "Csm_definemaintenance";                            Indicates that the query table and table are only private string _primarykey = "ID";        A primary key field, such as an ID, that is used to bind to a Web page by querying a table of data.                        private string _primarykeyvalue = "";                            Primary key field Lookup value private string _updatewhere = "";                            Update condition private String _deletewhere = "";                    Delete condition private Callbackfun _callbackfun = null;                             callback function Private field[] _fields = null;                             Query field mapping relationship private field[] _filter = null; Field Filter mapping relationship//other unspecified//private System.Collections.Hashtable _other = new System.Collections.Hashtable ();        #region Properties ...///<summary>///query statements.            </summary> public string Select {get {return _select;}        set {_select = value;}        }///<summary>//database table name.            </summary> public string TableName {get {return _tablename;}        set {_tablename = value;}        }///<summary>//primary Key name.            </summary> public string PrimaryKey {get {return _primarykey;}        set {_primarykey = value;}        }//<summary>//primary key value.            </summary> public string Primarykeyvalue {get {return _primarykeyvalue;}        set {_primarykeyvalue = value;}        }///<summary>//update conditions. </summary> public string Updatewhere {get {retUrn _updatewhere;        } set {_updatewhere = value;}        }///<summary>//delete conditions.            </summary> public string Deletewhere {get {return _deletewhere;}        set {_deletewhere = value;}        }///<summary>///Get or set the callback function.            </summary> public Callbackfun Callbackfun {get {return _callbackfun;}        set {_callbackfun = value;}        }///<summary>///To get or set a field.            </summary> public field[] fields {get {return _fields;}        set {_fields = value;}        }///<summary>///To get or set a field.            </summary> public field[] Filter {get {return _filter;}        set {_filter = value;}        }////<summary>///other not described. </summary> public System.Collections.Hashtable Other {get {return _other;}        set {_other = value;} }/* #endregion properties ...}

  •     <summary>///Represents the mapping control relationship for UI form elements to query fields. </summary> [System.ComponentModel.TypeConverter (typeof (System.ComponentModel.ExpandableObjectConverte            R)] [System.serializable] public class Field {#region property field ... private string _id = "";          Table cell ID//Database private string _name = "";          Map field or query field name private string _type = "";          Data type when data is saved private bool _save = true;         Whether to save//ui private string _title = "";      Automatic output when the label private string _formtype = "";        form type, such as input, Select, default input.         private string _align = "";         Column Alignment private String _width = "";        Column width       private bool _visible = true;          Whether the interface element is visible private bool _null = true;        Whether NULL is allowed when the interface element form is submitted.     private string _nulltitle = "";        When the interface element is empty, prompt when the form is submitted.           Initial value private String _sql = ""; Initial value via SQL statement private string _value ="";         Direct initial value private string _excel = "";        When Excel operates, the corresponding rows and columns, separated by commas in half-width, can be initialized with UI values.        private string _userinputvalue = "";//The value entered by the user, forcing precedence over the interface.        Other not described//private System.Collections.Hashtable _tag = new System.Collections.Hashtable ();        #endregion property Fields ... #region properties ...///<summary>////Set the table cell ID.            </summary> public string ID {get {return _id;}        set {_id = value;}        #region DB ...///<summary>//////Set the Map field or query field name.            </summary> public string Name {get {return _name;}        set {_name = value;}        }///<summary>////To get or set data type when data is saved.            </summary> public string Type {get {return _type;}        set {_type = value;}        }///<summary>///To get or set whether the data is saved. </summary> Public BOol Save {get {return _save;}        set {_save = value;}        } #endregion DB ... #region UI ...///<summary>/////Set the label for automatic output.            </summary> public string Title {get {return _title;}        set {_title = value;}        }///<summary>////To get or set the form type, such as input, Select, default input.            </summary> public string FormType {get {return _formtype;}        set {_formtype = value;}        }///<summary>///Gets or sets whether the interface element is visible.            </summary> public bool Visible {get {return _visible;}        set {_visible = value;}        }///<summary>///To get or set interface element column alignment.            </summary> public string Align {get {return _align;}        set {_align = value;} }///<summary>///To get or set the interface element width.       </summary> public string Width {get {return _width;}        set {_width = value;}        }///<summary>///Gets or sets whether the interface element allows no input.            </summary> public bool Null {get {return _null;}        set {_null = value;}        }///<summary>///To get or set the prompt when the interface element must be entered or selected.            </summary> public string Nulltitle {get {return _nulltitle;}        set {_nulltitle = value;}        #endregion UI ... #region initial ...///<summary>////The SQL statement that gets or sets the initial value.            </summary> public string Sql {get {return _sql;}        set {_sql = value;}        }///<summary>////To get or set the default value for the initial value.            </summary> public string Value {get {return _value;}        set {_value = Value;} }//<summary>/////When you get or set Excel operations, the corresponding rows and columns, separated by commas in half-width, can be the initial UI values.            </summary> public string Excel {get {return _excel;}        set {_excel = value;}        }///<summary>///To get or set user input values, forcing precedence over the interface.            </summary> public string Userinputvalue {get {return _userinputvalue;}        set {_userinputvalue = value;}        #endregion initial ...////<summary>//other not described.            </summary> public System.Collections.Hashtable Tag {get {return _tag;}        set {_tag = value;}         } */#endregion Properties ... #region constructor ...///<summary>//Create a new instance of the class. </summary> public field () {}//<param name= "ElementID" > Element ID, if no field name is specified, the default is the same as the element name.           </param> public Field (String elementid): this () {_id = ElementID; _name = ElementID;        _title = ElementID; }//<param name= "name" > Query field Name, if no field name is specified, the default is the same as the element name.             </param> public Field (String elementid, string name): this () {_id = ElementID;            _name = Name;        _title = name; } #endregion Constructor ...}

  • Control file callback function class
    <summary>///    represents a callback function. //    </summary>            [System.ComponentModel.TypeConverter (typeof (System.ComponentModel.ExpandableObjectConverter))]    [System.serializable]    public class Callbackfun    {        private string _afterload;        private string _afterdelete;        <summary>        ///Gets or sets the name of the callback function after the load succeeds. //        </summary> public        string afterload        {            get {return _afterload;}            set {_afterload = value;}        }        <summary>        ////Gets or sets the name of the callback function after the delete data succeeds. //        </summary> public        string AfterDelete        {            get {return _afterdelete;}            set {_afterdelete = value;}        }    }


Disclaimer: This article copyright for the Yangtze River tributary Zhou Fangyong All, if necessary to reprint, please retain the full content and source.

Yangtze River tributary [email protected]: winxin8001234567

Serial: (iii) gradual, through the XML configuration, the implementation of common to WinForm (. Net), WebForm (Asp.net+jquery+easyui) forms, reports-control files

Related Article

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.