コード例 #1
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean log)
        {
            //pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = TintucController.GetNewsDetail(id);

            catID = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
            DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);

            if (thuchien)
            {
                //if (lang == "1")
                //{
                //ltrTieuDe.Text = linkStr + " » " + "THƯ GIÃN";
                lblItemName.Text = dtDetail.Rows[0]["Content_Headline"].ToString();
                if (dtDetail.Rows.Count > 0)
                {
                    litContent.Text = dtDetail.Rows[0]["Content_Body"].ToString().Replace("href=\"Upload", "href=\"" + AppEnv.GetSetting("urldata") + "/Upload");
                }
                //}
                if (log)
                {
                    Transaction.Success(AppEnv.CheckSessionTelco(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 13);
                }
            }
            else
            {
                //Thông báo lỗi thanh toán
                //if (lang == "1")
                //{
                //ltrTieuDe.Text = linkStr + " » " + Resources.Resource.wThongBao;
                litContent.Text = Resources.Resource.wThongBaoLoiThanhToan;
                //}
                //else
                //{
                //    ltrTieuDe.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                //    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                //}
                //--Thông báo lỗi thanh toán
                if (log)
                {
                    Transaction.Failure(AppEnv.CheckSessionTelco(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 13, messageReturn);
                }
            }
            if (log)
            {
                //log charging
                ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN:" + Session["msisdn"].ToString());
                logger.Debug("Dich vu: Thu gian - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["Content_HeadlineKD"].ToString() + " - id: " + id);
                logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error:" + messageReturn);
                logger.Debug("Current Url:" + Request.RawUrl);
                //end log
            }
        }
コード例 #2
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean log)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = TintucController.GetNewsDetail(id);

            catID = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
            DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);

            if (thuchien)
            {
                if (lang == "1")
                {
                    ltrTieuDe.Text = linkStr + " » " + "TIN TỨC";
                    lblCat.Text    = "TIN ĐÃ ĐĂNG";
                    lblTen.Text    = dtDetail.Rows[0]["Content_Headline"].ToString();
                    if (dtDetail.Rows.Count > 0)
                    {
                        ltrNoiDung.Text = dtDetail.Rows[0]["Content_Body"].ToString().Replace("href=\"Upload", "href=\"" + ConfigurationSettings.AppSettings.Get("urldata") + "/Upload");
                    }
                }
                else
                {
                    ltrTieuDe.Text = linkStr_KD + " » " + "TIN TUC";
                    lblTen.Text    = dtDetail.Rows[0]["Content_HeadlineKD"].ToString();
                    if (dtDetail.Rows.Count > 0)
                    {
                        ltrNoiDung.Text = dtDetail.Rows[0]["Content_BodyKD"].ToString().Replace("href=\"Upload", "href=\"" + ConfigurationSettings.AppSettings.Get("urldata") + "/Upload");
                    }
                };
                if (log)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 13);
                }

                //start Older News
                DataTable dtCat = TintucController.GetTopNewsOlderByCategoryHasCache(catID, id, 4);
                rptlstCategory.DataSource     = dtCat;
                rptlstCategory.ItemDataBound += new RepeaterItemEventHandler(rptlstCategory_ItemDataBound);
                rptlstCategory.DataBind();
            }
            else
            {
                //Thông báo lỗi thanh toán
                if (lang == "1")
                {
                    ltrTieuDe.Text  = linkStr + " » " + Resources.Resource.wThongBao;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                }
                else
                {
                    ltrTieuDe.Text  = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }
                //--Thông báo lỗi thanh toán
                if (log)
                {
                    Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 13, messageReturn);
                }
            }
            if (log)
            {
                //log charging
                ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN:" + Session["msisdn"].ToString());
                logger.Debug("Dich vu: Thu gian - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["Content_HeadlineKD"].ToString() + " - id: " + id);
                logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error:" + messageReturn);
                logger.Debug("Current Url:" + Request.RawUrl);
                //end log
            }
        }