C#.net Large Enterprise Information System integration rapid development Platform 4.2 version-multi-language implementation based on database resources

Source: Internet
Author: User
Tags dotnet

In the previous development platform, the multi-language function was implemented with the XML language package, and now the new platform has been adjusted to implement the multi-language package resources in the database table.

We have set up a multi-lingual configuration global variable and can switch to multiple languages by configuring this parameter.

We add a multi-lingual selection to the option management and then add the language resources

The following table is a multi-language database design table structure

The following figure is a set of resources in a multi-language database

This is a multi-language Settings Management Interface reference

The following is a multi-lingual management form location

Multi-language Example program reference:

        /// <summary>        ///Get multiple languages/// </summary>         Public voidGetLanguage () { This. Grblanguage.text = This. GetLanguage ( This. Grblanguage);  This. Lbllanguagecode.text = This. GetLanguage ( This. Lbllanguagecode) +":";  This. Lblmessagecode.text = This. GetLanguage ( This. Lblmessagecode) +":";  This. Lblcaption.text = This. GetLanguage ( This. lblcaption) +":";  This. Btnadd.text = This. GetLanguage ( This. Btnadd);  This. Btnsave.text = This. GetLanguage ( This. Btnsave);  This. Btncancel.text = This. GetLanguage ( This. Btncancel); }         Public stringGetLanguage (Control control) {stringresult =string.            Empty; stringKey = This. Name +"."+control.            Name; stringCaption =control.            Text; Result= ClientCache.Instance.GetLanguage ( This.            UserInfo, Key, Basesysteminfo.currentlanguage, caption); returnresult; }

Multi-lingual Interface program reference:

//-----------------------------------------------------------------//All rights Reserved, Copyright (C), Hairihan TECH, Ltd.//-----------------------------------------------------------------usingSystem.Data;usingSystem.ServiceModel;usingSystem.Collections.Generic;namespacedotnet.iservice{usingdotnet.utilities; usingDotnet.model; /// <summary>    ///Ilanguageservice///Multi-lingual interface///     ///Change of record///     ///2015.02.24 Version: 1.0 Jirigala Create a primary key. ///            /// <author>    ///        <name>Jirigala</name>    ///        <date>2015.02.24</date>    /// </author>     /// </summary>[ServiceContract] Public InterfaceIlanguageservice {/// <summary>        ///Get entity/// </summary>        /// <param name= "UserInfo" >User</param>        /// <param name= "id" >PRIMARY Key</param>        /// <returns>Entity</returns>[OperationContract] baselanguageentity GetObject (baseuserinfo userInfo,stringID); /// <summary>        ///Add/// </summary>        /// <param name= "UserInfo" >User</param>        /// <param name= "entity" >Entity</param>        /// <param name= "StatusCode" >Return Status Code</param>        /// <param name= "StatusMessage" >Return status information</param>        /// <returns>PRIMARY Key</returns>[OperationContract]stringADD (Baseuserinfo userInfo, baselanguageentity entity, out stringStatusCode, out stringStatusMessage); /// <summary>        ///Edit/// </summary>        /// <param name= "UserInfo" >User</param>        /// <param name= "entity" >Entity</param>        /// <param name= "StatusCode" >Return Status Code</param>        /// <param name= "StatusMessage" >Return status information</param>        /// <returns>affect the number of rows</returns>[OperationContract]intUpdate (Baseuserinfo userInfo, baselanguageentity entity, out stringStatusCode, out stringStatusMessage); /// <summary>        ///set up multiple languages/// </summary>        /// <param name= "UserInfo" >User</param>        /// <param name= "Messagecode" >language Number</param>        /// <param name= "Enus" >English</param>        /// <param name= "ZHCN" >Simplified Chinese</param>        /// <param name= "ZHTW" >Traditional Chinese</param>        /// <returns>affect the number of rows</returns>[OperationContract]intSetLanguage (Baseuserinfo UserInfo,stringMessagecode,stringEnus,stringZHCN,stringzhtw); /// <summary>        ///get multiple languages by number/// </summary>        /// <param name= "UserInfo" >User</param>        /// <param name= "Messagecode" >language Number</param>        /// <returns>List</returns>List<baselanguageentity> Getlanguagebymessagecode (Baseuserinfo userInfo,stringMessagecode); /// <summary>        ///Bulk hit Delete flag/// </summary>        /// <param name= "UserInfo" >User</param>        /// <param name= "IDs" >primary Key Array</param>        /// <returns>affect the number of rows</returns>[OperationContract]intSetdeleted (Baseuserinfo UserInfo,string[] IDs); /// <summary>        ///Bulk Save/// </summary>        /// <param name= "UserInfo" >User</param>        /// <param name= "List" >List</param>        /// <returns>affect the number of rows</returns>[OperationContract]intBatchSave (Baseuserinfo userInfo, list<baselanguageentity>list); }}

C#.net Large Enterprise Information System integration rapid development platform version 4.2-Multi-language implementation based on database resources

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.