Ejemplo n.º 1
0
        internal int SaveScreenDetailDisplayText(string ScreenCD, string ControlCD, string LangCD, string DisplayTitle)
        {
            ScreenDetailLangBIZ biz = new ScreenDetailLangBIZ();
            ScreenDetailLangDTO dto = new ScreenDetailLangDTO();

            dto.CONTROL_CD.Value      = ControlCD;
            dto.LANG_CD.Value         = LangCD;
            dto.SCREEN_CD.Value       = ScreenCD;
            dto.CONTROL_CAPTION.Value = DisplayTitle;
            dto.UPD_BY.Value          = CommonLib.Common.CurrentUserInfomation.UserCD.StrongValue;
            dto.UPD_DATE.Value        = DateTime.Now;
            dto.UPD_MACHINE.Value     = Environment.MachineName;
            return(biz.UpdateScreenDisplayText(dto));
        }
Ejemplo n.º 2
0
        public DataTable LoadScreenDetailWithOriginalCaptionByLangCD(string screenCD, string LangCD)
        {
            ScreenDetailLangBIZ biz = new ScreenDetailLangBIZ();

            return(biz.LoadScreenDetailWithOriginalCaptionByLangCD(screenCD, LangCD));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initialize all control text following by stored data on database, depend on current user's language.
        /// </summary>
        protected virtual void InitializeControlText()
        {
            if (this.ScreenCode == string.Empty)
            {
                return;
            }

            Map <string, ScreenDetail> mapControlList      = this.GetControlList();
            ScreenDetailLangBIZ        bizScreenDetailLang = new ScreenDetailLangBIZ();

            string langCD = CommonLib.Common.SystemLanguage.StrongValue;

            if (CommonLib.Common.CurrentUserInfomation != null)
            {
                langCD = CommonLib.Common.CurrentUserInfomation.LanguageCD.StrongValue;
            }

            // Load screen detail depend on language.
            List <ScreenDetailLangDTO> listScreenDetailLang = bizScreenDetailLang.LoadScreenDetailByLangCD(this.ScreenCode, langCD);

            for (int i = 0; i < listScreenDetailLang.Count; i++)
            {
                ScreenDetailLangDTO dto = listScreenDetailLang[i];
                MapKeyValue <string, ScreenDetail> mapKeyValue = mapControlList[dto.CONTROL_CD.StrongValue];
                if (mapKeyValue == null)
                {
                    continue;
                }

                ScreenDetail screenDetail = mapKeyValue.Value;
                Control      ctrl         = null;
                switch (screenDetail.Type)
                {
                case ScreenDetail.TYPE_FORM:
                    ctrl = screenDetail.ObjOwner as Control;
                    if (ctrl != null)
                    {
                        ctrl.Text = ScreenAttribute.GetScreenAttribute(screenDetail.ObjOwner.GetType()).ScreenCD + ": " + dto.CONTROL_CAPTION.NVL(string.Empty);
                    }
                    break;

                case ScreenDetail.TYPE_BUTTON:
                case ScreenDetail.TYPE_CHECKBOX:
                case ScreenDetail.TYPE_GROUPBOX:
                case ScreenDetail.TYPE_LABEL:
                case ScreenDetail.TYPE_RADIOBUTTON:
                case ScreenDetail.TYPE_TABPAGE:
                    ctrl = screenDetail.ObjOwner as Control;
                    if (ctrl != null)
                    {
                        ctrl.Text = dto.CONTROL_CAPTION.NVL(string.Empty);
                    }

                    break;

                case ScreenDetail.TYPE_SPREAD_COLUMN:
                    Column column = screenDetail.ObjOwner as Column;
                    if (column != null)
                    {
                        column.Label = dto.CONTROL_CAPTION.NVL(string.Empty);
                    }
                    break;
                }
            }
        }