示例#1
0
        public DatabaseScreenList LoadAllScreen()
        {
            //List<ScreenImportUIDM> screenList = new List<ScreenImportUIDM>();
            ScreenBIZ          biz        = new ScreenBIZ();
            DatabaseScreenList screenList = biz.LoadScreens();

            return(screenList);
        }
示例#2
0
        /// <summary>
        /// Select all screen on database which is the main screen for set authorize
        /// </summary>
        /// <param name="database"></param>
        /// <param name="userLangCD"></param>
        /// <param name="defLangCD"></param>
        /// <returns></returns>
        public DatabaseScreenList SelectScreenWithAuthorize(Database database, NZString userLangCD, NZString defLangCD)
        {
            Database db = this.UseDatabase(database);

            StringBuilder sb = new StringBuilder();

            sb.AppendLine(" SELECT ");
            sb.AppendLine("   SCREEN_CD ");
            sb.AppendLine("   ,SCREEN_NAME ");
            sb.AppendLine("   ,IMAGE_CD ");
            sb.AppendLine("   ,SCREEN_TYPE ");
            sb.AppendLine("   ,SCREEN_ACTION ");
            sb.AppendLine("   ,EXT_PROGRAM ");
            sb.AppendLine("   ,CRT_BY ");
            sb.AppendLine("   ,CRT_DATE ");
            sb.AppendLine("   ,CRT_MACHINE ");
            sb.AppendLine("   ,UPD_BY ");
            sb.AppendLine("   ,UPD_DATE ");
            sb.AppendLine("   ,UPD_MACHINE ");
            sb.AppendLine(String.Format("   ,{0}FNZ_GET_SCREEN_DESC(T.SCREEN_CD,:LANG_CD, :DEF_LANG_CD) AS SCREEN_DESC",
                                        (db.Credential.Provider == DatabaseProvider.SQLSERVER) ? "dbo." : string.Empty));
            sb.AppendLine("   ,ORIGINAL_TITLE ");
            sb.AppendLine(" FROM TZ_SCREEN_MS T");
            sb.AppendLine(" WHERE T.IS_AUTHORIZE = '1' ");
            sb.AppendLine(" ORDER BY T.SCREEN_CD");

            DataRequest request = new DataRequest(sb.ToString());

            request.Parameters.Add("LANG_CD", DataType.NVarChar, userLangCD.Value);
            request.Parameters.Add("DEF_LANG_CD", DataType.NVarChar, defLangCD.Value);

            DataTable table = db.ExecuteQuery(request);

            DatabaseScreenList listDatabaseScreen = new DatabaseScreenList();

            for (int i = 0; i < table.Rows.Count; i++)
            {
                DatabaseScreen screen = new DatabaseScreen();
                screen.ScreenCD.Value   = table.Rows[i][ScreenDTO.eColumns.SCREEN_CD.ToString()];
                screen.ScreenName.Value = table.Rows[i][ScreenDTO.eColumns.SCREEN_NAME.ToString()];
                screen.ImageCD.Value    = table.Rows[i][ScreenDTO.eColumns.IMAGE_CD.ToString()];
                object obj = table.Rows[i][ScreenDTO.eColumns.SCREEN_TYPE.ToString()];
                screen.ScreenType = (eScreenType)Enum.Parse(typeof(eScreenType), obj.ToString());
                obj = table.Rows[i][ScreenDTO.eColumns.SCREEN_ACTION.ToString()];
                screen.ShowAction              = (eShowAction)Enum.Parse(typeof(eShowAction), obj.ToString());
                screen.ExternalProgram.Value   = table.Rows[i][ScreenDTO.eColumns.EXT_PROGRAM.ToString()];
                screen.ScreenDescription.Value = table.Rows[i][ScreenLangDTO.eColumns.SCREEN_DESC.ToString()];


                listDatabaseScreen.Add(screen);
            }

            return(listDatabaseScreen);
        }
示例#3
0
        internal object LoadAllDatabyLangCD(string LangCD)
        {
            ScreenBIZ biz    = new ScreenBIZ();
            NZString  langCD = new NZString();

            langCD.Value = LangCD;
            DatabaseScreenList screenList = biz.LoadScreensWithAuthorizeAndLangCD(langCD);

            DataTable dt = new DataTable();

            dt.Columns.Add("SCREEN_CD");
            dt.Columns.Add("SCREEN_NAME");

            for (int i = 0; i < screenList.Count; i++)
            {
                dt.Rows.Add(screenList[i].ScreenCD.StrongValue,
                            screenList[i].ScreenName.StrongValue);
                //   screenList[i].ScreenDescription.StrongValue,
                //   screenList[i].ImageCD.StrongValue);
            }
            return(dt);
        }