Esempio n. 1
0
        /// <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;
        }
Esempio n. 2
0
 /// <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;
 }