コード例 #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = ConfigurationSettings.AppSettings.Get("urldata");
            width  = Request.QueryString["w"];

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            if (!IsPostBack)
            {
                lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);
                //Detail
                DataTable dtDetail = TintucController.GetNewsDetailHasCache(id);
                catID = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                //end detail
                if (lang == 1)
                {
                    lnkCatName.Text     = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
                    lblCat.Text         = "TIN ĐÃ ĐĂNG";
                    lblHeadline.Text    = dtDetail.Rows[0]["Content_Headline"].ToString();
                    ltrBody.Text        = ReplaceImageLink(dtDetail.Rows[0]["Content_Body"].ToString());
                    lnkHomeChannel.Text = "TIN TỨC";
                }
                else
                {
                    lblHeadline.Text = dtDetail.Rows[0]["Content_HeadlineKD"].ToString();
                    ltrBody.Text     = ReplaceImageLink(dtDetail.Rows[0]["Content_BodyKD"].ToString());
                    lnkCatName.Text  = catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
                }
                if (!string.IsNullOrEmpty(dtDetail.Rows[0]["Content_Avatar"].ToString()))
                {
                    WapXzone_VNM.CreateAvatar.MOReceiver ws = new WapXzone_VNM.CreateAvatar.MOReceiver();
                    ws.GenerateAvatarThumnail(dtDetail.Rows[0]["Content_Avatar"].ToString(), 60, 60);
                    imgAvatar.ImageUrl = preurl + MultimediaUtility.GetAvatarThumnail(dtDetail.Rows[0]["Content_Avatar"].ToString(), 60, 60).Replace("~", "");
                }
                else
                {
                    imgAvatar.Visible = false;
                }

                lblCreatedOn.Text          = ConvertUtility.ToDateTime(dtDetail.Rows[0]["Content_CreateDate"]).ToString("dd/MM/yyyy");
                lnkCatName.NavigateUrl     = UrlProcess.GetNewsCategoryUrl(lang.ToString(), width, catID.ToString());
                lnkHomeChannel.NavigateUrl = UrlProcess.GetNewsHomeUrl(lang.ToString(), width);
            }
            //start Older News
            DataTable dtCat = TintucController.GetTopNewsOlderByCategoryHasCache(catID, id, 4);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += new RepeaterItemEventHandler(rptlstCategory_ItemDataBound);
            rptlstCategory.DataBind();
            //start Older News
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                id = ConvertUtility.ToInt32(Request.QueryString["id"]);

                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"]);

                HienThiNoiDung(true, false);
            }
        }
コード例 #3
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean log)
        {
            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = TintucController.GetNewsDetailHasCache(id);

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

            if (thuchien)
            {
                pnlContent.Visible = true;
                if (dtDetail.Rows.Count > 0)
                {
                    litContent.Text = ReplaceImageLink(dtDetail.Rows[0]["Content_Body"].ToString());
                }
                if (log)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 23);
                }
            }
            else
            {
                pnlContentError.Visible = true;
                //Thông báo lỗi thanh toán
                litContentError.Text = Resources.Resource.wThongBaoLoiThanhToan;

                //--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, 23, messageReturn);
                }
            }


            if (log)
            {
                //log charging
                ILog logger = LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN:" + Session["msisdn"]);
                logger.Debug("Dich vu: Thu gian - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["Content_HeadlineKD"] + " - id: " + id);
                logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error:" + messageReturn);
                logger.Debug("Current Url:" + Request.RawUrl);
                //end log
            }
        }
コード例 #4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = AppEnv.GetSetting("urldata");
            width  = Request.QueryString["w"];

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            if (!IsPostBack)
            {
                lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);

                //Detail
                DataTable dtDetail = TintucController.GetNewsDetailHasCache(id);
                catID = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                //end detail

                if (lang == 1)
                {
                    lnkCatName.Text = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
                    //lblCat.Text = "TIN ĐÃ ĐĂNG";
                    lblHeadline.Text    = dtDetail.Rows[0]["Content_Headline"].ToString();
                    ltrBody.Text        = ReplaceImageLink(dtDetail.Rows[0]["Content_Body"].ToString());
                    lnkHomeChannel.Text = "TIN TỨC";
                }
                else
                {
                    lblHeadline.Text = dtDetail.Rows[0]["Content_HeadlineKD"].ToString();
                    ltrBody.Text     = ReplaceImageLink(dtDetail.Rows[0]["Content_BodyKD"].ToString());
                    lnkCatName.Text  = catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
                }

                lblCreatedOn.Text          = ConvertUtility.ToDateTime(dtDetail.Rows[0]["Content_CreateDate"]).ToString("dd/MM/yyyy");
                lnkCatName.NavigateUrl     = UrlProcess.GetNewsCategoryUrlNew(lang.ToString(), width, catID.ToString());
                lnkHomeChannel.NavigateUrl = UrlProcess.GetNewsHomeUrlNew(lang.ToString(), width);
            }

            //start Older News
            DataTable dtCat = TintucController.GetTopNewsOlderByCategoryHasCache(catID, id, 4);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += rptlstCategory_ItemDataBound;
            rptlstCategory.DataBind();
            //start Older News
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            price = AppEnv.GetSetting("relaxprice");
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);

            telCo = AppEnv.CheckFreeContentTelco();

            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 = string.Format("Thu gian: {0} -- id: {1} -- newtransactionid: {2} -- old tranid: {3}", catInfo.Rows[0]["Zone_Name"].ToString(), id, ConvertUtility.ToString(Session["transactionid"]), ConvertUtility.ToString(Session["transactionid_old"]));
            chitietGiaodich = string.Format("Thu gian: {0} -- id: {1}", catInfo.Rows[0]["Zone_Name"], id);

            linkStr = "<a href=\"" + UrlProcess.ThuGianHome() + "\" >THƯ GIÃN</a>";

            switch (parentCatID.ToString())
            {
            case "258":           //Cẩm nang tư vấn
                if (catID == 264) //Sex và cuộc sống
                {
                    price     = ConfigurationSettings.AppSettings.Get("relaxsexprice");
                    ProductId = "RELAXADVISESEX";
                    Keyword   = "ADVISE_SEX";
                }
                else
                {
                    price     = ConfigurationSettings.AppSettings.Get("relaxtuvanprice");
                    ProductId = "RELAXADVISEBOOK";
                    Keyword   = "ADVISE_BOOK";
                }
                break;

            case "121":    //Gửi lời yêu thương
                price     = ConfigurationSettings.AppSettings.Get("relaxtuvanprice");
                ProductId = "RELAXLOVER";
                Keyword   = "LOVER";
                break;

            case "268":    //Địa điểm ăn chơi
                price     = ConfigurationSettings.AppSettings.Get("relaxanchoiprice");
                ProductId = "RELAXPLACE";
                Keyword   = "PLACE";
                break;

            case "255":    //Đọc truyện
                price = ConfigurationSettings.AppSettings.Get("relaxprice");
                //dungnt sua de charge dc
                ProductId = "LOTOLASTRESULT"; //"RELAXSTORYREAD";
                Keyword   = "LAST_RESULT";    //"READ";
                break;

            case "400":    //GOC CUOC SONG
                price = "3000";
                //dungnt sua de charge dc
                ProductId = "LOTOLASTRESULT"; //"RELAXSTORYREAD";
                Keyword   = "LAST_RESULT";    //"READ";
                break;

            case "401":    //KHAM PHA
                price = "1000";
                //dungnt sua de charge dc
                ProductId = "LOTOLASTRESULT"; //"RELAXSTORYREAD";
                Keyword   = "LAST_RESULT";    //"READ";
                break;

            default:
                price     = ConfigurationSettings.AppSettings.Get("relaxprice");
                ProductId = "HOROSCOPE";
                Keyword   = "HOROSCOPE";
                break;
            }

            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\" />";

                #region Free Content

                if (AppEnv.GetSetting("FreeContent") == "1")
                {
                    HienThiNoiDung(true, false);
                    return;
                }

                #endregion

                #region OLD

                if (telCo == "Undefined")
                {
                    pnlSMS.Visible = true;
                    //if (lang == "1")
                    //{
                    ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                    ltrSMS.Text      = "Bạn vui lòng" + Resources.Resource.wChon3G.Remove(0, 10);
                    //}
                    //else
                    //{
                    //    ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                    //    ltrSMS.Text = "Ban vui long" + Resources.Resource.wChon3G_KD.Remove(0, 10);
                    //}
                }
                else
                {
                    if (parentCatID.ToString() == "255" && WapController.W4A_Subscriber_IsActive(Session["msisdn"].ToString(), 1))
                    {
                        HienThiNoiDung(true, false);
                    }
                    else
                    {
                        if (Session["ChargedOk"] != null)
                        {
                            if (!string.IsNullOrEmpty(Session["ChargedOk"].ToString()))
                            {
                                HienThiNoiDung(true, false);
                                Session["ChargedOk"] = string.Empty;
                            }
                        }
                        else
                        {
                            pnlThongBao.Visible = false;
                            switch (Session["telco"].ToString())
                            {
                            case "Vietnamobile":

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

                                if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))    //Not Enough Money
                                {
                                    messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), ProductId, Keyword, price, "D", "RELAX", Request.QueryString["id"], out logPrice);
                                    price         = logPrice;
                                }

                                if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                                {
                                    messageReturn = AppEnv.VnmChargingSystemOverload(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
                                {    // Thanh toán không thành công >> thông báo lỗi
                                    HienThiNoiDung(false, true);
                                }
                                break;
                            }
                        }
                    }
                }

                #endregion
            }
        }
コード例 #6
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            price = ConfigurationSettings.AppSettings.Get("relaxprice");
            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.GetRelaxHomeUrlNew(lang, width.ToString()).Replace("~/", "") + "\" >THƯ GIÃN<a>";
            linkStr_KD      = "<a href=\"../" + UrlProcess.GetRelaxHomeUrlNew(lang, width.ToString()).Replace("~/", "") + "\" >THU GIAN<a>";

            switch (parentCatID.ToString())
            {
            case "258":           //Cẩm nang tư vấn
                if (catID == 264) //Sex và cuộc sống
                {
                    price     = ConfigurationSettings.AppSettings.Get("relaxsexprice");
                    ProductId = "RELAXADVISESEX";
                    Keyword   = "ADVISE_SEX";
                }
                else
                {
                    price     = ConfigurationSettings.AppSettings.Get("relaxtuvanprice");
                    ProductId = "RELAXADVISEBOOK";
                    Keyword   = "ADVISE_BOOK";
                }
                break;

            case "121":    //Gửi lời yêu thương
                price     = ConfigurationSettings.AppSettings.Get("relaxtuvanprice");
                ProductId = "RELAXLOVER";
                Keyword   = "LOVER";
                break;

            case "268":    //Địa điểm ăn chơi
                price     = ConfigurationSettings.AppSettings.Get("relaxanchoiprice");
                ProductId = "RELAXPLACE";
                Keyword   = "PLACE";
                break;

            case "255":    //Đọc truyện
                price     = ConfigurationSettings.AppSettings.Get("relaxprice");
                ProductId = "LOTOLASTRESULT";
                Keyword   = "LAST_RESULT";
                break;

            default:
                price     = ConfigurationSettings.AppSettings.Get("relaxprice");
                ProductId = "HOROSCOPE";
                Keyword   = "HOROSCOPE";
                break;
            }

            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" + Resources.Resource.wChon3G.Remove(0, 10);
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = "Ban vui long" + Resources.Resource.wChon3G_KD.Remove(0, 10);
                    }
                }
                else
                {
                    if (parentCatID.ToString() == "255" && WapController.W4A_Subscriber_IsActive(Session["msisdn"].ToString(), 1))
                    {
                        HienThiNoiDung(true, false);
                    }
                    else
                    {
                        pnlThongBao.Visible = false;
                        switch (Session["telco"].ToString())
                        {
                        case "Vietnamobile":
                            WapXzone_VNM.Library.VNMCharging.VNMChargingGW charging = new WapXzone_VNM.Library.VNMCharging.VNMChargingGW();

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

                            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
                            {    // Thanh toán không thành công >> thông báo lỗi
                                HienThiNoiDung(false, true);
                            }
                            break;
                        }
                    }
                }
            }
        }
コード例 #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            price = AppEnv.GetSetting("relaxprice");
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);

            telCo = AppEnv.CheckFreeContentTelco();

            DataTable dtDetail = TintucController.GetNewsDetailHasCache(id);

            if (dtDetail != null && dtDetail.Rows.Count > 0)
            {
                litName.Text = dtDetail.Rows[0]["Content_Headline"].ToString();
                catID        = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);

                catName = catInfo.Rows[0]["Zone_Name"].ToString();

                parentCatID = ConvertUtility.ToInt32(catInfo.Rows[0]["Zone_ParentID"]);
                //chitietGiaodich = "Thu gian: " + catInfo.Rows[0]["Zone_Name"] + " -- id: " + id + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
                chitietGiaodich = "Thu gian: " + catInfo.Rows[0]["Zone_Name"] + " -- id: " + id;

                int       totalrecord = 0;
                DataTable dtCat       = new DataTable();
                dtCat = TintucController.GetAllNewsByCategoryHasCache(catID, 8, 1, out totalrecord);
                if (dtCat != null && dtCat.Rows.Count > 0)
                {
                    IList <DataRow> contentTop    = dtCat.Select().Skip(0).Take(3).ToList();
                    IList <DataRow> contentBottom = dtCat.Select().Skip(3).Take(7).ToList();

                    rptTop.DataSource = contentTop.CopyToDataTable();
                    rptTop.DataBind();

                    rptBottom.DataSource = contentBottom.CopyToDataTable();
                    rptBottom.DataBind();
                }
            }

            switch (parentCatID.ToString())
            {
            case "258":           //Cẩm nang tư vấn
                if (catID == 264) //Sex và cuộc sống
                {
                    price     = AppEnv.GetSetting("relaxsexprice");
                    ProductId = "RELAXADVISESEX";
                    Keyword   = "ADVISE_SEX";
                }
                else
                {
                    price     = AppEnv.GetSetting("relaxtuvanprice");
                    ProductId = "RELAXADVISEBOOK";
                    Keyword   = "ADVISE_BOOK";
                }
                break;
            }

            if (!Page.IsPostBack)
            {
                #region Free Content

                if (AppEnv.GetSetting("FreeContent") == "1")
                {
                    HienThiNoiDung(true, false);
                    return;
                }

                #endregion

                #region Old Content

                if (AppEnv.GetSetting("TestFlag") == "1")
                {
                    HienThiNoiDung(true, false);
                }
                else if (parentCatID.ToString() == "255" && WapController.W4A_Subscriber_IsActive(Session["msisdn"].ToString(), 1))
                {
                    HienThiNoiDung(true, false);
                }
                else
                {
                    if (Session["msisdn"] != null)
                    {
                        var charging = new Library.VNMCharging.VNMChargingGW();
                        messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), ProductId, Keyword, price, "D", "RELAX", Request.QueryString["id"]);

                        if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))//Not Enough Money
                        {
                            messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), ProductId, Keyword, price, "D", "RELAX", Request.QueryString["id"], out logPrice);
                            price         = logPrice;
                        }

                        if (messageReturn == AppEnv.GetSetting("SystemOverload")) //System Over Load
                        {
                            messageReturn = AppEnv.VnmChargingSystemOverload(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
                        {// Thanh toán không thành công >> thông báo lỗi
                            HienThiNoiDung(false, true);
                        }
                    }
                    else
                    {
                        pnlContentError.Visible = true;
                        litContentError.Text    = "Bạn vui lòng lựa chọn kết nối EDGE hay 3G để sử dụng dịch vụ này. Lưu ý, hãy ngắt kết nối wifi bạn nhé";
                    }
                }

                #endregion
            }
        }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            price = AppEnv.GetSetting("relaxprice");
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);

            telCo = AppEnv.CheckFreeContentTelco();

            DataTable dtDetail = TintucController.GetNewsDetailHasCache(id);

            if (dtDetail != null && dtDetail.Rows.Count > 0)
            {
                litName.Text = dtDetail.Rows[0]["Content_Headline"].ToString();
                catID        = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                if (catInfo != null && catInfo.Rows.Count > 0)
                {
                    catName = catInfo.Rows[0]["Zone_Name"].ToString();

                    parentCatID     = ConvertUtility.ToInt32(catInfo.Rows[0]["Zone_ParentID"]);
                    chitietGiaodich = "Thu gian: " + catInfo.Rows[0]["Zone_Name"] + " -- id: " + id;
                }

                int       totalrecord = 0;
                DataTable dtCat       = new DataTable();
                dtCat = TintucController.GetAllNewsByCategoryHasCache(catID, 8, 1, out totalrecord);
                if (dtCat != null && dtCat.Rows.Count > 0)
                {
                    IList <DataRow> contentTop = dtCat.Select().Skip(0).Take(5).ToList();
                    //IList<DataRow> contentBottom = dtCat.Select().Skip(3).Take(7).ToList();

                    rptTop.DataSource = contentTop.CopyToDataTable();
                    rptTop.DataBind();

                    //rptBottom.DataSource = contentBottom.CopyToDataTable();
                    //rptBottom.DataBind();
                }
            }

            switch (parentCatID.ToString())
            {
            case "258":           //Cẩm nang tư vấn
                if (catID == 264) //Sex và cuộc sống
                {
                    price     = ConfigurationSettings.AppSettings.Get("relaxsexprice");
                    ProductId = "RELAXADVISESEX";
                    Keyword   = "ADVISE_SEX";
                }
                else
                {
                    price     = ConfigurationSettings.AppSettings.Get("relaxtuvanprice");
                    ProductId = "RELAXADVISEBOOK";
                    Keyword   = "ADVISE_BOOK";
                }
                break;

            case "121":    //Gửi lời yêu thương
                price     = ConfigurationSettings.AppSettings.Get("relaxtuvanprice");
                ProductId = "RELAXLOVER";
                Keyword   = "LOVER";
                break;

            case "268":    //Địa điểm ăn chơi
                price     = ConfigurationSettings.AppSettings.Get("relaxanchoiprice");
                ProductId = "RELAXPLACE";
                Keyword   = "PLACE";
                break;

            case "255":    //Đọc truyện
                price = ConfigurationSettings.AppSettings.Get("relaxprice");
                //dungnt sua de charge dc
                ProductId = "LOTOLASTRESULT"; //"RELAXSTORYREAD";
                Keyword   = "LAST_RESULT";    //"READ";
                break;

            default:
                price     = ConfigurationSettings.AppSettings.Get("relaxprice");
                ProductId = "HOROSCOPE";
                Keyword   = "HOROSCOPE";
                break;
            }

            if (!Page.IsPostBack)
            {
                #region FREE CONTENT

                if (AppEnv.GetSetting("FreeContent") == "1")
                {
                    HienThiNoiDung(true, false);
                    return;
                }

                #endregion

                #region OLD

                if (AppEnv.GetSetting("TestFlag") == "1")
                {
                    HienThiNoiDung(true, false);
                }
                else if (parentCatID.ToString() == "255" && Session["msisdn"] != null && WapController.W4A_Subscriber_IsActive(Session["msisdn"].ToString(), 1))
                {
                    HienThiNoiDung(true, false);
                }
                else
                {
                    if (Session["msisdn"] != null)
                    {
                        var charging = new Library.VNMCharging.VNMChargingGW();
                        messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), ProductId, Keyword, price, "D", "RELAX", Request.QueryString["id"]);

                        if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))//Not Enough Money
                        {
                            messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), ProductId, Keyword, price, "D", "RELAX", Request.QueryString["id"], out logPrice);
                            price         = logPrice;
                        }

                        if (messageReturn == AppEnv.GetSetting("SystemOverload")) //System Over Load
                        {
                            messageReturn = AppEnv.VnmChargingSystemOverload(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
                        {// Thanh toán không thành công >> thông báo lỗi
                            HienThiNoiDung(false, true);
                        }
                    }
                    else
                    {
                        pnlContentError.Visible = true;
                        litContentError.Text    = "Bạn vui lòng lựa chọn kết nối EDGE hay 3G để sử dụng dịch vụ này. Lưu ý, hãy ngắt kết nối wifi bạn nhé";
                    }
                }

                #endregion

                //catid = ConvertUtility.ToInt32(Request.QueryString["catid"]);
                DataTable dtOnline = TintucController.GetAllCategoryExeptCatIDHasCache(255, catID);
                DataTable dtAudio  = TintucController.GetCategoryTruyenAudioCache();

                rptCateOnline.DataSource = dtOnline;
                rptCateOnline.DataBind();

                rptCateAudio.DataSource = dtAudio;
                rptCateAudio.DataBind();
            }
        }
コード例 #9
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);
            }
        }
コード例 #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                width = Request.QueryString["w"];
                lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]);

                id = ConvertUtility.ToInt32(Request.QueryString["id"]);

                string isComment = "0";

                DataTable dtDetail = new DataTable();
                DataTable dtOlder  = new DataTable();
                DataTable dtCat    = new DataTable();

                dtDetail = TintucController.GetNewsDetailHasCache(id);
                if (dtDetail.Rows.Count == 0)
                {
                    DataSet ds = ThethaoController.GetNewsDetailHasCache(id);
                    dtDetail = ds.Tables[0];
                    dtOlder  = ds.Tables[1];
                    catID    = 129;
                    CatName  = "Thể thao";
                }
                else
                {
                    catID = ConvertUtility.ToInt32(dtDetail.Rows[0]["Distribution_ZoneID"]);
                    DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                    if (catInfo != null && catInfo.Rows.Count > 0)
                    {
                        CatName = catInfo.Rows[0]["Zone_Name"].ToString();
                    }
                }


                if (dtDetail.Rows.Count > 0)
                {
                    rptDetail.DataSource = dtDetail;
                    rptDetail.DataBind();

                    DetailName = dtDetail.Rows[0]["Content_Headline"].ToString();

                    isComment = dtDetail.Rows[0]["Content_IsComment"].ToString();
                }

                if (dtOlder.Rows.Count > 0)
                {
                    dtCat = dtOlder;
                }
                else
                {
                    dtCat = TintucController.GetTopNewsOlderByCategoryHasCache(catID, id, 10);
                }

                //DataTable dtCat = TintucController.GetTopNewsOlderByCategoryHasCache(catID, id, 4);
                rptOlderNews.DataSource = dtCat;
                rptOlderNews.DataBind();

                DataTable dtNewsCharging = TintucController.GetNewsChargingCache();
                if (dtNewsCharging != null && dtNewsCharging.Rows.Count > 0)
                {
                    rptNewsCharging.DataSource = dtNewsCharging;
                    rptNewsCharging.DataBind();
                }

                if (ConvertUtility.ToBoolean(isComment))
                {
                    #region FREE CONTENT

                    if (AppEnv.GetSetting("FreeContent") == "1")
                    {
                        pnlContent.Visible = true;
                        return;
                    }

                    #endregion

                    #region OLD

                    if (Session["msisdn"] != null)
                    {
                        string price = "2000";

                        var    charging = new Library.VNMCharging.VNMChargingGW();
                        string result   = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", "Tin-Hot : id " + Request.QueryString["id"]);
                        if (result == "1")
                        {
                            pnlContent.Visible = true;
                            Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.RawUrl, id.ToString(), "Tin-Hot : id " + Request.QueryString["id"], 22);
                        }
                        else
                        {
                            pnlNotContent.Visible   = true;
                            litNotContentError.Text = "Giao dịch không thành công. Hoặc tài khoản không đủ tiền !";
                        }

                        //log charging
                        ILog logger = LogManager.GetLogger(Session["telco"].ToString());
                        logger.Debug("--------------------------------------------------");
                        logger.Debug("MSISDN:" + Session["msisdn"]);
                        logger.Debug("Dich vu: Tin Hot - parameter: " + price + " - Ten: " + "Tin-Hot : id " + Request.QueryString["id"] + " - id: " + id);
                        logger.Debug("Url:" + Request.RawUrl);
                        logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                        logger.Debug("Error:" + result);
                        logger.Debug("Current Url:" + Request.RawUrl);
                        //end log
                    }
                    else
                    {
                        pnlNotContent.Visible   = true;
                        litNotContentError.Text = "Bạn vui lòng lựa chọn kết nối EDGE hay 3G để sử dụng dịch vụ này. Lưu ý, hãy ngắt kết nối wifi bạn nhé";
                    }

                    #endregion
                }
                else
                {
                    pnlContent.Visible = true;
                }
            }
        }