コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                lang  = Request.QueryString["lang"];
                width = ConvertUtility.ToInt32(Request.QueryString["w"]);
                price = ConfigurationSettings.AppSettings.Get("relaxsexprice");
                id    = ConvertUtility.ToInt32(Request.QueryString["id"]);
                telCo = Session["telco"].ToString();

                DataTable dtDetail = TintucController.GetNewsDetailHasCache(id);
                catID = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                parentCatID     = ConvertUtility.ToInt32(catInfo.Rows[0]["Zone_ParentID"]);
                chitietGiaodich = "Thu gian: " + catInfo.Rows[0]["Zone_Name"].ToString() + " -- id: " + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
                linkStr         = "<a href=\"../" + UrlProcess.GetTinTucNewHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >TIN TỨC<a>";
                linkStr_KD      = "<a href=\"../" + UrlProcess.GetTinTucNewHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >TIN TUC<a>";

                if (!IsPostBack)
                {
                    if (width == 0)
                    {
                        width = (int)Constant.DefaultScreen.Standard;
                    }
                    ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />";

                    //
                    if (telCo == "Undefined")
                    {
                        pnlSMS.Visible = true;
                        if (lang == "1")
                        {
                            ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                            ltrSMS.Text      = "Bạn vui lòng soạn tin theo cú pháp <b>TTHN</b> gửi <b>8579</b>";
                        }
                        else
                        {
                            ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                            ltrSMS.Text      = "Ban vui long soan tin theo cu phap <b>TTHN</b> gửi <b>8579</b>";
                        }
                    }
                    else
                    {
                        if (IsCharging(Session["msisdn"].ToString()) == false)
                        {
                            WapXzone_VNM.Library.VNMCharging.VNMChargingGW charging = new WapXzone_VNM.Library.VNMCharging.VNMChargingGW();

                            messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), ProductId, Keyword, price, "D", "RELAX", Request.QueryString["id"]);

                            if (messageReturn == "1")
                            {// Thanh toán thành công >> trả nội dung
                                HienThiNoiDung(true, true);
                            }
                            else
                            {
                                TintucController.Cancel(Session["msisdn"].ToString());
                                // Thanh toán không thành công >> thông báo lỗi
                                HienThiNoiDung(false, true);
                            }
                        }
                        else
                        {
                            HienThiNoiDung(true, true);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                ILog logger = log4net.LogManager.GetLogger("File");
                logger.Debug("--------------------------------------------------");
                logger.Debug("ex:" + ex.Message);
            }
        }