コード例 #1
0
        public string loadMaxPointArticle()
        {
            string data = CommonConstants.BLANK;
            string temp = CommonConstants.BLANK;
            string sum = CommonConstants.BLANK;
            ltktDAO.Contest contestDAO = new ltktDAO.Contest();
            ltktDAO.English englishDAO = new ltktDAO.English();
            ltktDAO.Informatics inforDAO = new ltktDAO.Informatics();
            BaseServices bs = new BaseServices();

            tblContestForUniversity uni = contestDAO.getMaxPoint();
            tblEnglish el = englishDAO.getMaxPoint();
            tblInformatic it = inforDAO.getMaxPoint();
            if (uni != null)
            {
                temp = BaseServices.createMsgByTemplate(CommonConstants.TEMP_ARTICLE_DETAILS_LINK,
                                                        CommonConstants.SEC_UNIVERSITY_CODE,
                                                        uni.ID.ToString(),
                                                        BaseServices.createMsgByTemplate(CommonConstants.TEMP_STRONG_TAG,
                                                                                        uni.Title.Trim()));

                sum = uni.Contents.Trim();
                if (!BaseServices.isNullOrBlank(sum))
                {
                    temp += CommonConstants.SPACE + bs.subString(sum);
                }
                data += BaseServices.createMsgByTemplate(CommonConstants.TEMP_LI_TAG, temp);
            }
            if (el != null)
            {
                temp = BaseServices.createMsgByTemplate(CommonConstants.TEMP_ARTICLE_DETAILS_LINK,
                                                        CommonConstants.SEC_UNIVERSITY_CODE,
                                                        el.ID.ToString(),
                                                        BaseServices.createMsgByTemplate(CommonConstants.TEMP_STRONG_TAG,
                                                                                       el.Title.Trim()));
                sum = el.Contents.Trim();
                if (!BaseServices.isNullOrBlank(sum))
                {
                    temp += CommonConstants.SPACE + bs.subString(sum);
                }
                data += BaseServices.createMsgByTemplate(CommonConstants.TEMP_LI_TAG, temp);
            }
            if (it != null)
            {
                temp = BaseServices.createMsgByTemplate(CommonConstants.TEMP_ARTICLE_DETAILS_LINK,
                                                        CommonConstants.SEC_UNIVERSITY_CODE,
                                                        it.ID.ToString(),
                                                        BaseServices.createMsgByTemplate(CommonConstants.TEMP_STRONG_TAG,
                                                                                        it.Title.Trim()));
                sum = it.Contents.Trim();
                if (!BaseServices.isNullOrBlank(sum))
                {
                    temp += CommonConstants.SPACE + bs.subString(sum);
                }
                data += BaseServices.createMsgByTemplate(CommonConstants.TEMP_LI_TAG, temp);
            }
            return data;
        }
コード例 #2
0
ファイル: Home.aspx.cs プロジェクト: vuchannguyen/ducnghia
        /// <summary>
        /// build exam lesson for university
        /// </summary>
        /// <param name="item"></param>
        /// <returns></returns>
        private string buildExamLessonForUniversity(tblContestForUniversity item)
        {
            string res = CommonConstants.BLANK;
            try
            {
                BaseServices bs = new BaseServices();
                res += "                <div class='block_details'>\n"
                        + "                <div class='block_details_img'>\n"
                        + "                    <span title='" + item.Title.Trim() + "'>"
                        + BaseServices.createMsgByTemplate(CommonConstants.TEMP_IMG_THUMBNAIL, bs.getThumbnail(item.Thumbnail, item.Location), item.Title.Trim())
                        + "</span>\n"
                        + "                </div>\n"
                        + "                <div class='block_details_title'>\n"
                        + "                    <span title='" + item.Title.Trim() + "'>"
                        + BaseServices.createMsgByTemplate(CommonConstants.TEMP_ARTICLE_DETAILS_LINK, CommonConstants.SEC_UNIVERSITY_CODE, item.ID.ToString(), bs.subString(item.Title))
                        + "</span>\n"
                        + "                </div>\n"
                        + "                <div class='block_details_text'>\n"
                        + "                    " + BaseServices.getNameSubjectByCode(item.Subject.Trim()) + "<br />\n"
                        + contestDAO.getBranch(item.ID) + "<br/>\n"
                        + item.Year
                        + "                </div>\n"
                        + "            </div>\n";
            }
            catch (Exception ex)
            {
                log.writeLog(Server.MapPath(CommonConstants.PATH_LOG_FILE), ex.Message
                                                                            + CommonConstants.NEWLINE
                                                                            + ex.Source
                                                                            + CommonConstants.NEWLINE
                                                                            + ex.StackTrace
                                                                            + CommonConstants.NEWLINE
                                                                            + ex.HelpLink);
                Session[CommonConstants.SES_ERROR] = CommonConstants.MSG_E_COMMON_ERROR_TEXT;
                Response.Redirect(CommonConstants.PAGE_ERROR);
            }

            return res;
        }
コード例 #3
0
ファイル: Home.aspx.cs プロジェクト: vuchannguyen/ducnghia
 /// <summary>
 /// build article for informatics
 /// </summary>
 /// <param name="item"></param>
 /// <returns></returns>
 private string buildArticleForInformatics(tblInformatic item)
 {
     string data = CommonConstants.BLANK;
     try
     {
         BaseServices bs = new BaseServices();
         data += "              <div class='block_details'>\n"
                 + "                <div class='block_details_img'>\n"
                 + "                    <span title='" + item.Title + "'>"
                 + BaseServices.createMsgByTemplate(CommonConstants.TEMP_IMG_THUMBNAIL, bs.getThumbnail(item.Thumbnail, item.Location), item.Title.Trim())
                 + "</span>\n"
                 + "                </div>\n"
                 + "                <div class='block_details_title'>\n"
                 + "                    <span title='" + item.Title + "'>"
                 + BaseServices.createMsgByTemplate(CommonConstants.TEMP_ARTICLE_DETAILS_LINK, CommonConstants.SEC_INFORMATICS_CODE, item.ID.ToString(), bs.subString(item.Title))
                 + "</span>\n"
                 + "                </div>\n"
                 + "            </div>\n";
     }
     catch (Exception ex)
     {
         log.writeLog(Server.MapPath(CommonConstants.PATH_LOG_FILE), ex.Message
                                                                     + CommonConstants.NEWLINE
                                                                     + ex.Source
                                                                     + CommonConstants.NEWLINE
                                                                     + ex.StackTrace
                                                                     + CommonConstants.NEWLINE
                                                                     + ex.HelpLink);
         Session[CommonConstants.SES_ERROR] = CommonConstants.MSG_E_COMMON_ERROR_TEXT;
         Response.Redirect(CommonConstants.PAGE_ERROR);
     }
     return data;
 }