コード例 #1
0
        protected void rptZoneList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            string    curData         = (string)e.Item.DataItem;
            Label     lblCatetoryName = (Label)e.Item.FindControl("lblCatetoryName");
            Repeater  rptCategory     = (Repeater)e.Item.FindControl("rptCategory");
            DataTable catInfo         = TintucController.GetCategoryByCatIDHasCache(ConvertUtility.ToInt32(curData));

            if (lang == 1)
            {
                lblCatetoryName.Text = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
            }
            else
            {
                lblCatetoryName.Text = catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
            }

            DataTable dt = TintucController.GetAllCategoryExeptCatIDHasCache(ConvertUtility.ToInt32(curData), catid);

            rptCategory.DataSource     = dt;
            rptCategory.ItemDataBound += rptCategory_ItemDataBound;
            rptCategory.DataBind();
        }
コード例 #2
0
        protected void Page_Load(object sender, EventArgs e)
        {
            catID = ConvertUtility.ToInt32(Request.QueryString["catid"]);
            if (!Page.IsPostBack)
            {
                string    catName = string.Empty;
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                if (catInfo != null && catInfo.Rows.Count > 0)
                {
                    catName = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
                    lblCatetoryName.Text = catName;
                }

                if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
                {
                    curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
                }

                int       totalrecord = 0;
                DataTable dtCat       = TintucController.GetAllNewsByCategoryHasCache(catID, pagesize, curpage, out totalrecord);
                if (dtCat != null && dtCat.Rows.Count > 0)
                {
                    rptCategory.DataSource = dtCat;
                    rptCategory.DataBind();

                    Paging1.totalrecord = totalrecord;
                    Paging1.pagesize    = pagesize;
                    Paging1.numberpage  = pagenumber;

                    Paging1.defaultparam = UrlProcess.ThuGianChuyenMuc(catID, curpage, catName);
                    Paging1.queryparam   = UrlProcess.ThuGianChuyenMuc(catID, curpage, catName);
                }
            }
        }
コード例 #3
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
            }
        }
コード例 #4
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
        }
コード例 #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                catID = ConvertUtility.ToInt32(Request.QueryString["catid"]);
                width = Request.QueryString["w"];
                lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]);

                if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
                {
                    curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
                }

                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                if (catInfo != null && catInfo.Rows.Count > 0)
                {
                    CatName = catInfo.Rows[0]["Zone_Name"].ToString();
                }

                int       totalrecord = 0;
                DataTable dtCat       = new DataTable();

                //DataTable dtCat = TintucController.GetAllNewsByCategoryHasCache(catID, pagesize, curpage, out totalrecord);

                if (catID == 129)
                {
                    dtCat = ThethaoController.GetLastestNewsFromTheThaoSoHasCache(curpage, pagesize, out totalrecord);
                }
                else
                {
                    dtCat = TintucController.GetAllNewsByCategoryHasCache(catID, pagesize, curpage, out totalrecord);
                }


                if (dtCat != null && dtCat.Rows.Count > 0)
                {
                    rptList.DataSource = dtCat;
                    rptList.DataBind();

                    Paging1.totalrecord = totalrecord;
                    Paging1.pagesize    = pagesize;
                    Paging1.numberpage  = pagenumber;

                    Paging1.defaultparam = UrlProcess.TinTucChuyenMuc(catID, curpage, CatName);
                    Paging1.queryparam   = UrlProcess.TinTucChuyenMuc(catID, curpage, CatName);

                    //Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"];
                    //Paging1.queryparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"] + "&cpage=";
                }
            }
        }
コード例 #6
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);
            }
        }
コード例 #7
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
        }
コード例 #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = AppEnv.GetSetting("urldata");
            width  = Request.QueryString["w"];
            catID  = ConvertUtility.ToInt32(Request.QueryString["catid"]);
            if (!IsPostBack)
            {
                lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                if (lang == 1)
                {
                    lnkCatName.Text = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
                }
                else
                {
                    lnkCatName.Text = catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
                }
                lnkCatName.NavigateUrl = UrlProcess.GetNewsCategoryUrlNew(lang.ToString(), width, catID.ToString());
            }
            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = TintucController.GetAllNewsByCategoryHasCache(catID, pagesize, curpage, out totalrecord);

            if (dtCat.Rows.Count > 0)
            {
                CurrentRow = dtCat.Rows.Count;
                rptlstCategory.DataSource     = dtCat;
                rptlstCategory.ItemDataBound += rptlstCategory_ItemDataBound;
                rptlstCategory.DataBind();
                Paging1.totalrecord  = totalrecord;
                Paging1.pagesize     = pagesize;
                Paging1.numberpage   = pagenumber;
                Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"];
                Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"] + "&cpage=";
            }
            //end category list
        }
コード例 #9
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
            }
        }
コード例 #10
0
        protected void rptZoneList_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            string   curData         = (string)e.Item.DataItem;
            Label    lblCatetoryName = (Label)e.Item.FindControl("lblCatetoryName");
            Repeater rptCategory     = (Repeater)e.Item.FindControl("rptCategory");
            Panel    pnlDangKy       = (Panel)e.Item.FindControl("pnlDangKy");
            Literal  litContent      = (Literal)e.Item.FindControl("litContent");

            string url     = string.Empty;
            string display = string.Empty;
            ////Sửa bỏi Bình Trần - 25/11/2016
            //if (curData == "118") //TRUYEN CUOI
            //{
            //    pnlDangKy.Visible = true;
            //    url = "/ThuGian/Cuoi.aspx?lang=" + lang + "&w=" + width;
            //    display = "Trải nghiệm Truyện Cười cực HOT";
            //}
            //else if(curData == "268") //DIA DIEM AN CHOI
            //{
            //    pnlDangKy.Visible = true;
            //    url = "/ThuGian/AnChoi.aspx?lang=" + lang + "&w=" + width;
            //    display = "Trải nghiệm Địa điểm Ăn chơi cực HOT";
            //}
            //else if(curData == "258") //CAM NANG TU VAN
            //{
            //    pnlDangKy.Visible = true;
            //    url = "/ThuGian/Sex.aspx?lang=" + lang + "&w=" + width;
            //    display = "Trải nghiệm dịch vụ SEX và Cuộc Sống cực HOT";
            //}
            //else if(curData == "255") //DOC TRUYEN
            //{
            //    pnlDangKy.Visible = true;
            //    url = "/ThuGian/DocTruyen.aspx?lang=" + lang + "&w=" + width;
            //    display = "Trải nghiệm dịch vụ Đọc Truyện cực HOT";
            //}
            //else if(curData == "375")//CUNG HOANG DAO
            //{
            //    pnlDangKy.Visible = true;
            //    url = "/ThuGian/CungHoangDao.aspx?lang=" + lang + "&w=" + width;
            //    display = "Trải nghiệm dịch vụ Cung hoàng đạo cực HOT";
            //}

            string content = " <a class=\"link-non-orange\" href=\"" + url + "\"><span class=\"orange bold\"> " + AppEnv.CheckLang(display) + " </span></a>";

            litContent.Text = content;

            DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(ConvertUtility.ToInt32(curData));

            if (lang == 1)
            {
                lblCatetoryName.Text = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
            }
            else
            {
                lblCatetoryName.Text = catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
            }

            DataTable dt = TintucController.GetAllCategoryExeptCatIDHasCache(ConvertUtility.ToInt32(curData), catid);

            rptCategory.DataSource     = dt;
            rptCategory.ItemDataBound += rptCategory_ItemDataBound;
            rptCategory.DataBind();
        }
コード例 #11
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;
                        }
                    }
                }
            }
        }
コード例 #12
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
            }
        }
コード例 #13
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;
                }
            }
        }
コード例 #14
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
            }
        }
コード例 #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            price = ConfigurationSettings.AppSettings.Get("relaxprice");
            width = Request.QueryString["w"];
            catID = ConvertUtility.ToInt32(Request.QueryString["catid"]);
            if (!IsPostBack)
            {
                lang = ConvertUtility.ToInt32(Request.QueryString["lang"]);
                DataTable catInfo = TintucController.GetCategoryByCatIDHasCache(catID);
                DataTable catParent;
                if (ConvertUtility.ToInt32(catInfo.Rows[0]["Zone_ParentID"]) != 0)
                {
                    catParent = TintucController.GetCategoryByCatIDHasCache(ConvertUtility.ToInt32(catInfo.Rows[0]["Zone_ParentID"]));
                    if (lang == 1)
                    {
                        lblCatName.Text = catParent.Rows[0]["Zone_Name"].ToString().ToUpper() + " » " + catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
                    }
                    else
                    {
                        lblCatName.Text = catParent.Rows[0]["Zone_Alias"].ToString().ToUpper() + " » " + catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
                    }
                }
                else
                {
                    if (lang == 1)
                    {
                        lblCatName.Text = catInfo.Rows[0]["Zone_Name"].ToString().ToUpper();
                    }
                    else
                    {
                        lblCatName.Text = catInfo.Rows[0]["Zone_Alias"].ToString().ToUpper();
                    }
                }
                if (lang == 1)
                {
                    //ltrGia.Text = "(" + Resources.Resource.wThongBaoGia + "xxx" + Resources.Resource.wDonViTien;
                }
                else
                {
                    //ltrGia.Text = "(" + Resources.Resource.wThongBaoGia_KD + "xxx" + Resources.Resource.wDonViTien_KD;
                }

                //if (catID == 264) ltrGia.Text = ltrGia.Text.Replace("xxx", ConfigurationSettings.AppSettings.Get("relaxsexprice"));
                switch (catInfo.Rows[0]["Zone_ParentID"].ToString())
                {
                case "118":
                    //ltrGia.Text = ltrGia.Text.Replace("xxx", ConfigurationSettings.AppSettings.Get("relaxprice")) + ")";
                    break;

                case "258":
                    //ltrGia.Text = ltrGia.Text.Replace("xxx", ConfigurationSettings.AppSettings.Get("relaxtuvanprice")) + ")";
                    break;

                case "121":
                    //ltrGia.Text = ltrGia.Text.Replace("xxx", ConfigurationSettings.AppSettings.Get("relaxtuvanprice")) + ")";
                    break;

                case "268":
                    //ltrGia.Text = ltrGia.Text.Replace("xxx", ConfigurationSettings.AppSettings.Get("relaxanchoiprice")) + ")";
                    break;

                case "255":
                    //ltrGia.Text = ltrGia.Text.Replace("xxx", ConfigurationSettings.AppSettings.Get("relaxtruyenprice")) + "/30 ngày đọc truyện)";
                    break;

                default:
                    //ltrGia.Text = ltrGia.Text.Replace("xxx", ConfigurationSettings.AppSettings.Get("relaxprice")) + ")";
                    break;
                }
            }

            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }

            //start category list
            int       totalrecord = 0;
            DataTable dtCat       = TintucController.GetAllNewsByCategoryHasCache(catID, pagesize, curpage, out totalrecord);

            rptlstCategory.DataSource     = dtCat;
            rptlstCategory.ItemDataBound += new RepeaterItemEventHandler(rptlstCategory_ItemDataBound);
            rptlstCategory.DataBind();
            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&catid=" + Request.QueryString["catid"] + "&cpage=";
        }
コード例 #16
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();
            }
        }
コード例 #17
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);
            }
        }