private static string GetTelco(string mobile)
    {
        string prenumber = mobile.Substring(0, 5);

        string[] dfsplit = AppEnv.GetSetting("sfone").Split('|');
        foreach (string s in dfsplit)
        {
            if (s != "")
            {
                if (prenumber.StartsWith(s))
                {
                    return("sfone");
                }
            }
        }

        dfsplit = AppEnv.GetSetting("vnmobile").Split('|');
        foreach (string s in dfsplit)
        {
            if (s != "")
            {
                if (prenumber.StartsWith(s))
                {
                    return("vnmobile");
                }
            }
        }

        dfsplit = AppEnv.GetSetting("gtel").Split('|');
        foreach (string s in dfsplit)
        {
            if (s != "")
            {
                if (prenumber.StartsWith(s))
                {
                    return("gtel");
                }
            }
        }

        dfsplit = AppEnv.GetSetting("viettel").Split('|');
        foreach (string s in dfsplit)
        {
            if (s != "")
            {
                if (prenumber.StartsWith(s))
                {
                    return("viettel");
                }
            }
        }

        dfsplit = AppEnv.GetSetting("vms").Split('|');
        foreach (string s in dfsplit)
        {
            if (s != "")
            {
                if (prenumber.StartsWith(s))
                {
                    return("vms");
                }
            }
        }

        dfsplit = AppEnv.GetSetting("gpc").Split('|');
        foreach (string s in dfsplit)
        {
            if (s != "")
            {
                if (prenumber.StartsWith(s))
                {
                    return("gpc");
                }
            }
        }

        return("");
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            catID = ConvertUtility.ToInt32(Request.QueryString["catid"]);

            if (catID == ConvertUtility.ToInt32(AppEnv.GetSetting("thuphapid")))
            {
                price = AppEnv.GetSetting("thuphapprice");
            }
            else
            {
                price = AppEnv.GetSetting("wallprice");
            }

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

            telCo = AppEnv.CheckSessionTelco();

            //linkStr = "<a href=\"/" + UrlProcess.HinhNenHome() + "\" >HÌNH NỀN<a>";
            //linkStr_KD = "<a href=\"/" + UrlProcess.HinhNenHome() + "\" >HINH NEN<a>";

            if (!IsPostBack)
            {
                //if (width == 0)
                //    width = (int)Constant.DefaultScreen.Standard;
                //ltrWidth.Text = "<meta content=\"width=" + width + "; 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 Content

                DataTable dtDetail = HinhNenController.GetWallpaperDetailByID(AppEnv.CheckSessionTelco(), id);
                if (dtDetail != null)
                {
                    chitietGiaodich = "Hinh nen: " + dtDetail.Rows[0]["WTitle"] + " -- id:" + id;
                }

                if (telCo == "Undefined")
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("wallcode") + " " + dtDetail.Rows[0]["WCode"].ToString() + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("wallcommandcode") + "</b> để tải hình nền <b>" + dtDetail.Rows[0]["WTitle_Unicode"].ToString() + "</b> về máy" + Resources.Resource.wChon3G;
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("wallcode") + " " + dtDetail.Rows[0]["WCode"].ToString() + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("wallcommandcode") + "</b> de tai hinh nen <b>" + dtDetail.Rows[0]["WTitle"].ToString() + "</b> ve may" + Resources.Resource.wChon3G_KD;
                    }
                }
                else
                {
                    pnlThongBao.Visible = false;
                    switch (Session["telco"].ToString())
                    {
                    case "Vietnamobile":
                        var charging = new Library.VNMCharging.VNMChargingGW();

                        messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "PICDOWN", "PIC_DOWN", price, "D", "WP", chitietGiaodich);

                        if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))    //Not Enough Money
                        {
                            messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), "PICDOWN", "PIC_DOWN", price, "D", "WP", chitietGiaodich, out logPrice);
                            price         = logPrice;
                        }

                        if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                        {
                            messageReturn = AppEnv.VnmChargingSystemOverload(Session["msisdn"].ToString(), "PICDOWN", "PIC_DOWN", price, "D", "WP", chitietGiaodich);
                        }

                        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
            }
        }
        protected void btnCo_Click(object sender, EventArgs e)
        {
            if (AppEnv.GetSetting("S2Test") == "1")
            {
                //Session["S2Result_Clip"] = "1";

                pnlThongBao.Visible = false;
                pnlSMS.Visible      = false;

                pnlNoiDung.Visible = true;

                ltrNoiDung.Text = lang == "1" ? "Bạn đã đăng ký thành công. Video Clip sẽ được gửi đến điện thoại của bạn vào 10h30 hàng ngày <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY CLIP </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                        : "Ban da dang ky thanh cong. Video Clip se duoc gui den dien thoai cua ban vao 10h30 hang ngay. <br/> De huy dich vu vui long soan: <b> HUY CLIP </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
            }
            else
            {
                string shortCode   = AppEnv.GetSetting("S2ShortCode");   //223
                string requestId   = AppEnv.GetSetting("S2RequestID");
                string commandCode = AppEnv.GetSetting("S2Commandcode"); //DK
                string message     = AppEnv.GetSetting("S2DK_CLIP");
                string msisdn      = Session["msisdn"].ToString();

                string   reResult  = AppEnv.RegisterService(shortCode, requestId, msisdn, commandCode, message);
                string[] arrResult = reResult.Split('|');

                if (arrResult.Length > 0)
                {
                    if (arrResult[0] == "1")
                    {
                        //Session["S2Result_Clip"] = "1";
                        pnlThongBao.Visible = false;
                        pnlSMS.Visible      = false;

                        pnlNoiDung.Visible = true;

                        ltrNoiDung.Text = lang == "1" ? "Bạn đã đăng ký thành công. Video Clip sẽ được gửi đến điện thoại của bạn vào 10h30 hàng ngày <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY CLIP </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                : "Ban da dang ky thanh cong. Video Clip se duoc gui den dien thoai cua ban vao 10h30 hang ngay. <br/> De huy dich vu vui long soan: <b> HUY CLIP </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                    }
                    else
                    {
                        pnlThongBao.Visible = false;
                        pnlSMS.Visible      = false;

                        pnlNoiDung.Visible = true;

                        ltrNoiDung.Text = lang == "1" ? "Đăng ký không thành công. Vui lòng thử lại" : "Dang ky khong thanh cong. Vui long thu lai";
                    }
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);

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

            info = XosoController.GetInfobyCompanyID(ConvertUtility.ToInt32(id));

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

                pnlSMS.Visible = true;

                if (Session["msisdn"] != null)
                {
                    string subCode = "DK SC " + info.Rows[0]["Company_Comment"];

                    string   value = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", subCode);//ANDY Service S2_94x
                    string[] res   = value.Split('|');
                    if (res.Length > 0)
                    {
                        ltrHuongdan.Text = lang == "1" ? "Thống kê cặp số" : "Thong ke cap so";
                        if (res[0] == "1")//DK THANH CONG
                        {
                            ltrSMS.Text = lang == "1"
                                ? "Bạn đã đăng ký thành công. Dự đoán kết quả xổ số <b> " + info.Rows[0]["company_name"].ToString().Replace("XS", "") + " </b> sẽ trả về vào những ngày quay thưởng. <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY SC " + info.Rows[0]["company_comment"].ToString().Replace("XS", "") + " </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                : "Ban da dang ky thanh cong. Du doan ket qua xo so </b>" + AppEnv.CheckLang(info.Rows[0]["company_name"].ToString().Replace("XS", "")) + "</b> se tra ve vao nhung ngay quay thuong. <br/> De huy dich vu vui long soan: <b> HUY SC " + info.Rows[0]["company_comment"].ToString().Replace("XS", "") + " </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                        }
                        else
                        {
                            if (res[1].Trim() == "DoubleRegister")
                            {
                                ltrSMS.Text = lang == "1"
                                    ? "Bạn đã là thuê bao của dịch vụ soi cầu hàng ngày. Xin cảm ơn <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY SC " + info.Rows[0]["company_comment"].ToString().Replace("XS", "") + " </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                    : "Ban da la thue bao cua dich vu soi cau hang ngay. Xin cam on <br/> De huy dich vu vui long soan: <b> HUY SC " + info.Rows[0]["company_comment"].ToString().Replace("XS", "") + " </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                            }
                            else
                            {
                                ltrSMS.Text = AppEnv.GetSetting("VNM_DangKyThatBai_Mt");
                            }
                        }
                    }
                }
                else
                {
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = "Thống kê cặp số";
                        ltrSMS.Text      = "Cung cấp dự đoán kết quả xổ số <b> " + info.Rows[0]["company_name"].ToString().Replace("XS", "") + " </b> nhanh chóng, chính xác, thuận tiện. Tư vấn và nhận định cặp số sẽ về trong ngày hiện tại.Đăng ký một lần nhận tin mãi mãi <br/> Miễn phí 7 lần trả KQ đầu tiên.<br/>Vui lòng truy cập bằng <b> 3G/GPRS </b> hoặc : <br/> SOẠN TIN :  <b> DK SC " + info.Rows[0]["company_comment"] + " </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + "</b>";
                    }
                    else
                    {
                        ltrHuongdan.Text = "Thong ke cap so";
                        ltrSMS.Text      = "Cung cap du doan ket qua xo so <b> " + AppEnv.CheckLang(info.Rows[0]["company_name"].ToString().Replace("XS", "")) + " </b> nhanh chong, chinh xac, thuan tien. Ket qua se duoc gui ngay toi khach hang sau khi mo thuong. Dang ky mot lan nhan tin mai mai <br/> Mien phi 7 lan tra KQ dau tien.<br/>Vui long truy cap bang <b> 3G/GPRS </b> hoac : <br/> SOAN TIN : <b> DK SC " + AppEnv.CheckLang(info.Rows[0]["company_comment"].ToString()) + " </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + "</b>";
                    }
                }
            }
        }
Example #5
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            price = ConfigurationSettings.AppSettings.Get("goldprice");

            telCo = AppEnv.CheckFreeContentTelco();

            linkStr    = "<a href=\"../" + UrlProcess.GetSportHomeUrl(lang, "home", width.ToString()).Replace("~/", "") + "\" >BÓNG ĐÁ<a>";
            linkStr_KD = "<a href=\"../" + UrlProcess.GetSportHomeUrl(lang, "home", width.ToString()).Replace("~/", "") + "\" >BONG DA<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\" />";

                #region Free Content

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

                #endregion

                #region OLD

                gameid = ThethaoController.GetAll_Sport87DetailByGame87ID(ConvertUtility.ToInt32(Request.QueryString["id"])).Rows[0]["PK_Game87_ID"].ToString();
                DataSet ds87detail = ThethaoController.GetAll_Sport87_DetailBy_PK_Game87ID(gameid);
                if (!ConvertUtility.ToBoolean(ds87detail.Tables[0].Rows[0]["IsFull"]))
                {
                    pnlThongBao.Visible = true;
                    if (lang == "1")
                    {
                        ltrTitle.Text = linkStr + " » " + Resources.Resource.wThongBao;
                        //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu.Replace("xxx", price);
                        ltrThongBao.Text = ds87detail.Tables[1].Rows[0]["ContentValue"].ToString();
                        btnCo.Visible    = false;
                        btnKhong.Visible = false;
                    }
                    else
                    {
                        ltrTitle.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                        //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD.Replace("xxx", price);
                        ltrThongBao.Text = UnicodeUtility.UnicodeToKoDau(ds87detail.Tables[1].Rows[0]["ContentValue"].ToString());
                        btnCo.Visible    = false;
                        btnKhong.Visible = false;
                    }
                }
                else
                {
                    if (WapController.W4A_Subscriber_IsActive(ConvertUtility.ToString(Session["msisdn"]), 2))
                    {
                        HienThiNoiDung(true, false);
                        return;
                    }

                    // Nếu có transactionid_old >> thuê bao mobifone đã thực hiện thanh toán
                    if (Session["transactionid_old"] != null)
                    {
                        messageReturn = ConvertUtility.ToString(Session["debit_status"]);
                        if (ConvertUtility.ToString(Session["debit_status"]) == "0")
                        {// 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);
                        }
                        Session["transactionid_old"] = null;
                    }
                    else
                    {
                        //gameid = ThethaoController.GetAll_Sport87DetailByGame87ID(ConvertUtility.ToInt32(Request.QueryString["id"])).Rows[0]["PK_Game87_ID"].ToString();
                        if (telCo == Constant.T_Mobifone)
                        {
                            string content = Session["cpid"].ToString() + "&" + Constant.thethao + "9" + Request.QueryString["id"] + "&" + price + "&" + Session["transactionid"].ToString();
                            Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                        }
                        //
                        if (telCo == "Undefined")
                        {
                            pnlSMS.Visible = true;
                            if (lang == "1")
                            {
                                ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                                //Xiên
                                if (Request.QueryString["id"] == "2")
                                {
                                    ltrSMS.Text = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("xiencode") + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("xiencommandcode") + "</b> để nhận chuỗi kèo xiên sáng nhất" + Resources.Resource.wChon3G;
                                }
                                //Trận cầu vàng
                                if (Request.QueryString["id"] == "4")
                                {
                                    ltrSMS.Text = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("goldcode") + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("goldcommandcode") + "</b> để nhận thông tin về trận cầu ngon ăn nhất" + Resources.Resource.wChon3G;
                                }
                                //Tài Xỉu sáng nhất
                                if (Request.QueryString["id"] == "5")
                                {
                                    ltrSMS.Text = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("tvtxcode") + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("tvtxcommandcode") + "</b> để nhận thông tin Tài Xỉu sáng nhất" + Resources.Resource.wChon3G;
                                }
                                //Trên dưới sáng nhất
                                if (Request.QueryString["id"] == "6")
                                {
                                    ltrSMS.Text = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("tvtdcode") + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("tvtdcommandcode") + "</b> để nhận thông tin Trên Dưới sáng nhất" + Resources.Resource.wChon3G;
                                }
                                //Sáng nhất giải
                                if (",1,3,7,8,9,10,11,12,".LastIndexOf("," + Request.QueryString["id"] + ",") >= 0)
                                {
                                    ltrSMS.Text = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("sangcode") + " &lt;ma tran&gt;</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("sangcommandcode") + "</b> để nhận thông tin Kèo sáng nhất giải" + Resources.Resource.wChon3G;
                                }
                            }
                            else
                            {
                                ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                                if (Request.QueryString["id"] == "2")
                                {
                                    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("xiencode") + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("xiencommandcode") + "</b> de nhan chuoi keo xien sang nhat" + Resources.Resource.wChon3G;
                                }
                                if (Request.QueryString["id"] == "4")
                                {
                                    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("goldcode") + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("goldcommandcode") + "</b> de nhan thong tin ve tran cau ngon an nhat" + Resources.Resource.wChon3G_KD;
                                }
                                if (Request.QueryString["id"] == "5")
                                {
                                    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("tvtxcode") + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("tvtxcommandcode") + "</b> de nhan thong tin Tai Xiu sang nhat" + Resources.Resource.wChon3G_KD;
                                }
                                if (Request.QueryString["id"] == "6")
                                {
                                    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("tvtdcode") + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("tvtdcommandcode") + "</b> de nhan thong tin Tren Duoi sang nhat" + Resources.Resource.wChon3G_KD;
                                }
                                if (",1,3,7,8,9,10,11,12,".LastIndexOf("," + Request.QueryString["id"] + ",") >= 0)
                                {
                                    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("sangcode") + " &lt;ma tran&gt;</b> gui <b>" + ConfigurationSettings.AppSettings.Get("sangcommandcode") + "</b> de nhan thong tin Keo sang nhat giai" + Resources.Resource.wChon3G_KD;
                                }
                            }
                        }
                        else
                        {
                            pnlThongBao.Visible = false;
                            switch (Session["telco"].ToString())
                            {
                            case "Vietnamobile":
                                var charging = new Library.VNMCharging.VNMChargingGW();


                                messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "GAME87", Request.QueryString["id"]);

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

                                if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                                {
                                    messageReturn = AppEnv.VnmChargingSystemOverload(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "GAME87", Request.QueryString["id"]);
                                }

                                if (!string.IsNullOrEmpty(messageReturn) && 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
            }
        }
Example #6
0
        //private static void GetTopNews(string html, FilterFullInfo record)
        //{
        //    try
        //    {
        //        long totalSize = 0;

        //        //string p = "<div class="folder-top">.*?<a.*?href="(?<Link>.*?)".*?><img.*?src="(?<ImagePath>.*?)".*?/></a>.*?<p><a.*?href=".*?".*?class="link-topnews">(?<Title>.*?)</a>.*?<label class="item-time">(?<Time>.*?)</label>.*?<label class="item-date">(?<Date>.*?)</label></p>.*?<p>(?<Teaser>.*?)</p>.*?</div>";
        //        MatchCollection mcList = Regex.Matches(html, record.ParternGetTopNews, RegexOptions.IgnoreCase | RegexOptions.Singleline);


        //    }
        //    catch (Exception ex)
        //    {
        //        _logger.Info(string.Format("Error = {0}", ex.Message) + Environment.NewLine);

        //    }

        //}

        //Tra ve 1 mang chua cac link va image thumb
        private static string StartMining(Record record)
        {
            string url       = record.Source;
            long   totalSize = 0;
            string html      = RunBrowser(record.Source, out totalSize);

            if (record.ListStartAfter.IndexOf("*[@") > 0)
            {
                HtmlDocument docList = new HtmlDocument();
                docList.LoadHtml(html);
                HtmlNode nodes = docList.DocumentNode.SelectSingleNode(record.ListStartAfter);

                if (nodes != null)
                {
                    html = nodes.InnerHtml;
                }
                else
                {
                    html = "";
                }
            }
            else
            {
                if (html.IndexOf(record.ListStartAfter.Replace(".*", "")) > 0)
                {
                    html = Regex.Match(html, record.ListStartAfter, RegexOptions.IgnoreCase | RegexOptions.Singleline).Value;

                    // Remove doan duoi
                    html = Regex.Replace(html, record.ListEndAt, "", RegexOptions.Singleline);
                }
                else
                {
                    html = "";
                }
            }

            if (html != "")
            {
                html = html.Replace("\r\n", "").Replace("> <", "><");

                HtmlDocument doc1 = new HtmlDocument();
                doc1.LoadHtml(html);
                HtmlNodeCollection nodes = doc1.DocumentNode.SelectNodes("//li");

                if (nodes != null)
                {
                    foreach (HtmlNode itemList in nodes)
                    {
                        HtmlNode nodesImage = itemList.SelectSingleNode("//*[@class=\"box-wiget-content-img\"]/a");
                        string   imgAvatar  = nodesImage.InnerHtml;

                        HtmlNode nodesTitle = itemList.SelectSingleNode("//*[@class=\"box-wiget-content-title fsize14\"]/a");
                        string   title      = nodesTitle.InnerHtml;

                        HtmlNode nodesTeaser = itemList.SelectSingleNode("//*[@class=\"box-wiget-content-des\"]/span");
                        string   Teaser      = nodesTeaser.InnerHtml;

                        HtmlNode      nodesLink = itemList.SelectSingleNode("//*[@class=\"box-wiget-content-img\"]/a[@href]");
                        HtmlAttribute linkAtt   = nodesLink.Attributes["href"];
                        string        link      = linkAtt.Value;

                        HtmlNode nodesPubDate = itemList.SelectSingleNode("//*[@class=\"box-wiget-content-timpost\"]");
                        string   pubDate      = nodesPubDate.InnerHtml;

                        //MatchCollection mcList = Regex.Matches(html, record.ParternList, RegexOptions.IgnoreCase | RegexOptions.Singleline);

                        var list      = new List <ObjectLink>();
                        var listImage = new List <ObjectImage>();

                        int i = 0;

                        //if (mcList != null && mcList.Count > 0)
                        //{
                        //    _logger.Debug("Matchs  : " + mcList.Count.ToString());

                        //foreach (Match match in mcList)
                        //{
                        #region Get main content

                        var contentInfo = new ContentInfo();

                        contentInfo.Content_Headline = AppEnv.NCRToUnicode(Regex.Replace(title, "<.*?>", "", RegexOptions.IgnoreCase | RegexOptions.Singleline)); // AppEnv.NCRToUnicode(Regex.Replace(match.Groups["Title"].Value, "<.*?>", "", RegexOptions.IgnoreCase | RegexOptions.Singleline));
                        contentInfo.Content_Url      = link;                                                                                                      // OptimiseUrl(match.Groups["Link"].Value, record);

                        try
                        {
                            Uri uri  = new Uri(contentInfo.Content_Url);
                            Uri uri1 = new Uri(record.Source);
                            if (uri.Host != uri1.Host)
                            {
                                continue;
                            }
                        }
                        catch (Exception)
                        {
                            continue;
                        }


                        long totalSizeTemp = 0;

                        string contentDetail = GetContentDetail(contentInfo.Content_Url, record, out totalSizeTemp);
                        if (contentDetail.Trim() == "")
                        {
                            continue;
                        }
                        contentInfo.Content_Teaser = StripTagsRegex(Teaser); // StripTagsRegex(match.Groups["Teaser"].Value);
                        if (contentInfo.Content_Teaser.Trim() == "")
                        {
                            continue;
                        }
                        contentInfo.Content_Body = GetContentBody(contentDetail, record);
                        if (contentInfo.Content_Body.Trim() == "")
                        {
                            continue;
                        }

                        string date = "";
                        date = pubDate;// match.Groups["PubDate"].Value;
                        if (date == "")
                        {
                            if (record.PatternPubDate != "")
                            {
                                date = GetPubDateByParttern(contentDetail, record);
                            }
                            else
                            {
                                date = GetPubDate(contentInfo.Content_Body, record);
                            }
                        }

                        contentInfo.Content_CreateDate = OpitmisePubDate(date);

                        contentInfo.Content_Status     = 1;
                        contentInfo.CategoryID         = record.CategoryID;
                        contentInfo.Content_UserID     = 212;
                        contentInfo.Content_HeadlineKD = UnicodeUtility.UnicodeToKoDau(contentInfo.Content_Headline);
                        contentInfo.Content_TeaserKD   = UnicodeUtility.UnicodeToKoDau(contentInfo.Content_Teaser);
                        contentInfo.Content_Source     = record.Page;

                        string imagePath = imgAvatar;// match.Groups["ImagePath"].Value.Trim();
                        if (imagePath.IndexOf("src=\"") > -1)
                        {
                            imagePath = imagePath.Substring(imagePath.IndexOf("src=\"") + 5);
                            imagePath = imagePath.Substring(0, imagePath.IndexOf("\""));
                        }
                        if (imagePath.IndexOf("src='") > -1)
                        {
                            imagePath = imagePath.Substring(imagePath.IndexOf("src='") + 5);
                            imagePath = imagePath.Substring(0, imagePath.IndexOf("'"));
                        }
                        string imageDownloadUrl = "";
                        string imageName        = "";
                        if (Convert.ToInt32(AppEnv.GetSetting("SaveImage")) == 1)
                        {
                            #region lay anh dau tien trong bai chi tiet

                            HtmlDocument doc = new HtmlDocument();
                            doc.LoadHtml(contentInfo.Content_Body);

                            HtmlNodeCollection node = doc.DocumentNode.SelectNodes("//img");
                            if (node != null)
                            {
                                foreach (HtmlNode img in node)
                                {
                                    HtmlAttribute att = img.Attributes["src"];
                                    imageDownloadUrl = att.Value;

                                    string   exceptionImg = AppEnv.GetSetting("exceptionImg");
                                    string[] arr          = exceptionImg.Split(',');
                                    int      flag         = 0;
                                    foreach (string item in arr)
                                    {
                                        if (item != "")
                                        {
                                            if (imageDownloadUrl.Contains(item))
                                            {
                                                imageDownloadUrl = "";
                                                flag             = 1;
                                                break;
                                            }
                                        }
                                    }

                                    if (flag == 1)
                                    {
                                        continue;
                                    }
                                    else
                                    {
                                        break;
                                    }
                                }
                            }
                            else
                            {
                                imageDownloadUrl = imagePath;
                            }

                            #endregion

                            imageDownloadUrl = OptimiseUrl(imageDownloadUrl, record);
                            imageName        = DateTime.Now.ToString("yyyyMMddHHmmssffff") + ".jpg";

                            var objectImage = new ObjectImage
                            {
                                ImageName = imageName,
                                Link      = imageDownloadUrl
                            };

                            listImage.Add(objectImage);

                            contentInfo.Content_Avatar = AppEnv.GetSetting("virtualPath") + DateTime.Now.Year + "/" + DateTime.Now.Month + "/" + DateTime.Now.Day + "/" + imageName;
                        }
                        else
                        {
                            contentInfo.Content_Avatar = record.HttpPrefix + imagePath;
                        }
                        contentInfo.Content_BigAvatar = "";

                        if (i < 6)
                        {
                            contentInfo.Content_Rank = 2;
                        }
                        else
                        {
                            contentInfo.Content_Rank = 1;
                        }

                        contentInfo.IsPublished = true;

                        try
                        {
                            DateTime dt = Convert.ToDateTime(contentInfo.Content_CreateDate);

                            if (dt.Year == DateTime.Now.Year && dt.Month == DateTime.Now.Month && dt.Day < DateTime.Now.Day)
                            {
                                continue;
                            }
                            else
                            {
                                if (dt.Year < DateTime.Now.Year || dt.Month < DateTime.Now.Month)
                                {
                                    continue;
                                }
                                else
                                {
                                    int returnValue = AppEnv.Insert(contentInfo);
                                }
                            }
                        }
                        catch (Exception)
                        {
                            try
                            {
                                DateTime dt = DateTime.Parse(contentInfo.Content_CreateDate, new CultureInfo("fr-FR", false));
                                if (dt.Year == DateTime.Now.Year && dt.Month == DateTime.Now.Month && dt.Day < DateTime.Now.Day)
                                {
                                    continue;
                                }
                                else
                                {
                                    if (dt.Year < DateTime.Now.Year || dt.Month < DateTime.Now.Month)
                                    {
                                        continue;
                                    }
                                    else
                                    {
                                        int returnValue = AppEnv.Insert(contentInfo);
                                    }
                                }
                            }
                            catch (Exception)
                            {
                                int returnValue = AppEnv.Insert(contentInfo);
                            }
                        }

                        #endregion

                        i++;

                        totalSize += totalSizeTemp;
                        //}

                        string physicalPath = AppEnv.GetSetting("phyPath") + DateTime.Now.Year + "\\" + DateTime.Now.Month + "\\" + DateTime.Now.Day + "\\";

                        #region Download Image

                        if (listImage != null && listImage.Count > 0)
                        {
                            int totalImage = 0;
                            foreach (ObjectImage item in listImage)
                            {
                                Image image = DownloadImage(item.Link);

                                if (image != null)
                                {
                                    if (!Directory.Exists(physicalPath))
                                    {
                                        Directory.CreateDirectory(physicalPath);
                                    }

                                    image.Save(physicalPath + item.ImageName, ImageFormat.Jpeg);
                                    totalImage++;
                                }
                            }
                        }


                        #endregion

                        _logger.Info(string.Format("Finished mining with source = {0}", record.Source) + Environment.NewLine);
                        //}
                    }
                    return(html);
                }
                else
                {
                    return("");
                }
            }
            else
            {
                return("");
            }
        }
Example #7
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);

            telCo = Session["telco"].ToString();

            price      = ConfigurationSettings.AppSettings.Get("bongdathangprice");
            linkStr    = "<a href=\"../" + UrlProcess.GetSportHomeUrl(lang, "home", width.ToString()).Replace("~/", "") + "\" >BÓNG ĐÁ<a>";
            linkStr_KD = "<a href=\"../" + UrlProcess.GetSportHomeUrl(lang, "home", width.ToString()).Replace("~/", "") + "\" >BONG DA<a>";

            chitietGiaodich = "Bong da: thue bao ngay -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);

            if (!IsPostBack)
            {
                if (width == 0)
                {
                    width = (int)Constant.DefaultScreen.Standard;
                }
                ltrWidth.Text = "<meta content=\"width=" + width + "; 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
                {
                    pnlThongBao.Visible = false;
                    switch (Session["telco"].ToString())
                    {
                    case "Vietnamobile":
                        Library.VNMCharging.VNMChargingGW charging = new Library.VNMCharging.VNMChargingGW();

                        messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "GAME87", "dangkythethao");

                        if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))    //Not Enough Money
                        {
                            messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "GAME87", "dangkythethao", out logPrice);
                            price         = logPrice;
                        }

                        if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                        {
                            messageReturn = AppEnv.VnmChargingSystemOverload(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "GAME87", "dangkythethao");
                        }

                        if (!string.IsNullOrEmpty(messageReturn) && messageReturn == "1")
                        {    // Thanh toán thành công >> trả nội dung
                            WapController.W4A_Subscriber_Insert(Session["msisdn"].ToString(), 2, 1, "wap4a");
                            HienThiNoiDung(true);
                        }
                        else
                        {    // Thanh toán không thành công >> thông báo lỗi
                            HienThiNoiDung(false);
                        }
                        break;
                    }
                }
            }
        }
Example #8
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);

            info = XosoController.GetInfobyCompanyID(ConvertUtility.ToInt32(id));

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

                if (Session["msisdn"] != null)
                {
                    pnlThongBao.Visible = true;
                    if (lang == "1")
                    {
                        ltrTitle.Text           = "Thống kê cặp số";
                        ltrThongBao.Text        = "Giới thiệu";
                        ltrThongBaoNoiDung.Text = "Cung cấp dự đoán kết quả  xổ số <b> " + info.Rows[0]["company_name"].ToString().Replace("XS", "") + " </b> nhanh chóng, chính xác, thuận tiện. Tư vấn và nhận định cặp số sẽ về trong ngày hiện tại.Đăng ký một lần nhận tin mãi mãi <br/> Miễn phí 7 lần trả KQ đầu tiên";
                    }
                    else
                    {
                        ltrTitle.Text           = "Thong ke cap so";
                        ltrThongBao.Text        = "Gioi Thieu";
                        ltrThongBaoNoiDung.Text =
                            "Cung cap du doan ket qua xo so <b> " + AppEnv.CheckLang(info.Rows[0]["company_name"].ToString().Replace("XS", "")) + " </b> nhanh chong, chinh xac, thuan tien. Ket qua se duoc gui ngay toi khach hang sau khi mo thuong. Dang ky mot lan nhan tin mai mai <br/> Mien phi 7 lan tra KQ dau tien";
                    }
                }
                else
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = "Thống kê cặp số";
                        ltrSMS.Text      = "Hệ thống không xác định được số điện thoại của bạn. Vui lòng truy cập bằng <b> 3G/GPRS </b> hoặc : <br/> SOẠN TIN :  <b> DK SC " + info.Rows[0]["company_comment"] + " </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                    }
                    else
                    {
                        ltrHuongdan.Text = "Thong ke cap so";
                        ltrSMS.Text      = "He thong khong xac dinh duoc so dien thoai cua ban. Vui long truy cap bang <b> 3G/GPRS </b> hoac : <br/> SOAN TIN : <b> DK SC " + AppEnv.CheckLang(info.Rows[0]["company_comment"].ToString()) + " </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                    }
                }
            }
        }
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            string comcode = XosoController.GetInfobyCompanyID(id).Rows[0]["company_comment"].ToString();
            string comname = XosoController.GetInfobyCompanyID(id).Rows[0]["company_name"].ToString();

            string chitietGiaodich = "KQXS 20 ngày: " + comname + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);

            if (thuchien)
            {
                //insertMT
                mt              = new MTInfo();
                mt.User_ID      = Session["msisdn"].ToString();
                mt.Message      = "Ban da dang ky thanh cong dich vu lay ket qua xo so 20 ngay lien tiep tinh " + comname + ". Cam on ban da su dung dich vu!";
                mt.Service_ID   = AppEnv.GetSetting("xs20commandcode");
                mt.Command_Code = AppEnv.GetSetting("xs20code");
                mt.Message_Type = (int)Constant.MessageType.FREE;
                Random random = new Random();
                mt.Request_ID    = random.Next(100000000, 999999999).ToString();
                mt.Total_Message = 1;
                mt.Message_Index = 0;
                mt.IsMore        = 0;
                mt.Content_Type  = 0;
                mt.ServiceType   = 50;//servicetype of kq 20;
                MTController.SmsMtInsert(mt);

                //insert mt waitting
                mtwaitting               = new MTWaittingInfo();
                mtwaitting.User_ID       = Session["msisdn"].ToString();
                mtwaitting.Message       = AppEnv.GetSetting("xs20code") + " " + comcode;
                mtwaitting.Service_ID    = AppEnv.GetSetting("xs20commandcode");
                mtwaitting.Command_Code  = AppEnv.GetSetting("xs20code");
                mtwaitting.Message_Type  = (int)Constant.MessageType.FREE;
                mtwaitting.Request_ID    = random.Next(100000000, 999999999).ToString();
                mtwaitting.Total_Message = 20;
                mtwaitting.Message_Index = 1;
                mtwaitting.IsMore        = 0;
                mtwaitting.Content_Type  = 0;
                mtwaitting.ServiceType   = 50;//dv  ket qua 30 ngay
                mtwaitting.UniqueId      = comcode;
                mtwaitting.ExpiredDate   = DateTime.Now.AddDays(20);
                mtwaitting.PartnerID     = string.Empty;
                mtwaitting.Operator      = Session["telco"].ToString();
                MTController.SMS_MTXSWaittingInsert(mtwaitting);
                //
                //if (lang == "1")
                //{
                ltrTieuDe.Text  = linkStr;
                lblTen.Text     = "Xổ số 20 ngày liên tiếp";
                ltrNoiDung.Text = "Bạn đã đăng ký thành công dịch vụ lấy kết quả xổ số 20 ngày liên tiếp tỉnh " + comname + ".<br />Cảm ơn bạn đã sử dụng dịch vụ!";
                //}
                //else
                //{
                //    ltrTieuDe.Text = linkStr_KD;
                //    lblTen.Text = "Xo so 20 ngay lien tiep";
                //    ltrNoiDung.Text = "Ban da dang ky thanh cong dich vu lay ket qua xo so 20 ngay lien tiep tinh " + comname + ".<br />Cam on ban da su dung dich vu!";
                //}
                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 12);
            }
            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;
                //}

                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 12, messageReturn);

                //--Thông báo lỗi thanh toán
            }

            //log charging
            ILog logger = LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN:" + Session["msisdn"]);
            logger.Debug("Dich vu: Xo so - Ket qua 20 ngay - parameter: " + price + " - Tinh: " + comname + " - id: " + id);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
Example #10
0
        protected void Page_Load(object sender, EventArgs e)
        {
            preurl = AppEnv.GetSetting("urldata");
            width  = Request.QueryString["w"];
            lang   = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            hotro  = ConvertUtility.ToInt32(Request.QueryString["hotro"]);
            //hotro = 1;

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

            int totalrecord = 0;

            if (Session["serviceList"] != null)
            {
                _arrService = Session["serviceList"] as string[];
            }

            if (_arrService != null)
            {
                if (_arrService.Length > 0)
                {
                    string dkGame = string.Format(AppEnv.GetSetting("S2DK_Game"));
                    foreach (var item in _arrService)
                    {
                        if (item == dkGame)
                        {
                            pnlS2DkGame1.Visible = false;
                            pnlS2DkGame2.Visible = false;
                        }
                    }
                }
            }

            #region Tai Nhieu Nhat

            //Tải nhiều nhất
            //if (hotro == 1)
            //{
            //    rptTaiNhieuNhat.DataSource = GameController.GetAllGameByCateTypeAndAgent(Session["telco"].ToString(), 15, (int)Constant.Game.Topdownload, _info, pagesize, curpage, out totalrecord);
            //}
            //else
            //{
            //    rptTaiNhieuNhat.DataSource = GameController.GetAllGameByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 15, (int)Constant.Game.Topdownload, pagesize, curpage, out totalrecord);
            //}

            var dtTaiNhieuNhat = new DataTable();
            dtTaiNhieuNhat = GameController.GetAllGameByCateTypeAndAgent(Session["telco"].ToString(), 15, (int)Constant.Game.Topdownload, _info, pagesize, curpage, out totalrecord);
            if (dtTaiNhieuNhat.Rows.Count == 0)
            {
                dtTaiNhieuNhat = GameController.GetAllGameByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 15, (int)Constant.Game.Topdownload, pagesize, curpage, out totalrecord);
            }

            rptTaiNhieuNhat.DataSource     = dtTaiNhieuNhat;
            rptTaiNhieuNhat.ItemDataBound += rptTaiNhieuNhat_ItemDataBound;
            rptTaiNhieuNhat.DataBind();

            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&tpage=" + Request.QueryString["tpage"] + "&hotro=" + Request.QueryString["hotro"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&tpage=" + Request.QueryString["tpage"] + "&hotro=" + Request.QueryString["hotro"] + "&cpage=";

            #endregion

            #region Moi Cap Nhat

            //if (hotro == 1)
            //{
            //    rptMoiCapNhat.DataSource = GameController.GetAllGameByCateTypeAndAgent(Session["telco"].ToString(), 16, (int)Constant.Game.Lastest, _info, pagesize, curpage, out totalrecord);
            //}
            //else
            //{
            //    rptMoiCapNhat.DataSource = GameController.GetAllGameByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 16, (int)Constant.Game.Lastest, pagesize, tpage, out totalrecord);
            //}
            var dtMoiCapNhat = new DataTable();
            dtMoiCapNhat = GameController.GetAllGameByCateTypeAndAgent(Session["telco"].ToString(), 16, (int)Constant.Game.Lastest, _info, pagesize, curpage, out totalrecord);
            if (dtMoiCapNhat.Rows.Count == 0)
            {
                dtMoiCapNhat = GameController.GetAllGameByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 16, (int)Constant.Game.Lastest, pagesize, tpage, out totalrecord);
            }

            rptMoiCapNhat.DataSource     = dtMoiCapNhat;
            rptMoiCapNhat.ItemDataBound += rptMoiCapNhat_ItemDataBound;
            rptMoiCapNhat.DataBind();

            Paging2.totalrecord  = totalrecord;
            Paging2.pagesize     = pagesize;
            Paging2.numberpage   = pagenumber;
            Paging2.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=" + Request.QueryString["cpage"] + "&hotro=" + Request.QueryString["hotro"];
            Paging2.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=" + Request.QueryString["cpage"] + "&hotro=" + Request.QueryString["hotro"] + "&tpage=";

            #endregion
        }
Example #11
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);

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

                pnlSMS.Visible = true;

                if (Session["msisdn"] != null)
                {
                    string   value = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", "DK TR");//ANDY Service S2_94x
                    string[] res   = value.Split('|');
                    if (res.Length > 0)
                    {
                        ltrHuongdan.Text = lang == "1"
                                ? "Đọc Truyện"
                                : "Doc Truyen";

                        if (res[0] == "1")//DK THANH CONG
                        {
                            ltrSMS.Text = lang == "1"
                                       ? "Bạn đã đăng ký thành công. Miễn phí trong 7 ngày đầu đăng ký. Truyện sẽ được gửi vào thứ 2 và thứ 5 hàng tuần <br/> Để hủy dịch vụ soạn: <b> HUY TR </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                       : "Ban da dang ky thanh cong. Mien phi trong 7 ngay dau dang ky. Truyen se duoc gui vao thu 2 va thu 5 hang tuan <br/> De huy dich vu soan: <b> HUY TR </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                        }
                        else
                        {
                            if (res[1].Trim() == "DoubleRegister")
                            {
                                ltrSMS.Text = lang == "1"
                                    ? "Bạn đã là thuê bao của dịch vụ Đọc truyện. Xin cảm ơn <br/> Để hủy dịch vụ soạn tin : <b> HUY TR </b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>"
                                    : "Ban da la thue bao cua dich vu Đọc truyện. Xin cam on <br/> De huy dich vu soan tin : <b> HUY TR </b> gui <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                            }
                            else
                            {
                                ltrSMS.Text = AppEnv.GetSetting("VNM_DangKyThatBai_Mt");
                            }
                        }
                    }
                }
                else
                {
                    ltrHuongdan.Text = lang == "1"
                                           ? "Giới Thiệu"
                                           : "Gioi Thieu";

                    ltrSMS.Text = lang == "1"
                                     ? "Dịch vụ Đọc Truyện cực HOT. Đăng ký một lần nhận tin mãi mãi <br/> Để đăng ký soạn tin: <b> DK TR </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                     : "Dich vu Doc Truyen cuc HOT. Dang ky mot lan nhan tin mai mai <br/> De dang ky soan tin: <b> DK TR </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            price   = ConfigurationSettings.AppSettings.Get("videoprice");
            lang    = Request.QueryString["lang"];
            width   = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id      = ConvertUtility.ToInt32(Request.QueryString["id"]);
            SoDT    = Request.QueryString["sdt"];
            telCo   = Session["telco"].ToString();
            linkStr = linkStr_KD = "<a href=\"../" + UrlProcess.GetVideoHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >VIDEO<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\" />";

                //Nếu số điện thoại không hợp lệ thì hướng dẫn
                if (!MobileUtils.IsMobileNumber(SoDT))
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = Resources.Resource.wSoDienThoaiKhongHopLe;
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = Resources.Resource.wSoDienThoaiKhongHopLe_KD;
                    }
                    return;
                }

                DataTable dtDetail = VideoController.GetVideoDetailByID(Session["telco"].ToString(), id);
                if (telCo == "Undefined")
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("videocode") + " " + dtDetail.Rows[0]["VID"].ToString() + " " + SoDT + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("videocommandcode") + "</b> để gửi tặng video <b>" + dtDetail.Rows[0]["VTitle_Unicode"].ToString() + "</b>" + Resources.Resource.wChon3G;
                    }
                    else
                    {
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan_KD;
                        ltrSMS.Text      = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("videocode") + " " + dtDetail.Rows[0]["VID"].ToString() + " " + SoDT + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("videocommandcode") + "</b> de gui tang video <b>" + dtDetail.Rows[0]["VTitle"].ToString() + "</b>" + Resources.Resource.wChon3G_KD;
                    }
                }
                else
                {
                    pnlThongBao.Visible = false;
                    switch (Session["telco"].ToString())
                    {
                    case "Vietnamobile":
                        var charging = new Library.VNMCharging.VNMChargingGW();

                        messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", Request.QueryString["id"]);

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

                        if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                        {
                            messageReturn = AppEnv.VnmChargingSystemOverload(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", Request.QueryString["id"]);
                        }

                        if (messageReturn == "1")
                        {    // Thanh toán thành công >> trả nội dung
                            HienThiNoiDung(true);
                        }
                        else
                        {    // Thanh toán không thành công >> thông báo lỗi
                            HienThiNoiDung(false);
                        }
                        break;
                    }
                }
            }
        }
Example #13
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);

            madichvu = Request.QueryString["t"];
            madichvu = madichvu.ToUpper().Trim();

            //int votePrice = 2000;
            price = "5000";

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

                if (Session["msisdn"] == null)
                {
                    int    is3g   = 0;
                    string msisdn = MobileUtils.GetMSISDN(out is3g);
                    if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
                    {
                        Session["telco"]  = Constant.T_Vietnamobile;
                        Session["msisdn"] = msisdn;
                        litMsisdn.Text    = "Xin chào <b>" + msisdn + "</b>";
                    }
                    else
                    {
                        Session["msisdn"] = null;
                        Session["telco"]  = Constant.T_Undefined;
                        litMsisdn.Text    = "Xin chào <b>khách</b>";
                    }
                }

                string messageReturn;
                int    votePersonId = 1;

                if (Session["msisdn"] != null)
                {
                    #region Xu Ly Charging

                    var charging = new Library.VNMCharging.VNMChargingGW();



                    //if (AppEnv.GetSetting("TestFlag") == "1")
                    //{
                    //    messageReturn = "1";
                    //}
                    //else
                    //{
                    //messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price.ToString(), "D", "VID", "Vote " + madichvu);
                    //}

                    //var charging = new Library.VNMCharging.VNMChargingGW();

                    messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", "Vote " + madichvu);

                    if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))//Not Enough Money
                    {
                        messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", "Vote " + madichvu, out logPrice);
                        price         = logPrice;
                    }

                    //pnlSMS.Visible = false;
                    //pnlThongBao.Visible = false;
                    //pnlNoiDung.Visible = true;

                    if (messageReturn == "1")//Charged Thanh Cong
                    {
                        int    disLike         = 0;
                        int    dislikePersonId = 1;
                        string personName      = "";

                        if (madichvu == "VOTE1")
                        {
                            votePersonId = 1;
                            disLike      = 0;
                            personName   = "Mai Thỏ";
                        }
                        else if (madichvu == "VOTE2")
                        {
                            votePersonId = 2;
                            disLike      = 0;
                            personName   = "Linh Miu";
                        }
                        else if (madichvu == "GACH1")
                        {
                            votePersonId    = 2;
                            dislikePersonId = 1;
                            disLike         = 1;
                            personName      = "Mai Thỏ";
                        }
                        else if (madichvu == "GACH2")
                        {
                            votePersonId    = 1;
                            dislikePersonId = 2;
                            disLike         = 1;
                            personName      = "Linh Miu";
                        }

                        var entity = new VoteRegisteredInfo();
                        entity.User_ID              = Session["msisdn"].ToString();
                        entity.Request_ID           = "0";
                        entity.Service_ID           = "8279";
                        entity.Command_Code         = madichvu;
                        entity.Service_Type         = 1;
                        entity.Charging_Count       = 0;
                        entity.FailedChargingTime   = 0;
                        entity.RegisteredTime       = DateTime.Now;
                        entity.ExpiredTime          = DateTime.Now.AddDays(1);
                        entity.Registration_Channel = "WAP";
                        entity.Status     = 1;
                        entity.Operator   = "vnmobile";
                        entity.Vote_Count = 1;

                        entity.Vote_PersonId    = votePersonId;
                        entity.IsDislike        = disLike;
                        entity.Dislike_Count    = 1;
                        entity.Dislike_PersonId = dislikePersonId;

                        if (madichvu == "VOTE1" || madichvu == "VOTE2")
                        {
                            DataTable dt = WapController.VoteRegisterInsert(entity);
                            if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//DK DICH VU LAN DAU
                            {
                                litThongBao.Text = "Chúc mừng bạn đã đăng ký thành công Gameshow 'Hẹn hò cùng thần tượng'.<br /> Hãy vote cho " + personName + " để trở thành người chiến thắng.<br /> Chi tiết truy cập http://wap.vietnamobile.com.vn. HT: 19001255";
                            }
                            else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                            {
                                //litThongBao.Text = "Bạn đã vote thành công cho " + personName + ".<br /> Vote càng nhiều bạn càng có cơ hội là 1 trong 3 người hẹn hò thần tượng.<br /> Soạn: Vote1 gửi 8279 để gặp Mai Thỏ. Soạn: Vote2 gửi 8279 để gặp Linh Miu<br /> Chi tiết truy cập: http://wap.vietnamobile.com.vn. HT: 19001255";

                                //DataTable dtVoteInfo = WapController.VoteGetCount(Session["msisdn"].ToString(), madichvu);
                                //if (dtVoteInfo.Rows[0]["Count"].ToString() == "0")
                                //{
                                int revotePersonId = 0;
                                if (madichvu == "VOTE2")
                                {
                                    revotePersonId = 2;
                                }
                                else if (madichvu == "VOTE1")
                                {
                                    revotePersonId = 1;
                                }
                                DataTable dtVoteInfo = WapController.VoteGetCountByPersonId(Session["msisdn"].ToString(), revotePersonId);
                                //}

                                litThongBao.Text = "Bạn đã vote thành công cho : " + dtVoteInfo.Rows[0]["Name"] + ".<br /> Số lượt vote của bạn : " + dtVoteInfo.Rows[0]["Count"] + "<br /> Bạn đang thuộc top : " + dtVoteInfo.Rows[0]["Top"] + " những người vote nhiều nhất <br /> Vote càng nhiều bạn càng có cơ hội là 1 trong 4 người hẹn hò thần tượng.<br /> Chi tiết truy cập: http://wap.vietnamobile.com.vn. HT: 19001255";
                            }
                        }
                        else if (madichvu == "GACH1" || madichvu == "GACH2")
                        {
                            DataTable dtDislike = WapController.VoteRegisterDislikeInsert(entity);
                            DataTable dt        = WapController.VoteRegisterInsert(entity);
                            if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//DK DICH VU LAN DAU
                            {
                                litThongBao.Text = "Chúc mừng bạn đã đăng ký thành công Gameshow 'Hẹn hò cùng thần tượng'.<br /> Hãy ném gạch " + personName + " mà bạn không thích để trở thành người chiến thắng.<br /> Chi tiết truy cập: http://wap.vietnamobile.com.vn. HT: 19001255";
                            }
                            else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                            {
                                //litThongBao.Text = "Bạn đã Ném gạch " + personName + " thành công.<br /> Ném gạch càng nhiều bạn có cơ hội là 1 trong 3 người hẹn hò thần tượng.<br /> Soạn: Gach1 gửi 8279 để gặp gỡ Linh Miu. Soạn: Gach2 gửi 8279 để gặp Mai Thỏ .<br /> Chi tiết truy cập:  http://wap.vietnamobile.com.vn. HT: 19001255";

                                DataTable dtGachInfo = WapController.VoteGetCount(Session["msisdn"].ToString(), madichvu);
                                litThongBao.Text = "Bạn đã ném gạch " + dtGachInfo.Rows[0]["Name"] + " thành công .<br />Số Gạch của bạn : " + dtGachInfo.Rows[0]["Count"] + "<br /> Bạn đang thuộc top: " + dtGachInfo.Rows[0]["Top"] + " những người Ném Gạch nhiều nhất <br />Ném Gạch càng nhiều bạn càng có cơ hội là 1 trong 4 người hẹn hò thần tượng.<br /> Chi tiết truy cập : http://wap.vietnamobile.com.vn. HT: 19001255";
                            }
                        }

                        //#region Log Doanh Thu

                        //var eLog = new VoteChargedUserLogInfo();

                        //eLog.User_ID = Session["msisdn"].ToString(); ;
                        //eLog.Request_ID = "0";
                        //eLog.Service_ID = "8279";
                        //eLog.Command_Code = madichvu;
                        //eLog.Service_Type = 1;
                        //eLog.Charging_Count = 0;
                        //eLog.FailedChargingTime = 0;
                        //eLog.RegisteredTime = DateTime.Now;
                        //eLog.ExpiredTime = DateTime.Now.AddDays(1);
                        //eLog.Registration_Channel = "WAP";
                        //eLog.Status = 1;
                        //eLog.Operator = "vnmobile";
                        //eLog.Reason = "Succ";
                        //eLog.Price = 2000;
                        //eLog.Vote_PersonId = votePersonId;

                        //WapController.VoteChargedUserLogInsert(eLog);

                        //#endregion
                    }
                    else
                    {
                        litThongBao.Text = lang == "1" ? "Đăng ký không thành công. Vui lòng thử loại hoặc tài khoản không đủ tiền" : "Dang ky khong thanh cong. Vui long thu lai hoac tai khoan khong du tien";
                    }

                    #region Log Doanh Thu

                    var eLog = new VoteChargedUserLogInfo();

                    eLog.User_ID              = Session["msisdn"].ToString();;
                    eLog.Request_ID           = "0";
                    eLog.Service_ID           = "8279";
                    eLog.Command_Code         = madichvu;
                    eLog.Service_Type         = 1;
                    eLog.Charging_Count       = 0;
                    eLog.FailedChargingTime   = 0;
                    eLog.RegisteredTime       = DateTime.Now;
                    eLog.ExpiredTime          = DateTime.Now.AddDays(1);
                    eLog.Registration_Channel = "WAP";
                    eLog.Status   = 1;
                    eLog.Operator = "vnmobile";

                    if (messageReturn == "1")
                    {
                        eLog.Reason = "Succ";
                    }
                    else
                    {
                        eLog.Reason = messageReturn;
                    }

                    eLog.Price         = ConvertUtility.ToInt32(price);
                    eLog.Vote_PersonId = votePersonId;

                    WapController.VoteChargedUserLogInsert(eLog);

                    #endregion

                    #endregion
                }
                else
                {
                    if (madichvu == "VOTE1" || madichvu == "VOTE2" || madichvu == "GACH1" || madichvu == "GACH2")
                    {
                        litThongBao.Text = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS<br /> Hoặc soạn tin: " + madichvu + " gửi " + "8279";;
                    }
                    else
                    {
                        litThongBao.Text = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS";
                    }

                    //litThongBao.Text = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS <br /> Hoặc soạn tin: " + madichvu + " gửi " + "8279";

                    //pnlSMS.Visible = true;
                    //if (lang == "1")
                    //{
                    //    ltrHuongdan.Text = "Thông Báo";
                    //    ltrSMS.Text = "Hệ thống không xác định được số điện thoại của bạn. Vui lòng truy cập bằng 3G/GPRS hoặc soạn tin: " + madichvu + " gửi " + "8279";
                    //}
                    //else
                    //{
                    //    ltrHuongdan.Text = "Thong Bao";
                    //    ltrSMS.Text =
                    //        "He thong khong xac dinh duoc so dien thoai cua ban. Vui long truy cap bang 3G/GPRS hoac soan tin " + madichvu + " gui " + "8279";
                    //}
                }

                DataSet dsMt = WapController.GetTopUserVote(1);
                DataSet dsLm = WapController.GetTopUserVote(2);

                //DataTable dtMt = WapController.GetTopUserVote(1);
                //DataTable dtLm = WapController.GetTopUserVote(2);

                if (dsMt != null && dsMt.Tables[0].Rows.Count > 0)
                {
                    rptMaiTho.DataSource = dsMt.Tables[0];
                    rptMaiTho.DataBind();

                    lblMtLike.Text   = dsMt.Tables[1].Rows[0]["Like"].ToString();
                    lblMtUnLike.Text = dsMt.Tables[2].Rows[0]["UnLike"].ToString();
                }

                if (dsLm != null && dsLm.Tables[0].Rows.Count > 0)
                {
                    rptLinhMiu.DataSource = dsLm.Tables[0];
                    rptLinhMiu.DataBind();

                    lblLmLike.Text   = dsLm.Tables[1].Rows[0]["Like"].ToString();
                    lblLmUnLike.Text = dsLm.Tables[2].Rows[0]["UnLike"].ToString();
                }

                #region FACEBOOK Comment

                string url = AppEnv.GetSetting("WapDefault") + "/vote.aspx";

                ltCommentFB.Text = "<div class=\"fb-comments\" data-mobile=\"false\" data-href='" + url + "' data-width=\"320\" data-num-posts=\"5\"></div>";

                string Facebook_raw_data = get_web_content("http://api.facebook.com/restserver.php?method=links.getStats&urls=" + url);

                XmlDocument dom = new XmlDocument();
                dom.LoadXml(Facebook_raw_data);

                #endregion
            }
        }
Example #14
0
 private bool CheckConfirm()
 {
     return(ConvertUtility.ToInt32(AppEnv.GetSetting("CheckConfirm")) == 1 ? true : false);
 }
Example #15
0
        protected void Page_Load(object sender, EventArgs e)
        {
            width = Request.QueryString["w"];
            lang  = ConvertUtility.ToInt32(Request.QueryString["lang"]);
            if (!string.IsNullOrEmpty(Request.QueryString["cpage"]))
            {
                curpage = ConvertUtility.ToInt32(Request.QueryString["cpage"]);
            }
            if (!string.IsNullOrEmpty(Request.QueryString["tpage"]))
            {
                tpage = ConvertUtility.ToInt32(Request.QueryString["tpage"]);
            }
            int totalrecord = 0;

            if (lang == 0)
            {
                litGia.Text          = "(Gia: " + AppEnv.GetSetting("wallprice") + " d/hinh nen)";
                litTaiNhieuNhat.Text = Resources.Resource.wTaiNhieuNhat_KD;
                litMoiCapNhat.Text   = Resources.Resource.wMoiCapNhat_KD;
            }
            else
            {
                litGia.Text          = "(Giá: " + AppEnv.GetSetting("wallprice") + " đ/hình nền)";
                litTaiNhieuNhat.Text = Resources.Resource.wTaiNhieuNhat;
                litMoiCapNhat.Text   = Resources.Resource.wMoiCapNhat;
            }

            //Tải nhiều nhất
            DataTable dtHottest = HinhNenController.GetAllWallpaperByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 4, (int)Constant.HinhNen.Topdownload, pagesize, curpage, out totalrecord);

            if (dtHottest.Rows.Count > 3)
            {
                DataSet ds = ConvertUtility.SplitDataTable(dtHottest, 3);

                rptTaiNhieuNhat1.DataSource = ds.Tables[0];
                rptTaiNhieuNhat1.DataBind();

                rptTaiNhieuNhat11.DataSource = ds.Tables[0];
                rptTaiNhieuNhat11.DataBind();

                rptTaiNhieuNhat2.DataSource = ds.Tables[1];
                rptTaiNhieuNhat2.DataBind();

                rptTaiNhieuNhat22.DataSource = ds.Tables[1];
                rptTaiNhieuNhat22.DataBind();
            }
            else
            {
                rptTaiNhieuNhat1.DataSource = dtHottest;
                rptTaiNhieuNhat1.DataBind();

                rptTaiNhieuNhat11.DataSource = dtHottest;
                rptTaiNhieuNhat11.DataBind();
            }

            Paging1.totalrecord  = totalrecord;
            Paging1.pagesize     = pagesize;
            Paging1.numberpage   = pagenumber;
            Paging1.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&tpage=" + Request.QueryString["tpage"];
            Paging1.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&tpage=" + Request.QueryString["tpage"] + "&cpage=";

            //Mới nhất
            DataTable dtLatest = HinhNenController.GetAllWallpaperByCategoryAndDisplayTypeHasCache(Session["telco"].ToString(), 2, (int)Constant.HinhNen.Lastest, pagesize, tpage, out totalrecord);

            if (dtLatest.Rows.Count > 3)
            {
                DataSet ds = ConvertUtility.SplitDataTable(dtLatest, 3);

                rptMoiCapNhat1.DataSource = ds.Tables[0];
                rptMoiCapNhat1.DataBind();

                rptMoiCapNhat11.DataSource = ds.Tables[0];
                rptMoiCapNhat11.DataBind();

                rptMoiCapNhat2.DataSource = ds.Tables[1];
                rptMoiCapNhat2.DataBind();

                rptMoiCapNhat22.DataSource = ds.Tables[1];
                rptMoiCapNhat22.DataBind();
            }
            else
            {
                rptMoiCapNhat1.DataSource = dtLatest;
                rptMoiCapNhat1.DataBind();

                rptMoiCapNhat11.DataSource = dtLatest;
                rptMoiCapNhat11.DataBind();
            }

            Paging2.totalrecord  = totalrecord;
            Paging2.pagesize     = pagesize;
            Paging2.numberpage   = pagenumber;
            Paging2.defaultparam = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=" + Request.QueryString["cpage"];
            Paging2.queryparam   = "?lang=" + Request.QueryString["lang"] + "&display=" + Request.QueryString["display"] + "&w=" + Request.QueryString["w"] + "&cpage=" + Request.QueryString["cpage"] + "&tpage=";
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            lang    = Request.QueryString["lang"];
            width   = ConvertUtility.ToInt32(Request.QueryString["w"]);
            price   = AppEnv.GetSetting("xs20price");
            id      = ConvertUtility.ToInt32(Request.QueryString["id"]);
            telCo   = AppEnv.CheckSessionTelco();
            linkStr = "<a href=\"" + UrlProcess.XoSoHome() + "\" >XỔ SỐ</a>";
            //linkStr_KD = "<a href=\"../" + UrlProcess.GetXosoHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >XO SO<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\" />";

                DataTable ds      = XosoController.GetInfobyCompanyID(id);
                string    comname = ds.Rows[0]["company_name"].ToString();

                // Nếu có transactionid_old >> thuê bao mobifone đã thực hiện thanh toán
                if (Session["transactionid_old"] != null)
                {
                    messageReturn = ConvertUtility.ToString(Session["debit_status"]);
                    if (ConvertUtility.ToString(Session["debit_status"]) == "0")
                    {// Thanh toán thành công >> trả nội dung
                        HienThiNoiDung(true);
                    }
                    else
                    {// Thanh toán không thành công >> thông báo lỗi
                        HienThiNoiDung(false);
                    }
                    Session["transactionid_old"] = null;
                }
                else
                {
                    if (telCo == Constant.T_Mobifone)
                    {
                        string content = Session["cpid"].ToString() + "&" + Constant.xoso + "x12" + id.ToString() + "&" + price + "&" + Session["transactionid"];
                        Response.Redirect(AppEnv.GetSetting("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, AppEnv.GetSetting("vmskey"))));
                    }
                    //
                    if (telCo == "Undefined")
                    {
                        pnlSMS.Visible = true;
                        //if (lang == "1")
                        //{
                        ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                        ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("xs20code") + " " + ds.Rows[0]["company_comment"] + "</b> gửi <b>" + AppEnv.GetSetting("xs20commandcode") + "</b> để nhận kết quả 20 phiên mở thưởng liên tiếp" + Resources.Resource.wChon3G;
                        //}
                        //else
                        //{
                        //    ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                        //    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("xs20code") + " " + ds.Rows[0]["company_comment"] + "</b> gui <b>" + AppEnv.GetSetting("xs20commandcode") + "</b> de nhan ket qua 20 phien mo thuong lien tiep" + Resources.Resource.wChon3G_KD;
                        //}
                    }
                    else
                    {
                        pnlThongBao.Visible = false;
                        switch (Session["telco"].ToString())
                        {
                        case "Vietnamobile":
                            var charging = new Library.VNMCharging.VNMChargingGW();

                            messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "GAMEDOWN", "GAME_DOWN", price, "D", "XOSO20", Request.QueryString["id"]);

                            if (!string.IsNullOrEmpty(messageReturn) && messageReturn == "1")
                            {    // Thanh toán thành công >> trả nội dung
                                HienThiNoiDung(true);
                            }
                            else
                            {    // Thanh toán không thành công >> thông báo lỗi
                                HienThiNoiDung(false);
                            }
                            break;
                        }
                    }
                }
            }
        }
Example #17
0
    public int Execute(int jobID)
    {
        WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g();
        string userName = "******";
        string userPass = "******";
        string cpId     = "1930";
        string price    = "4000";

        try
        {
            DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameUserByType(false);
            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                string message        = string.Empty;
                string returnValue    = string.Empty;
                string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

                string serviceType = "Charge Hero";
                string serviceName = "ViSport_Hero";
                string reasonLog   = string.Empty;

                for (int i = 0; i < dtUsers.Rows.Count; i++)
                {
                    try
                    {
                        #region TIEN HANH CHARGED

                        price       = "5000";
                        returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                        if (returnValue.Trim() == notEnoughMoney)
                        {
                            price       = "3000";
                            returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                            if (returnValue.Trim() == notEnoughMoney)
                            {
                                price       = "2000";
                                returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                                if (returnValue.Trim() == notEnoughMoney)
                                {
                                    price       = "1000";
                                    returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                                }
                            }
                        }

                        if (returnValue == "1")
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = "Succ";

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }
                        else
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = returnValue;

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }

                        if (returnValue == "1")//CHARGED THANH CONG
                        {
                            #region SEND MT CHO USER

                            //SEND MT CHO KHACH HANG

                            DataTable dtQuestion = ViSport_S2_Registered_UsersController.GetQuestionInfoSportGameHero();
                            if (dtQuestion != null && dtQuestion.Rows.Count > 0)
                            {
                                message = dtQuestion.Rows[0]["Question"].ToString();

                                int    questionIdnew = ConvertUtility.ToInt32(dtQuestion.Rows[0]["Id"].ToString());
                                string answer        = dtQuestion.Rows[0]["Answer"].ToString();

                                string serviceId   = dtUsers.Rows[i]["Service_ID"].ToString();
                                string commandCode = dtUsers.Rows[i]["Command_Code"].ToString();
                                string requestId   = dtUsers.Rows[i]["Request_ID"].ToString();


                                ViSport_S2_Registered_UsersController.InsertSportGameHeroAnswerLog(dtUsers.Rows[i]["User_ID"].ToString(), questionIdnew, message, answer, DateTime.Now, 0); // LUU LOG Question
                                SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message, serviceId, commandCode, requestId);
                            }

                            //END SEND MT CHO KHACH HANG

                            #endregion
                        }

                        #endregion
                    }
                    catch (Exception ex)
                    {
                        log.Error("Anh tai bong da Loi charged : " + ex);
                        continue;
                    }
                }
            }

            return(1);
        }
        catch (Exception ex)
        {
            log.Error("Anh tai bong da Loi lay tap User : " + ex);
            return(0);
        }
    }
Example #18
0
    public int Execute(int jobID)
    {
        try
        {
            try
            {
                #region GET USER

                DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameUserByTypeTp(false);
                if (dtUsers != null && dtUsers.Rows.Count > 0)
                {
                    string userName = AppEnv.GetSetting("userName_3g_visport");
                    string userPass = AppEnv.GetSetting("password_3g_visport");
                    string cpId     = AppEnv.GetSetting("cpId_3g_visport");

                    foreach (DataRow dr in dtUsers.Rows)
                    {
                        ViSport_S2_Registered_UsersController.WorldCupUserInsertToAndy(
                            ConvertUtility.ToInt32(dr["Id"].ToString()),
                            dr["User_ID"].ToString(),
                            dr["Request_Id"].ToString(),
                            ConvertUtility.ToInt32(dr["Service_ID"].ToString()),
                            999,
                            5000,
                            cpId,
                            userName,
                            userPass,
                            "http://123.29.67.167:8000/JobSubs/Sport/Notification.asmx"
                            );
                    }
                }

                #endregion
            }
            catch (Exception)
            {
                //Retry lai khi co loi
                #region GET USER

                DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameUserByTypeTp(false);
                if (dtUsers != null && dtUsers.Rows.Count > 0)
                {
                    string userName = AppEnv.GetSetting("userName_3g_visport");
                    string userPass = AppEnv.GetSetting("password_3g_visport");
                    string cpId     = AppEnv.GetSetting("cpId_3g_visport");

                    foreach (DataRow dr in dtUsers.Rows)
                    {
                        ViSport_S2_Registered_UsersController.WorldCupUserInsertToAndy(
                            ConvertUtility.ToInt32(dr["Id"].ToString()),
                            dr["User_ID"].ToString(),
                            dr["Request_Id"].ToString(),
                            ConvertUtility.ToInt32(dr["Service_ID"].ToString()),
                            999,
                            5000,
                            cpId,
                            userName,
                            userPass,
                            "http://123.29.67.167:8000/JobSubs/Sport/Notification.asmx"
                            );
                    }
                }

                #endregion

                //Gui Email Alert
                DoSendMail("*****@*****.**", "", "LOI CHARGED VISPORT", "Visport xuat hien loi charged he thong da retry lai. Vui long kiem tra lai doanh thu");
            }
        }
        catch (Exception ex)
        {
            _log.Error("Visport Loi lay tap User : " + ex);
            return(0);
        }
        return(1);
    }
Example #19
0
        protected void Application_BeginRequest(object sender, EventArgs e)
        {
            string url = Request.Url.AbsolutePath.Remove(0, Request.ApplicationPath.Length);

            url = url.ToLower();
            string[] arrUrl = url.Split('/');

            #region Rewrite 3 DV MOI

            if (url.Contains(Constant.TinTucRewrite))
            {
                #region Tin_Tuc

                string newUrl = "";
                if (arrUrl[0].ToLower() == Constant.TinTucRewrite + ".aspx")
                {
                    newUrl = "/TinHot/Default.aspx?display=home&w=320&lang=1";
                }
                else
                {
                    if (arrUrl.Length == 5)//CHUYEN MUC TIN
                    {
                        newUrl = UrlProcess.GetHotNewsCategoryUrl("1", "320", arrUrl[2], ConvertUtility.ToInt32(arrUrl[3]));
                    }
                    else if (arrUrl.Length == 4)//CHI TIET TIN
                    {
                        newUrl = UrlProcess.GetHotNewsDetailUrl("1", "320", arrUrl[2]);
                    }
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }

                #endregion
            }
            else if (url.Contains(Constant.TinKhuyenMaiRewrite))
            {
                #region Tin_Khuyen_Mai

                string id;
                string newUrl = "";

                if (arrUrl[1].ToLower() == "chuyen-muc")//CHUYEN MUC TIN
                {
                    id     = arrUrl[2];
                    newUrl = UrlProcess.WebNewsCategoryUrl(id);
                }
                else if (arrUrl[1].ToLower() == "chi-tiet")//CHI TIET TIN
                {
                    id     = arrUrl[2];
                    newUrl = UrlProcess.WebNewsDetailUrl(id);
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }

                #endregion
            }
            else if (url.Contains(Constant.GioiTinhRewrite))
            {
                #region Gioi_Tinh

                string newUrl = "";
                if (arrUrl[0].ToLower() == Constant.GioiTinhRewrite + ".aspx")
                {
                    newUrl = "/GioiTinh/Default.aspx?display=home&w=320&lang=1";
                }
                else
                {
                    if (arrUrl.Length == 5)//CHUYEN MUC TIN
                    {
                        //newUrl = UrlProcess.GetHotNewsCategoryUrl("1", "320", arrUrl[2], ConvertUtility.ToInt32(arrUrl[3]));
                        newUrl = "/GioiTinh/Default.aspx?display=list&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                    else if (arrUrl.Length == 4)//CHI TIET TIN
                    {
                        //newUrl = UrlProcess.GetHotNewsDetailUrl("1", "320", arrUrl[2]);
                        newUrl = "/GioiTinh/Default.aspx?display=detail&w=320&lang=1&id=" + arrUrl[2];
                    }
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }

                #endregion
            }
            else if (url.Contains(Constant.TruyenOnlineRewrite))
            {
                #region Truyen_Online

                string newUrl = "";
                if (arrUrl[0].ToLower() == Constant.TruyenOnlineRewrite + ".aspx")
                {
                    newUrl = "/Truyen/Default.aspx?display=home&w=320&lang=1";
                }
                else
                {
                    if (arrUrl.Length == 5)//CHUYEN MUC TIN
                    {
                        //newUrl = UrlProcess.GetHotNewsCategoryUrl("1", "320", arrUrl[2], ConvertUtility.ToInt32(arrUrl[3]));
                        newUrl = "/Truyen/Default.aspx?display=list&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                    else if (arrUrl.Length == 4)//CHI TIET TIN
                    {
                        //newUrl = UrlProcess.GetHotNewsDetailUrl("1", "320", arrUrl[2]);
                        newUrl = "/Truyen/Default.aspx?display=detail&w=320&lang=1&id=" + arrUrl[2];
                    }
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }

                #endregion
            }
            else if (url.Contains(Constant.TruyenAudioRewrite))
            {
                #region MyRegion

                string newUrl = "";
                if (arrUrl[0].ToLower() == Constant.TruyenAudioRewrite + ".aspx")
                {
                    newUrl = "/Truyen/Default.aspx?display=homeaudio&w=320&lang=1";
                }
                else
                {
                    if (arrUrl.Length == 5)//CHUYEN MUC TIN
                    {
                        newUrl = "/Truyen/Default.aspx?display=listaudio&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                    else if (arrUrl.Length == 4)//CHI TIET TIN
                    {
                        //newUrl = UrlProcess.GetHotNewsDetailUrl("1", "320", arrUrl[2]);
                        newUrl = "/Truyen/Default.aspx?display=detailaudio&w=320&lang=1&id=" + arrUrl[2];
                    }
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }

                #endregion
            }

            #endregion

            #region Rewrite DV VOTE

            //if (arrUrl.Length >= 3 && arrUrl[0] == "dang-ky")
            //{
            //    url = AppEnv.GetSetting("WapDefault") + "/sub/dangky.aspx?t=" + arrUrl[1] + "&k=" + arrUrl[2] + "&lang=1&w=320";
            //    Response.Redirect(url);
            //}
            //else if (arrUrl.Length >= 2 && arrUrl[0] == "ai-sexy-hon")
            //{
            //    string name = arrUrl[1].Replace(".aspx", "");
            //    if (name == "mai-tho")
            //    {
            //        url = AppEnv.GetSetting("WapDefault") + "/Wap/S2/Vote/Ketqua.aspx?t=vote1";
            //        Response.Redirect(url);
            //    }
            //    else if (name == "linh-miu")
            //    {
            //        url = AppEnv.GetSetting("WapDefault") + "/Wap/S2/Vote/Ketqua.aspx?t=vote2";
            //        Response.Redirect(url);
            //    }
            //}

            #endregion

            #region Rewrite DV BI MAT HOT-GIRL

            //if(arrUrl.Length == 2)
            //{
            //    if (arrUrl[0] == "bi-mat-hot-girl" && arrUrl[1] == "mai-tho.aspx")
            //    {
            //        HttpContext.Current.RewritePath("/gach.aspx?t=gach", false);
            //    }
            //    else if (arrUrl[0] == "scandal-1-hot-girl" && arrUrl[1] == "mai-tho.aspx")
            //    {
            //        HttpContext.Current.RewritePath("/gach.aspx?t=gach1", false);
            //    }
            //    else if (arrUrl[0] == "scandal-2-hot-girl" && arrUrl[1] == "mai-tho.aspx")
            //    {
            //        HttpContext.Current.RewritePath("/gach.aspx?t=gach2", false);
            //    }
            //    else if (arrUrl[0] == "scandal-3-hot-girl" && arrUrl[1] == "mai-tho.aspx")
            //    {
            //        HttpContext.Current.RewritePath("/gach.aspx?t=gach3", false);
            //    }
            //}

            #endregion

            #region Rewrite DV S2 94x

            if (arrUrl.Length == 1 && arrUrl[0] == "trang-chu.aspx")
            {
                HttpContext.Current.RewritePath("/Wap/DefaultHigh.aspx", false);
            }
            else if (arrUrl.Length == 1 && arrUrl[0] == "login.aspx")
            {
                HttpContext.Current.RewritePath("/Wap/login.aspx", false);
            }
            else if (arrUrl.Length == 1 && arrUrl[0] == "hot-girl.aspx")
            {
                HttpContext.Current.RewritePath("/VoteNew.aspx", false);
            }
            else if (arrUrl.Length == 1 && arrUrl[0] == "hot-girl-vote.aspx")
            {
                HttpContext.Current.RewritePath("/VoteNew.aspx?t=VOTE1", false);
            }
            else if (arrUrl.Length == 1 && arrUrl[0] == "trung-xe-sh.aspx")
            {
                AppEnv.BigPromotionRegistered();
                Response.Redirect("http://wap.vietnamobile.com.vn/Bigpromotion.aspx");
            }
            else if (arrUrl.Length == 1 && arrUrl[0].ToLower() == "trieu-phu-bong-da.aspx")
            {
                Response.Redirect("http://visport.vn/Wap/GameShow.aspx");
            }
            else if (arrUrl.Length == 1)
            {
                string madichvu = arrUrl[0];
                if (madichvu == "video-hang-ngay.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=VDH", false);
                }
                else if (madichvu == "xem-hoang-dao.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=CHD", false);
                }
                else if (madichvu == "tran-cau-dinh.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=TIP", false);
                }
                else if (madichvu == "tu-van-xo-so.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=VE", false);
                }
                else if (madichvu == "top-game-hot.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=G1", false);
                }
                else if (madichvu == "top-clip-hot.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=C1", false);
                }
                else if (madichvu == "truyen-cuoi-hot.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=FUN", false);
                }
                else if (madichvu == "video-hot.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=VIDEO3", false);
                }
                else if (madichvu == "f8-clip.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=f8clip", false);
                }
                else if (madichvu == "kpop.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=kpop", false);
                }
                else if (madichvu == "im-tai-game-tuan.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=GB", false);
                }
                else if (madichvu == "im-tai-nhac-tuan.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=NHAC", false);
                }
                else if (madichvu == "ht-clip-hot.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=HTCLIP", false);
                }
                else if (madichvu == "ht-fun-truyen.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=HTFUNNY", false);
                }
                else if (madichvu == "da-dia-diem-an-choi.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=DAVIP", false);
                }
                else if (madichvu == "dv-tai-9game.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=9GAME", false);
                }

                else if (madichvu == "c-pic.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=CPIC", false);
                }
                else if (madichvu == "c-anh2.aspx")
                {
                    HttpContext.Current.RewritePath("/sub/DangKyS2_94x.aspx?t=CANH2", false);
                }
                else if (madichvu == "dau-tri.aspx")
                {
                    HttpContext.Current.RewritePath("/DichvuTet/DauTri.aspx", false);
                }
                else if (madichvu == "dang-ky-dau-tri.aspx")
                {
                    HttpContext.Current.RewritePath("/DichvuTet/DauTri.aspx?c=dautri", false);
                }
                else if (madichvu == "gieo-que.aspx")
                {
                    HttpContext.Current.RewritePath("/DichvuTet/GieoQue.aspx", false);
                }
                else if (madichvu == "dang-ky-gieo-que.aspx")
                {
                    HttpContext.Current.RewritePath("/DichvuTet/GieoQue.aspx?c=gieoque", false);
                }
                else if (madichvu == "kham-pha.aspx")
                {
                    HttpContext.Current.RewritePath("/DichvuTet/KhamPha.aspx", false);
                }
                else if (madichvu == "dang-ky-kham-pha.aspx")
                {
                    HttpContext.Current.RewritePath("/DichvuTet/KhamPha.aspx?c=khampha", false);
                }
            }

            #endregion

            #region Smartphone Rewrite

            #region GAME

            if (url.Contains(Constant.GameRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.GameRewrite + ".aspx")
                {
                    newUrl = "/Game/DefaultHigh.aspx";
                    //HttpContext.Current.RewritePath("/Game/DefaultHigh.aspx", false);
                }
                else if (arrUrl.Length == 5)//CHUYEN MUC GAME
                {
                    newUrl = "/Game/DefaultHigh.aspx?display=list&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                }
                else if (arrUrl.Length == 4)//CHI TIET GAME
                {
                    newUrl = "/Game/DefaultHigh.aspx?display=detail&id=" + arrUrl[2];
                }
                else if (arrUrl.Length == 3 && url.Contains("download.aspx"))//Download GAME
                {
                    newUrl = "/Game/DownloadHigh.aspx?id=" + arrUrl[1];
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion

            #region THU GIAN

            if (url.Contains(Constant.ThuGianRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.ThuGianRewrite + ".aspx")
                {
                    newUrl = "/ThuGian/DefaultHigh.aspx";
                }
                else if (arrUrl.Length == 5)//CHUYEN MUC THU_GIAN
                {
                    newUrl = "/ThuGian/DefaultHigh.aspx?display=list&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                }
                else if (arrUrl.Length == 3)//CHI TIET THU_GIAN
                {
                    //newUrl = "/ThuGian/DefaultHigh.aspx?display=detail&w=320&lang=1&id=" + arrUrl[2];
                    newUrl = "/ThuGian/DownloadHigh.aspx?id=" + arrUrl[1];
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion

            #region VIDEO

            if (url.Contains(Constant.VideoRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.VideoRewrite + ".aspx")
                {
                    newUrl = "/Video/DefaultHigh.aspx";
                }
                else if (arrUrl.Length == 5)//CHUYEN MUC VIDEO
                {
                    newUrl = "/Video/DefaultHigh.aspx?display=list&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                }
                else if (arrUrl.Length == 4)//CHI TIET VIDEO
                {
                    newUrl = "/Video/DefaultHigh.aspx?display=detail&w=320&lang=1&id=" + arrUrl[2];
                }
                else if (arrUrl.Length == 3 && url.Contains("download.aspx"))//Download VIDEO
                {
                    newUrl = "/Video/DownloadHigh.aspx?id=" + arrUrl[1];
                }
                else if (arrUrl.Length == 3 && url.Contains("view.aspx"))//View VIDEO
                {
                    newUrl = "/Video/ViewHigh.aspx?id=" + arrUrl[1];
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }
            else if (url.Contains(Constant.YoutubeFilmRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 3)//CHUYEN MUC VIDEO YOUTUBE
                {
                    string key = Request.QueryString["key"];
                    if (!string.IsNullOrEmpty(key))
                    {
                        newUrl = "/Video/DefaultHigh.aspx?display=ysearch&w=320&lang=1&key=" + key + "&cpage=" + ConvertUtility.ToInt32(arrUrl[1]);
                    }
                    else
                    {
                        newUrl = "/Video/DefaultHigh.aspx?display=ylist&w=320&lang=1&cpage=" + ConvertUtility.ToInt32(arrUrl[1]);
                    }
                }
                else if (arrUrl.Length == 4)//CHI TIET VIDEO YOUTUBE
                {
                    newUrl = "/Video/DefaultHigh.aspx?display=ydetail&w=320&lang=1&id=" + arrUrl[2];
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion

            #region HOANG DAO

            if (url.Contains(Constant.HoangDaoRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.HoangDaoRewrite + ".aspx")
                {
                    newUrl = "/HoangDao/DefaultHigh.aspx";
                }
                else if (arrUrl.Length == 5)//CHUYEN MUC HOANG DAO
                {
                    newUrl = "/HoangDao/DefaultHigh.aspx?display=list&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                }
                else if (arrUrl.Length == 4)//CHI TIET HOANG DAO
                {
                    string[] arr = arrUrl[2].Split('-');
                    newUrl = "/HoangDao/DefaultHigh.aspx?display=detail&w=320&lang=1&id=" + arr[0] + "&l=" + arr[1];
                }
                else if (arrUrl.Length == 3)//DOWNLOAD HOANG DAO
                {
                    string[] arr = arrUrl[1].Split('-');
                    newUrl = "/HoangDao/DownloadHigh.aspx?id=" + arr[0] + "&l=" + arr[1];
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion

            #region PHAN MEM

            if (url.Contains(Constant.PhanMemRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.PhanMemRewrite + ".aspx")
                {
                    newUrl = "/PhanMem/DefaultHigh.aspx";
                }
                else if (arrUrl.Length == 5)//CHUYEN MUC PHAN MEM
                {
                    newUrl = "/PhanMem/DefaultHigh.aspx?display=list&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                }
                else if (arrUrl.Length == 4)//CHI TIET PHAN MEM
                {
                    newUrl = "/PhanMem/DefaultHigh.aspx?display=detail&id=" + arrUrl[2];
                }
                else if (arrUrl.Length == 3)//DOWNLOAD PHAN MEM
                {
                    newUrl = "/PhanMem/DownloadHigh.aspx?id=" + arrUrl[1];
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion

            #region HINH NEN

            if (url.Contains(Constant.HinhNenRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.HinhNenRewrite + ".aspx")
                {
                    newUrl = "/HinhNen/DefaultHigh.aspx";
                }
                else if (arrUrl.Length == 5)//CHUYEN MUC HINH NEN
                {
                    newUrl = "/HinhNen/DefaultHigh.aspx?display=list&w=320&lang=1&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                }
                else if (arrUrl.Length == 4 && url.Contains("download"))//DOWNLOAD HINH NEN
                {
                    newUrl = "/HinhNen/DownloadHigh.aspx?display=download&w=320&lang=1&id=" + arrUrl[2] + "&catid=" + arrUrl[1];
                }
                else if (arrUrl.Length == 4)//CHI TIET HINH NEN
                {
                    newUrl = "/HinhNen/DefaultHigh.aspx?display=detail&w=320&lang=1&id=" + arrUrl[2];
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion

            #region AM NHAC

            if (url.Contains(Constant.AmNhacRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.AmNhacRewrite + ".aspx")
                {
                    newUrl = "/Music/DefaultHigh.aspx";
                }
                else if (arrUrl.Length == 3)
                {
                    newUrl = "/Music/DownloadHigh.aspx?id=" + arrUrl[1];
                }
                else if (arrUrl.Length == 4)//Album Chi Tiet
                {
                    if (arrUrl[1] == "album")
                    {
                        newUrl = "/Music/DefaultHigh.aspx?display=byalb&id=" + arrUrl[2];
                    }
                    else if (arrUrl[1] == "chi-tiet")
                    {
                        newUrl = "/Music/DefaultHigh.aspx?display=mdt&id=" + arrUrl[2];
                    }
                }
                else if (arrUrl.Length == 5)//Album LIST
                {
                    if (arrUrl[1] == "album")
                    {
                        newUrl = "/Music/DefaultHigh.aspx?display=album&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                    else if (arrUrl[1] == "ca-sy")
                    {
                        newUrl = "/Music/DefaultHigh.aspx?display=artist&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                    else if (arrUrl[1] == "ca-sy-list")
                    {
                        newUrl = "/Music/DefaultHigh.aspx?display=byart&id=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                    else if (arrUrl[1] == "the-loai")
                    {
                        newUrl = "/Music/DefaultHigh.aspx?display=style&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                    else if (arrUrl[1] == "the-loai-list")
                    {
                        newUrl = "/Music/DefaultHigh.aspx?display=bysty&id=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion

            #region THE THAO

            if (url.Contains(Constant.TheThaoRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.TheThaoRewrite + ".aspx")
                {
                    newUrl = "/TheThao/DefaultHigh.aspx";
                }
                else if (arrUrl.Length == 2)
                {
                    if (arrUrl[1] == "tu-van-dac-biet.aspx")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=tvdb";
                    }
                    else if (arrUrl[1] == "thong-ke-dac-biet.aspx")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=cgd&tab=tkdb";
                    }
                    else if (arrUrl[1] == "ket-qua-hom-nay.aspx")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=kqtdhn";
                    }
                    else if (arrUrl[1] == "bang-xep-hang.aspx")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=cgd&tab=bxh";
                    }
                    else if (arrUrl[1] == "ket-qua-thi-dau.aspx")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=cgd&tab=kqtd";
                    }
                    else if (arrUrl[1] == "lich-thi-dau.aspx")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=cgd&tab=ltd";
                    }
                    else if (arrUrl[1] == "lich-thi-dau-hom-nay.aspx")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=ltdhn";
                    }
                }
                else if (arrUrl.Length == 3)
                {
                    if (arrUrl[2] == "tran-cau-vang.aspx")
                    {
                        newUrl = "/TheThao/TuVanDacBietHigh.aspx?id=" + arrUrl[1];
                    }
                    else if (arrUrl[2] == "thong-ke.aspx")
                    {
                        newUrl = "/TheThao/ThongKeHigh.aspx?id=" + arrUrl[1];
                    }
                }
                else if (arrUrl.Length == 4)
                {
                    if (arrUrl[1] == "thong-ke")
                    {
                        newUrl = "/TheThao/ThongKeDacBietHigh.aspx?catid=" + arrUrl[2];
                    }
                    else if (arrUrl[1] == "bang-xep-hang")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=bxh&catid=" + arrUrl[2];
                    }
                    //else if (arrUrl[1] == "ket-qua-thi-dau")
                    //{
                    //    newUrl = "/TheThao/DefaultHigh.aspx?display=kqtd&catid=" + arrUrl[2];
                    //}
                }
                else if (arrUrl.Length == 5)//ket-qua-thi-dau
                {
                    if (arrUrl[1] == "ket-qua-thi-dau")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=kqtd&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                    else if (arrUrl[1] == "lich-thi-dau")
                    {
                        newUrl = "/TheThao/DefaultHigh.aspx?display=ltd&catid=" + arrUrl[2] + "&cpage=" + ConvertUtility.ToInt32(arrUrl[3]);
                    }
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion

            #region XO SO

            if (url.Contains(Constant.XoSoRewrite))
            {
                string newUrl = "";
                if (arrUrl.Length == 1 && arrUrl[0] == Constant.XoSoRewrite + ".aspx")
                {
                    newUrl = "/XoSo/DefaultHigh.aspx";
                }
                else if (arrUrl.Length == 4)//CHI TIET XO SO
                {
                    if (arrUrl[3] == Constant.XoSo_Kqxs_Rewrite + ".aspx")
                    {
                        string[] value = arrUrl[2].Split('-');
                        newUrl = "/XoSo/KQXSHigh.aspx?day=" + value[1] + "&id=" + value[0];
                    }
                    else if (arrUrl[3] == Constant.XoSo_KqbyDay_Rewrite + ".aspx")
                    {
                        newUrl = "/XoSo/KQByDayHigh.aspx?id=" + arrUrl[2];
                    }
                    else if (arrUrl[3] == Constant.XoSo_KqCho_Rewrite + ".aspx")
                    {
                        newUrl = "/XoSo/KQChoHigh.aspx?id=" + arrUrl[2];
                    }
                    else if (arrUrl[3] == Constant.XoSo_ThongKe_Rewrite + ".aspx")
                    {
                        newUrl = "/XoSo/ThongKeHigh.aspx?id=" + arrUrl[2];
                    }
                    else if (arrUrl[3] == Constant.XoSo_Kq20ngay_Rewrite + ".aspx")
                    {
                        newUrl = "/XoSo/KQ20NHigh.aspx?id=" + arrUrl[2];
                    }
                }

                if (!string.IsNullOrEmpty(newUrl))
                {
                    HttpContext.Current.RewritePath(newUrl, false);
                }
                else
                {
                    Response.Redirect(AppEnv.GetSetting("WapDefault"));
                }
            }

            #endregion



            #endregion
        }
Example #20
0
        protected void Page_Load(object sender, EventArgs e)
        {
            price = ConfigurationSettings.AppSettings.Get("TaiMacDinh");
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);

            telCo = AppEnv.CheckFreeContentTelco();

            linkStr = "<a href=\"" + UrlProcess.VideoHome() + "\" >VIDEO</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\" />";

                //HienThiNoiDung(true,false);return;

                #region Free Content

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

                #endregion

                #region OLD

                DataTable dtDetail = VideoController.GetVideoDetailByID(AppEnv.CheckSessionTelco(), id);
                //
                if (telCo == "Undefined")
                {
                    pnlSMS.Visible = true;
                    //if (lang == "1")
                    //{
                    ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                    ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("videocode") + " " + dtDetail.Rows[0]["VID"].ToString() + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("videocommandcode") + "</b> để tải video <b>" + dtDetail.Rows[0]["VTitle_Unicode"].ToString() + "</b> về máy" + Resources.Resource.wChon3G;
                    //}
                    //else
                    //{
                    //    ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan_KD;
                    //    ltrSMS.Text = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("videocode") + " " + dtDetail.Rows[0]["VID"].ToString() + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("videocommandcode") + "</b> de tai video <b>" + dtDetail.Rows[0]["VTitle"].ToString() + "</b> ve may" + Resources.Resource.wChon3G_KD;
                    //}
                }
                else
                {
                    pnlThongBao.Visible = false;
                    switch (Session["telco"].ToString())
                    {
                    case "Vietnamobile":
                        var charging = new Library.VNMCharging.VNMChargingGW();

                        messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", Request.QueryString["id"]);

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

                        if (messageReturn == AppEnv.GetSetting("SystemOverload"))     //System Over Load
                        {
                            messageReturn = AppEnv.VnmChargingSystemOverload(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", Request.QueryString["id"]);
                        }

                        ILog logger = LogManager.GetLogger(Session["telco"].ToString());
                        logger.Debug("---" + messageReturn + "---");
                        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
            }
        }
Example #21
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);

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

            info = XosoController.GetInfobyCompanyID(ConvertUtility.ToInt32(id));

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

                pnlSMS.Visible = true;

                string code = info.Rows[0]["Company_Comment"].ToString().ToUpper();

                if (Session["msisdn"] != null)
                {
                    string subCode = "DK " + code.Trim();

                    string   value = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", subCode);//ANDY Service S2_94x
                    string[] res   = value.Split('|');
                    if (res.Length > 0)
                    {
                        ltrHuongdan.Text = lang == "1" ? "Xổ Số" : "Xo So";
                        if (res[0] == "1")//DK THANH CONG
                        {
                            ltrSMS.Text = lang == "1"
                                ? "Bạn đã đăng ký thành công. Kết quả xổ số <b> " + info.Rows[0]["company_name"].ToString().Replace("XS", "") + " </b> sẽ trả về vào những ngày quay thưởng. <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY " + info.Rows[0]["company_comment"].ToString().Replace("XS", "") + " </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                : "Ban da dang ky thanh cong. Ket qua xo so <b>" + AppEnv.CheckLang(info.Rows[0]["company_name"].ToString().Replace("XS", "")) + " </b> se tra ve vao nhung ngay quay thuong. <br/> De huy dich vu vui long soan: <b> HUY " + info.Rows[0]["company_comment"].ToString().Replace("XS", "") + " </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                        }
                        else
                        {
                            if (res[1].Trim() == "DoubleRegister")
                            {
                                ltrSMS.Text = lang == "1"
                                    ? "Bạn đã là thuê bao của dịch vụ kết quả xổ số hàng ngày. Xin cảm ơn <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY " + info.Rows[0]["company_comment"].ToString().Replace("XS", "") + " </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                    : "Ban da la thue bao cua dich vu ket qua xo so hang ngay. Xin cam on <br/> De huy dich vu vui long soan: <b> HUY " + info.Rows[0]["company_comment"].ToString().Replace("XS", "") + " </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                            }
                            else
                            {
                                ltrSMS.Text = AppEnv.GetSetting("VNM_DangKyThatBai_Mt");
                            }
                        }
                    }
                }
                else
                {
                    ltrHuongdan.Text = lang == "1" ? "Giới Thiệu" : "Gioi Thieu";
                    ltrSMS.Text      = lang == "1"
                                      ? "Cung cấp kết quả xổ số nhanh chóng và hiệu quả. Đăng ký một lần nhận tin mãi mãi <br/> Để đăng ký soạn tin: <b> DK " + code + " </b> gửi <b> 949 </b>"
                                      : "Cung cap ket qua xo so nhanh chong va hieu qua. Dang ky mot lan nhan tin mai mam <br/> De dang ky soan tin: <b> DK " + code + " </b> gui <b> 949 </b>";
                }
            }
        }
Example #22
0
    public int Execute(int jobID)
    {
        try
        {
            var    webServiceCharging3G = new WebServiceCharging3g();
            string userName             = AppEnv.GetSetting("userName_3g_WapVnm");
            string userPass             = AppEnv.GetSetting("password_3g_WapVnm");
            string cpId = AppEnv.GetSetting("cpId_3g_WapVnm");
            string price;

            string message        = string.Empty;
            string returnValue    = string.Empty;
            string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

            string serviceType = "Charged Sub World Cup";
            string serviceName = "World_Cup";
            string reasonLog   = string.Empty;

            DataTable dtPlayed = ViSport_S2_Registered_UsersController.WorldCupGetMatchPlayed();
            if (dtPlayed != null && dtPlayed.Rows.Count > 0)
            {
                foreach (DataRow drPlayed in dtPlayed.Rows)
                {
                    int    matchId = ConvertUtility.ToInt32(drPlayed["Id"].ToString());
                    string winner  = drPlayed["Winner"].ToString();

                    #region XU LY CONG DIEM

                    DataSet ds = ViSport_S2_Registered_UsersController.WorldCupGetMatchVoteByMatchIdRightAndWrong(matchId, winner);
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        DataTable dtRight = ds.Tables[0];
                        DataTable dtWrong = ds.Tables[1];

                        #region UPDATE RIGHT POINT

                        if (dtRight != null && dtRight.Rows.Count > 0)
                        {
                            foreach (DataRow drR in dtRight.Rows)
                            {
                                ViSport_S2_Registered_UsersController.WorldCupRegisteredUserUpdatePoint(drR["User_Id"].ToString(), 5);
                            }
                        }

                        #endregion

                        #region UPDATE WRONG POINT

                        if (dtWrong != null && dtWrong.Rows.Count > 0)
                        {
                            foreach (DataRow drW in dtWrong.Rows)
                            {
                                ViSport_S2_Registered_UsersController.WorldCupRegisteredUserUpdatePoint(drW["User_Id"].ToString(), 1);
                            }
                        }

                        #endregion
                    }

                    #endregion



                    #region UPDATE Trang Thai TranDau

                    ViSport_S2_Registered_UsersController.WorldCupMatchStatusUpdate(ConvertUtility.ToInt32(drPlayed["Id"].ToString()));

                    #endregion
                }
            }
        }
        catch (Exception ex)
        {
            _log.Error("WC Loi lay Tran Dau vua da xong : " + ex);
            return(0);
        }
        return(1);
    }
Example #23
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);
            price = ConfigurationSettings.AppSettings.Get("kqxsprice");
            id    = ConvertUtility.ToInt32(Request.QueryString["id"]);

            telCo = AppEnv.CheckFreeContentTelco();

            linkStr    = "<a href=\"../" + UrlProcess.GetXosoHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >XỔ SỐ<a>";
            linkStr_KD = "<a href=\"../" + UrlProcess.GetXosoHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >XO SO<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\" />";

                #region Free Content

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

                #endregion

                #region OLD

                DataSet ds = XosoController.GetDetail_LotAndOtherLotByIdAndTop(id, 6);

                // Nếu có transactionid_old >> thuê bao mobifone đã thực hiện thanh toán
                if (Session["transactionid_old"] != null)
                {
                    messageReturn = ConvertUtility.ToString(Session["debit_status"]);
                    if (ConvertUtility.ToString(Session["debit_status"]) == "0")
                    {// 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);
                    }
                    Session["transactionid_old"] = null;
                }
                else
                {
                    if (telCo == Constant.T_Mobifone)
                    {
                        string content = Session["cpid"].ToString() + "&" + Constant.xoso + id.ToString() + "&" + price + "&" + Session["transactionid"].ToString();
                        Response.Redirect(ConfigurationSettings.AppSettings.Get("vms3g") + "?link=" + Server.UrlEncode(EAS.EncryptData(content, ConfigurationSettings.AppSettings.Get("vmskey"))));
                    }
                    //
                    if (telCo == "Undefined")
                    {
                        pnlSMS.Visible = true;
                        if (lang == "1")
                        {
                            ltrHuongdan.Text = linkStr + " » " + Resources.Resource.wHuongDan;
                            ltrSMS.Text      = "Soạn tin <b>" + ConfigurationSettings.AppSettings.Get("kqxscode") + " " + ds.Tables[0].Rows[0]["company_comment"].ToString() + "</b> gửi <b>" + ConfigurationSettings.AppSettings.Get("kqxscommandcode") + "</b> để nhận kết quả xổ số mới nhất" + Resources.Resource.wChon3G;
                        }
                        else
                        {
                            ltrHuongdan.Text = linkStr_KD + " » " + Resources.Resource.wHuongDan_KD;
                            ltrSMS.Text      = "Soan tin <b>" + ConfigurationSettings.AppSettings.Get("kqxscode") + " " + ds.Tables[0].Rows[0]["company_comment"].ToString() + "</b> gui <b>" + ConfigurationSettings.AppSettings.Get("kqxscommandcode") + "</b> de nhan ket qua xo so moi nhat" + Resources.Resource.wChon3G_KD;
                        }
                    }
                    else
                    {
                        //pnlThongBao.Visible = true;
                        //if (lang == "1")
                        //{
                        //    ltrTitle.Text = linkStr + " » " + Resources.Resource.wThongBao;
                        //    //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu.Replace("xxx", price);
                        //    ltrThongBao.Text = Resources.Resource.wXacNhanDichVu + "kết quả " + ds.Tables[0].Rows[0]["company_name"].ToString();
                        //    btnCo.Text = Resources.Resource.btnCo;
                        //    btnKhong.Text = Resources.Resource.btnKhong;
                        //}
                        //else
                        //{
                        //    ltrTitle.Text = linkStr_KD + " » " + Resources.Resource.wThongBao_KD;
                        //    //ltrThongBao.Text = Resources.Resource.wXacNhanDichVu_KD.Replace("xxx", price);
                        //    ltrThongBao.Text = Resources.Resource.wXacNhanDichVu + "ket qua " + UnicodeUtility.UnicodeToKoDau(ds.Tables[0].Rows[0]["company_name"].ToString());
                        //    btnCo.Text = Resources.Resource.btnCo_KD;
                        //    btnKhong.Text = Resources.Resource.btnKhong_KD;
                        //}
                        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", "KQXS", Request.QueryString["id"].ToString());
                            //messageReturn = charging.PaymentVNM(Session["msisdn"].ToString(), "LOTOLASTRESULT", "LAST_RESULT");

                            messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "LOTOLASTRESULT", "LAST_RESULT", price, "D", "KQXS", Request.QueryString["id"]);

                            if (!string.IsNullOrEmpty(messageReturn) && 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
            }
        }
Example #24
0
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["LastPage"] = Request.RawUrl;
            lang = Request.QueryString["lang"];
            if (!IsPostBack)
            {
                width = ConvertUtility.ToInt32(Request.QueryString["w"]);
                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\" />";
                //
                //var advertisement = new Advertisement { Channel = "Home", Position = "HomeCenter", Param = 0, Lang = lang, Width = width.ToString() };
                //litAds.Text = advertisement.GetAds();

                var advertisement1 = new Advertisement {
                    Channel = "Home", Position = "UnderLinks", Param = 0, Lang = lang, Width = width.ToString()
                };
                litAds1.Text = advertisement1.GetAds();
            }
            if (string.IsNullOrEmpty(Request.QueryString["display"]))
            {
                display = "home";
            }
            else
            {
                display = Request.QueryString["display"];
            }

            string telCo = "Vietnamobile";
            string id    = Request.QueryString["id"];

            Literal title   = new Literal();
            Literal ltrEnd  = new Literal();
            Literal ltrEnd1 = new Literal();

            try
            {
                string wapHomeURL = "http://wap.vietnamobile.com.vn";


                DataTable dt = VideoController.GetAllWap_Video_ByPackageID(ConvertUtility.ToInt32(AppEnv.GetSetting("packageIdVideo")));

                Count = dt.Rows.Count;

                //title.Text = "<style type=\"text/css\">body {font-family:Verdana, Arial, Helvetica; font-size:12px;} .mainmenu {display:block;width: 100%;background-color: #de60cb;color:#fff;text-align:center;line-height:25px;} .mainmenu a{color:#fff;} a:link, a:visited {text-decoration:none;}</style>";
                //if (lang == "1")
                //{
                //    title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chào mừng bạn đến với dịch vụ Video  <b style=\"color:blue\">(Miễn Phí)</b> của Vietnamobile" + "</div>";
                //}
                //else
                //{
                //    title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chao mung ban den voi dich vu Video  <b style=\"color:blue\">(Mien Phi)</b> cua Vietnamobile" + "</div>";
                //}
                //plList.Controls.Add(title);

                //Literal ltr = new Literal();
                //ltr.Text = "<br />";
                //plList.Controls.Add(ltr);

                rptItem.DataSource     = dt;
                rptItem.ItemDataBound += rptItem_ItemDataBound;
                rptItem.DataBind();

                //foreach (DataRow row in dtMusic.Rows)
                //{
                //    string ringtonepath = row["Path"].ToString();
                //    if (!string.IsNullOrEmpty(ringtonepath))
                //    {
                //        HyperLink lnkfile = new HyperLink();
                //       Image img = new Image();

                //        if (lang == "1")
                //        {
                //            lnkfile.Text = row["Video_Name"].ToString();
                //        }
                //        else
                //        {
                //            lnkfile.Text = UnicodeUtility.UnicodeToKoDau(row["Video_Name"].ToString());
                //        }
                //        string download = AppEnv.GetSetting("downloadVideo");
                //        img.ImageUrl = "http://media.xzone.vn/" + row["Avatar"].ToString().Replace("~/", "");
                //        //img.Width = 60;
                //        img.Attributes.Add("style", "width:60px;padding-left:15px;");
                //        lnkfile.NavigateUrl = "http://media.xzone.vn/" + row["Path"].ToString().Replace("~/", "");
                //        lnkfile.Attributes.Add("style", "color:#006CBF;padding-left:15px;padding-top:3px;padding-bottom:3px;display:block");
                //        lnkfile.Attributes.Add("class", "bold");
                //        plList.Controls.Add(img);
                //        plList.Controls.Add(lnkfile);
                //        ltr = new Literal();
                //        ltr.Text = "<div class=\"clearfix\"></div>";
                //        plList.Controls.Add(ltr);
                //    }
                //}
                ////Khuyen mai
                //ltrEnd1.Text = "</div><div style=\"height: 7px; margin: 5px 0 0px 0; width: 100%;\"></div>";

                //ltrEnd.Text += "<div style=\"background-color: #EA6A00;  color: #FFFFFF;  display: block;  line-height: 25px; text-align: center; width: 100%;\">";
                //plList.Controls.Add(ltrEnd);
                //plList.Controls.Add(ltrEnd1);
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
    public string NotifyChargingInfo(string registeredId, string userId, string requestId, string serviceId, string serviceType, string chargingValue, string chargingAccount, string chargingTime, string chargingResponse)
    {
        log.Info(" ");
        log.Info("***** LOG Euro NOTIFICATION From Tung *****");

        log.Info("User_ID : " + userId);
        log.Info("chargingValue : " + chargingValue);
        log.Info("chargingAccount : " + chargingAccount);
        log.Info("chargingTime : " + chargingTime);
        log.Info("chargingResponse : " + chargingResponse);

        log.Info("****************************************");
        log.Info(" ");

        if (chargingResponse.Trim() == "1")//CHARGED THANH CONG
        {
            #region Sinh mã dự thưởng
            int price = ConvertUtility.ToInt32(chargingValue);
            if (price == 5000)
            {
                #region Sinh 5 mã dự thưởng
                for (int i = 1; i <= 5; i++)
                {
                    string code = RandomActiveCode.Generate(8);
                    ViSport_S2_Registered_UsersController.SportGameHeroLotteryCodeInsert(userId, code);
                }
                #endregion
            }
            else if (price == 3000)
            {
                #region Sinh 5 mã dự thưởng
                for (int i = 1; i <= 3; i++)
                {
                    string code = RandomActiveCode.Generate(8);
                    ViSport_S2_Registered_UsersController.SportGameHeroLotteryCodeInsert(userId, code);
                }
                #endregion
            }
            else if (price == 2000)
            {
                #region Sinh 5 mã dự thưởng
                for (int i = 1; i <= 2; i++)
                {
                    string code = RandomActiveCode.Generate(8);
                    ViSport_S2_Registered_UsersController.SportGameHeroLotteryCodeInsert(userId, code);
                }
                #endregion
            }
            else if (price == 1000)
            {
                string code = RandomActiveCode.Generate(8);
                ViSport_S2_Registered_UsersController.SportGameHeroLotteryCodeInsert(userId, code);
            }
            #endregion

            #region LOG DOANH THU

            var logInfo = new SportGameHeroChargedUserLogInfo();

            logInfo.ID           = ConvertUtility.ToInt32(registeredId);
            logInfo.User_ID      = userId;
            logInfo.Request_ID   = requestId;
            logInfo.Service_ID   = serviceId;
            logInfo.Command_Code = "EU";

            logInfo.Service_Type       = ConvertUtility.ToInt32(serviceType);
            logInfo.Charging_Count     = 0;
            logInfo.FailedChargingTime = 0;

            logInfo.RegisteredTime = DateTime.Now;
            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

            logInfo.Registration_Channel = "SMS";
            logInfo.Status   = 1;
            logInfo.Operator = "vnmobile";
            logInfo.Price    = ConvertUtility.ToInt32(chargingValue);
            logInfo.Reason   = "Succ";

            ViSport_S2_Registered_UsersController.InsertEuroChargedUserLogForSub(logInfo);

            //ViSport_S2_Registered_UsersController.Update_SportGameHeroChargedValue(userId, ConvertUtility.ToInt32(chargingValue));

            //if (DateTime.Now > Convert.ToDateTime(AppEnv.GetSetting("StartKM")) && DateTime.Now < Convert.ToDateTime(AppEnv.GetSetting("EndKM")))
            //{
            //    ViSport_S2_Registered_UsersController.Update_ChargedValueCTKMvmgame_visport(userId, ConvertUtility.ToInt32(chargingValue));
            //}
            #endregion
        }
        else //CHARGED THAT BAI
        {
            #region LOG DOANH THU

            var logInfo = new SportGameHeroChargedUserLogInfo();

            logInfo.ID           = ConvertUtility.ToInt32(registeredId);
            logInfo.User_ID      = userId;
            logInfo.Request_ID   = requestId;
            logInfo.Service_ID   = serviceId;
            logInfo.Command_Code = "EU";

            logInfo.Service_Type       = ConvertUtility.ToInt32(serviceType);
            logInfo.Charging_Count     = 0;
            logInfo.FailedChargingTime = 0;

            logInfo.RegisteredTime = DateTime.Now;
            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

            logInfo.Registration_Channel = "SMS";
            logInfo.Status   = 1;
            logInfo.Operator = "vnmobile";
            logInfo.Price    = ConvertUtility.ToInt32(chargingValue);
            logInfo.Reason   = chargingResponse;

            ViSport_S2_Registered_UsersController.InsertEuroChargedUserLogForSub(logInfo);

            #endregion
        }

        if (chargingResponse.Trim() == "1")
        {
            #region TRA MT

            string       today       = DateTime.Now.DayOfWeek.ToString();
            const string commandCode = "EU";


            if (AppEnv.GetSetting("CTKM_Flag") == "0")
            {
                #region SEND MT CAU_HOI_BONG_DA

                //SEND MT CHO KHACH HANG

                DataTable dtQuestion = ViSport_S2_Registered_UsersController.GetQuestionInfoEuro();
                if (dtQuestion != null && dtQuestion.Rows.Count > 0)
                {
                    string message = dtQuestion.Rows[0]["Question"].ToString();
                    message = message.Replace("P1", "1").Replace("P2", "2");

                    int    questionIdnew = ConvertUtility.ToInt32(dtQuestion.Rows[0]["Id"].ToString());
                    string answer        = dtQuestion.Rows[0]["Answer"].ToString();
                    answer = answer.Replace("P1", "1").Replace("P2", "2");

                    ViSport_S2_Registered_UsersController.InsertSportGameHeroAnswerLog(userId, questionIdnew, message, answer, DateTime.Now, 0); // LUU LOG Question
                    SendMtSportGame(userId, message, serviceId, commandCode, requestId);
                }

                //END SEND MT CHO KHACH HANG

                #endregion
            }



            //}

            #endregion
        }

        return("1");
    }
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);

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

                if (Session["S2Result_2G"] != null)
                {
                    pnlNoiDung.Visible = true;
                    if (Session["S2Result_2G"].ToString() == "1")
                    {
                        ltrNoiDung.Text = lang == "1" ? "Bạn đã đăng ký thành công. Game HOT sẽ được gửi đến điện thoại của bạn vào 15h thứ 2 và thứ 4 hàng tuần. <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY GAME </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                            : "Ban da dang ky thanh cong. Game HOT se duoc gui den dien thoai cua ban vao 15h thu 2 va thu 4 hang tuan. <br/> De huy dich vu vui long soan: <b> HUY GAME </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                    }
                    else
                    {
                        ltrNoiDung.Text = lang == "1" ? "Bạn đã là thuê bao của dịch vụ Game HOT tuần. Xin cảm ơn <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY GAME </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                            : "Ban da la thue bao cua dich vu Game HOT tuan. Xin cam on <br/> De huy dich vu vui long soan: <b> HUY GAME </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                    }
                    Session["S2Result_2G"] = null;
                }
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            lang  = Request.QueryString["lang"];
            width = ConvertUtility.ToInt32(Request.QueryString["w"]);



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

                if (Session["msisdn"] != null)
                {
                    string value = AppEnv.GetRegisterService(Session["msisdn"].ToString(), AppEnv.GetSetting("S2DK_CLIP"));
                    if (value == "1")
                    {
                        pnlSMS.Visible = true;
                        if (lang == "1")
                        {
                            ltrHuongdan.Text = "VIDEO CLIP";
                            ltrSMS.Text      =
                                "Bạn đã là thuê bao của dịch vụ Video Clip tuần. Xin cảm ơn <br/> Để hủy dịch vụ vui lòng SOẠN TIN : <b> HUY CLIP </b> gửi <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                        }
                        else
                        {
                            ltrHuongdan.Text = "VIDEO CLIP";
                            ltrSMS.Text      =
                                "Ban da la thue bao cua dich vu Video Clip tuan. Xin cam on <br/> De huy dich vu vui long SOAN TIN : <b> HUY CLIP </b> gui <b>" + AppEnv.GetSetting("S2ShortCode") + "</b>";
                        }
                    }
                    else
                    {
                        if (AppEnv.GetSetting("94x_Confirm_Flag") == "1")
                        {
                            #region Confirm

                            pnlThongBao.Visible = true;
                            if (lang == "1")
                            {
                                ltrThongBao.Text        = "<b>Xác Nhận</b>";
                                ltrThongBaoNoiDung.Text =
                                    "Bạn có đồng ý đăng ký dịch vụ Clip Hot của Vietnamobile hay không (miễn phí đăng ký) ?";
                            }
                            else
                            {
                                ltrThongBao.Text        = "<b>Xac Nhan</b>";
                                ltrThongBaoNoiDung.Text =
                                    "Ban co dong y dang ky dich vu Clip Hot cua Vietnamobile hay khong (mien phi dang ky) ?";
                            }

                            #endregion
                        }
                        else
                        {
                            #region Non Confirm

                            if (AppEnv.GetSetting("S2Test") == "1")
                            {
                                pnlThongBao.Visible = false;
                                pnlSMS.Visible      = false;

                                pnlNoiDung.Visible = true;

                                ltrNoiDung.Text = lang == "1" ? "Bạn đã đăng ký thành công. Video Clip sẽ được gửi đến điện thoại của bạn vào 10h30 hàng ngày <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY CLIP </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                        : "Ban da dang ky thanh cong. Video Clip se duoc gui den dien thoai cua ban vao 10h30 hang ngay. <br/> De huy dich vu vui long soan: <b> HUY CLIP </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                            }
                            else
                            {
                                string shortCode   = AppEnv.GetSetting("S2ShortCode");   //223
                                string requestId   = AppEnv.GetSetting("S2RequestID");
                                string commandCode = AppEnv.GetSetting("S2Commandcode"); //DK
                                string message     = AppEnv.GetSetting("S2DK_CLIP");
                                string msisdn      = Session["msisdn"].ToString();

                                string   reResult  = AppEnv.RegisterService(shortCode, requestId, msisdn, commandCode, message);
                                string[] arrResult = reResult.Split('|');

                                if (arrResult.Length > 0)
                                {
                                    if (arrResult[0] == "1")
                                    {
                                        pnlThongBao.Visible = false;
                                        pnlSMS.Visible      = false;

                                        pnlNoiDung.Visible = true;

                                        ltrNoiDung.Text = lang == "1" ? "Bạn đã đăng ký thành công. Video Clip sẽ được gửi đến điện thoại của bạn vào 10h30 hàng ngày <br/> Để hủy dịch vụ vui lòng soạn: <b> HUY CLIP </b> gửi <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>"
                                                : "Ban da dang ky thanh cong. Video Clip se duoc gui den dien thoai cua ban vao 10h30 hang ngay. <br/> De huy dich vu vui long soan: <b> HUY CLIP </b> gui <b> " + AppEnv.GetSetting("S2ShortCode") + " </b>";
                                    }
                                    else
                                    {
                                        pnlThongBao.Visible = false;
                                        pnlSMS.Visible      = false;

                                        pnlNoiDung.Visible = true;

                                        ltrNoiDung.Text = lang == "1" ? "Đăng ký không thành công. Vui lòng thử lại" : "Dang ky khong thanh cong. Vui long thu lai";
                                    }
                                }
                            }

                            #endregion
                        }
                    }
                }
                else
                {
                    pnlSMS.Visible = true;
                    if (lang == "1")
                    {
                        ltrHuongdan.Text = "Giới Thiệu";
                        ltrSMS.Text      =
                            "Hệ thống không xác định được số điện thoại của bạn. Vui lòng truy cập bằng 3G/GPRS hoặc soạn tin: DK CLIP gửi " + AppEnv.GetSetting("S2ShortCode");
                    }
                    else
                    {
                        ltrHuongdan.Text = "Gioi Thieu";
                        ltrSMS.Text      =
                            "He thong khong xac dinh duoc so dien thoai cua ban. Vui long truy cap bang 3G/GPRS hoac soan tin DK CLIP gui" + AppEnv.GetSetting("S2ShortCode");
                    }
                }
            }
        }
        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 = 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 = "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.GetRelaxHomeUrl(lang, width.ToString()).Replace("~/", "") + "\" >THƯ GIÃN<a>";
            linkStr_KD      = "<a href=\"../" + UrlProcess.GetRelaxHomeUrl(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");
                //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
            }
        }
Example #29
0
        protected void Page_Load(object sender, EventArgs e)
        {
            lang = Request.QueryString["lang"];
            if (string.IsNullOrEmpty(lang))
            {
                Response.Redirect("/HinhNen/Hot.aspx?w=320&lang=1");
            }

            Session["LastPage"] = Request.RawUrl;
            lang = Request.QueryString["lang"];
            if (!IsPostBack)
            {
                width = ConvertUtility.ToInt32(Request.QueryString["w"]);
                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\" />";
                //
                var advertisement = new Advertisement {
                    Channel = "Home", Position = "HomeCenter", Param = 0, Lang = lang, Width = width.ToString()
                };
                litAds.Text = advertisement.GetAds();

                var advertisement1 = new Advertisement {
                    Channel = "Home", Position = "UnderLinks", Param = 0, Lang = lang, Width = width.ToString()
                };
                litAds1.Text = advertisement1.GetAds();

                #region TU DONG DK SUB

                if (Session["msisdn"] == null)
                {
                    int    is3g   = 0;
                    string msisdn = MobileUtils.GetMSISDN(out is3g);
                    if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile"))
                    {
                        Session["telco"]  = Constant.T_Vietnamobile;
                        Session["msisdn"] = msisdn;
                    }
                    else
                    {
                        Session["msisdn"] = null;
                        Session["telco"]  = Constant.T_Undefined;
                    }
                }

                if (Session["msisdn"] != null)
                {
                    string   value = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", "DK HNEN");//ANDY Service S2_94x
                    string[] res   = value.Split('|');
                    if (res.Length > 0)
                    {
                        if (res[0] == "1") //DK THANH CONG
                        {
                            pnlThongBao.Visible = true;
                        }
                    }
                }

                #endregion
            }
            if (string.IsNullOrEmpty(Request.QueryString["display"]))
            {
                display = "home";
            }
            else
            {
                display = Request.QueryString["display"];
            }


            Literal title = new Literal();
            try
            {
                DataTable dt = HinhNenController.GetAllWap_HinhNen_ByPackageID(ConvertUtility.ToInt32(AppEnv.GetSetting("packageIdWallpaper")));

                rptItem.DataSource     = dt;
                rptItem.ItemDataBound += rptItem_ItemDataBound;
                rptItem.DataBind();

                title.Text = "<style type=\"text/css\">body {font-family:Verdana, Arial, Helvetica; font-size:12px;} .mainmenu {display:block;width: 100%;background-color: #de60cb;color:#fff;text-align:center;line-height:25px;} .mainmenu a{color:#fff;} a:link, a:visited {text-decoration:none;}</style>";
                if (lang == "1")
                {
                    title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chào mừng bạn đến với dịch vụ hình nền  <b style=\"color:blue\">(Miễn Phí)</b> của Vietnamobile" + "</div>";
                }
                else
                {
                    title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chao mung ban den voi dich vu hinh nen  <b style=\"color:blue\">(Mien Phi)</b> cua Vietnamobile" + "</div>";
                }
                plList.Controls.Add(title);

                Literal ltr = new Literal();
                ltr.Text = "<br />";
                plList.Controls.Add(ltr);
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
    public void ProcessRequest(HttpContext context)
    {
        //context.Response.ContentType = "text/plain";
        //context.Response.Write("Hello World");

        string serviceCode = context.Request.QueryString["serviceCode"];

        if (!string.IsNullOrEmpty(serviceCode))
        {
            serviceCode = serviceCode.ToUpper();
        }

        string msisdn = context.Request.QueryString["msisdn"];
        string type   = context.Request.QueryString["Type"];

        string serviceId = "8979";

        const string reType    = "text";
        string       reContent = string.Empty;

        log4net.ILog log = log4net.LogManager.GetLogger("File");
        log.Debug(" ");
        log.Debug(" ");
        log.Debug("--------------------VOTE MOBI FROM Mr.T-------------------------");
        log.Debug("User_ID: " + msisdn);
        log.Debug("Command_Code: " + serviceCode);
        log.Debug("Type: " + type);
        log.Debug(" ");
        log.Debug(" ");


        if (serviceCode == "V1" || serviceCode == "V2" || serviceCode == "G1" || serviceCode == "G2")//DV VOTE1 & VOTE2
        {
            int    votePersonId = 1;
            string personName   = "Mai Tho";
            string commandCode  = "VOTE1";

            int dislikePersonId = 0;

            if (serviceCode == "V2")
            {
                votePersonId = 2;
                personName   = "Linh Miu";
                commandCode  = "VOTE2";
            }
            else if (serviceCode == "G1")
            {
                votePersonId    = 2;
                dislikePersonId = 1;
                personName      = "Mai Tho";
                commandCode     = "GACH1";
            }
            else if (serviceCode == "G2")
            {
                votePersonId    = 1;
                dislikePersonId = 2;
                personName      = "Linh Miu";
                commandCode     = "GACH2";
            }

            if (type == "1")//DK DV LAN DAU
            {
                var entity = new VoteRegisteredInfo();
                entity.User_ID              = msisdn;
                entity.Request_ID           = "0";
                entity.Service_ID           = serviceId;
                entity.Command_Code         = commandCode;
                entity.Service_Type         = 1;
                entity.Charging_Count       = 0;
                entity.FailedChargingTime   = 0;
                entity.RegisteredTime       = DateTime.Now;
                entity.ExpiredTime          = DateTime.Now.AddDays(1);
                entity.Registration_Channel = "SMS";
                entity.Status     = 1;
                entity.Operator   = "vms";
                entity.Vote_Count = 1;

                entity.Vote_PersonId = votePersonId;
                entity.IsDislike     = dislikePersonId;

                if (serviceCode == "V1" || serviceCode == "V2")
                {
                    DataTable dt = VoteRegisterController.NewVoteRegisterInsert(entity);

                    if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//CHUA DK USER
                    {
                        reContent = AppEnv.GetSetting("Vote_Sms_RegisterSucess_Mt2_Like_Mobi").Replace("VoteCount", "1").Replace("VoteTop", "100");
                    }
                    else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                    {
                        int    voteCount = ConvertUtility.ToInt32(dt.Rows[0]["VOTE_SUM"]);
                        string voteTop   = GetTopVote(voteCount);
                        reContent = AppEnv.GetSetting("Vote_Sms_RegisterSucess_Mt2_Like_Mobi").Replace("VoteCount", voteCount.ToString()).Replace("VoteTop", voteTop);
                    }

                    #region LOG DOANH THU

                    NewVoteLogDoanhThu(msisdn, "0", serviceId, "VOTE1");

                    #endregion
                }
                //else
                //{
                //    DataTable dt = VoteRegisterController.VoteRegisterInsert(entity);
                //    DataTable dtDislike = VoteRegisterController.VoteRegisterDislikeInsert(entity);

                //    if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//DK DICH VU LAN DAU
                //    {
                //        reContent = AppEnv.GetSetting("Vote_Sms_RegisterSucess_Mt2_Like_Mobi").Replace("PersonName", personName);
                //    }
                //    else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                //    {
                //        reContent = AppEnv.GetSetting("Vote_Sms_AlreadyRegister_Mobi");
                //    }
                //}
            }
            else if (type == "2")//UPDATE LUOT VOTE (SUB HANG NGAY)
            {
                DataTable info = VoteRegisterController.NewVoteGetUserInfo(msisdn);
                if (info != null && info.Rows.Count > 0)
                {
                    var logInfo = new ViSport_S2_Charged_Users_LogInfo();

                    logInfo.ID                   = ConvertUtility.ToInt32(info.Rows[0]["ID"].ToString());
                    logInfo.User_ID              = msisdn;
                    logInfo.Request_ID           = info.Rows[0]["Request_ID"].ToString();
                    logInfo.Service_ID           = info.Rows[0]["Service_ID"].ToString();
                    logInfo.Command_Code         = info.Rows[0]["Command_Code"].ToString();
                    logInfo.Service_Type         = 0;//Charged Sub Service_Type
                    logInfo.Charging_Count       = ConvertUtility.ToInt32(info.Rows[0]["Charging_Count"].ToString());
                    logInfo.FailedChargingTimes  = ConvertUtility.ToInt32(info.Rows[0]["FailedChargingTimes"].ToString());
                    logInfo.RegisteredTime       = DateTime.Now;
                    logInfo.ExpiredTime          = DateTime.Now.AddDays(1);
                    logInfo.Registration_Channel = info.Rows[0]["Registration_Channel"].ToString();
                    logInfo.Status               = ConvertUtility.ToInt32(info.Rows[0]["Status"].ToString());
                    logInfo.Operator             = info.Rows[0]["Operator"].ToString();
                    logInfo.Price                = 2000;
                    logInfo.Vote_PersonId        = ConvertUtility.ToInt32(info.Rows[0]["Vote_PersonId"].ToString());
                    logInfo.Reason               = "Succ";

                    if (serviceCode == "V1" || serviceCode == "V2")
                    {
                        VoteRegisterController.NewInsertLogLike(logInfo);

                        DataTable dt        = VoteRegisterController.NewVoteGetUserInfo(msisdn);
                        int       voteCount = ConvertUtility.ToInt32(dt.Rows[0]["Vote_Count"]);
                        string    voteTop   = GetTopVote(voteCount);

                        reContent = AppEnv.GetSetting("Vote_Sms_RegisterSucess_Mt2_Like_Mobi").Replace("VoteCount", voteCount.ToString()).Replace("VoteTop", voteTop);

                        //DataTable dt = VoteRegisterController.GetVoteAccountInfo(msisdn, info.Rows[0]["Command_Code"].ToString());
                        //reContent = AppEnv.GetSetting("Vote_Sms_ChargedSubSucess_Like").Replace("PersonName", dt.Rows[0]["Name"].ToString());
                        //reContent = reContent.Replace("VoteCount", dt.Rows[0]["Count"].ToString());
                        //reContent = reContent.Replace("VoteTop", dt.Rows[0]["Top"].ToString());
                    }
                    //else if(serviceCode == "G1" || serviceCode == "G2")
                    //{
                    //    if (info.Rows[0]["Vote_PersonId"].ToString() == "1")
                    //    {
                    //        logInfo.Vote_PersonId = 2;
                    //    }
                    //    else if (info.Rows[0]["Vote_PersonId"].ToString() == "2")
                    //    {
                    //        logInfo.Vote_PersonId = 1;
                    //    }
                    //    VoteRegisterController.InsertLogDisLike(logInfo);
                    //    DataTable dt = VoteRegisterController.GetVoteAccountInfo(msisdn, info.Rows[0]["Command_Code"].ToString());

                    //    reContent = AppEnv.GetSetting("Vote_Sms_ChargedSubSucess_UnLike").Replace("PersonName", dt.Rows[0]["Name"].ToString());
                    //    reContent = reContent.Replace("DislikeCount", dt.Rows[0]["Count"].ToString());
                    //    reContent = reContent.Replace("DislikeTop", dt.Rows[0]["Top"].ToString());
                    //}
                }
            }
            else if (type == "3")//HUY DICH VU
            {
                DataTable dt = VoteRegisterController.NewVoteRegisterUserLock(msisdn);

                if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//CHUA DK USER
                {
                    reContent = AppEnv.GetSetting("Vote_Sms_LockUserError_Mobi");
                }
                else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                {
                    reContent = AppEnv.GetSetting("Vote_Sms_LockUserSuccess_Mobi");
                }
                //DataTable dt = VoteRegisterController.VoteRegisterUserLock(msisdn, 1);

                //if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//CHUA DK USER
                //{
                //    reContent = AppEnv.GetSetting("Vote_Sms_LockUserError_Mobi");
                //}
                //else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                //{
                //    reContent = AppEnv.GetSetting("Vote_Sms_LockUserSuccess_Mobi");
                //}
            }
        }

        if (serviceCode == "T1") //DV GAME THANH_NU
        {
            if (type == "1")     //DK DV LAN DAU
            {
                var entity = new ThanhNuRegisteredUsers();
                entity.UserId              = msisdn;
                entity.RequestId           = "0";
                entity.ServiceId           = "2288";
                entity.CommandCode         = "DK";
                entity.ServiceType         = 1;
                entity.ChargingCount       = 0;
                entity.FailedChargingTimes = 0;
                entity.RegisteredTime      = DateTime.Now;
                entity.ExpiredTime         = DateTime.Now.AddDays(1);
                entity.RegistrationChannel = "SMS";
                entity.Status              = 1;
                entity.Operator            = GetTelco(msisdn);

                #region GOI HAM DK BEN DOI TAC

                string partnerResult = AppEnv.ThanhNuDangKy(msisdn);

                log.Debug(" ");
                log.Debug("**********");
                log.Debug("Partner_Thanh_Nu_smsKichHoat : " + partnerResult);
                log.Debug("**********");
                log.Debug(" ");

                string[] arrValue = partnerResult.Split('|');
                if (arrValue[0].Trim() == "1")
                {
                    ViSport_S2_Registered_UsersController.ThanhNuRegisterUserStatusUpdate(msisdn, 1);
                    reContent = "Ban da la thanh vien cua Game Thanh Nu. Click vao link sau de dang nhap Game " + arrValue[1];
                }
                else if (arrValue[0].Trim() == "0")
                {
                    DataTable value = ViSport_S2_Registered_UsersController.ThanhNuRegisterUserInsert(entity);
                    if (value.Rows[0]["RETURN_ID"].ToString() == "0")
                    {
                        reContent = "Chuc mung Quy Khach da dang ky thanh cong Game Thanh Nu Gia cuoc 1000d-ngay, Goi dich vu se duoc tu dong gia han hang ngay.Kich hoat tai khoan " + arrValue[1] + " .De huy dang ky, Quy Khach soan HUY TN gui 2288.";
                    }
                    else if (value.Rows[0]["RETURN_ID"].ToString() == "1")
                    {
                        ViSport_S2_Registered_UsersController.ThanhNuRegisterUserStatusUpdate(msisdn, 1);
                        reContent = "Ban da la thanh vien cua Game Thanh Nu. Click vao link sau de dang nhap Game " + arrValue[1];
                    }
                }

                #endregion
            }
            else if (type == "2")//CHARGED SUB
            {
                var partnerService = new vn.thanhnu.Service();

                DataTable dtUser = ViSport_S2_Registered_UsersController.ThanhNuGetUserInfo(msisdn);
                if (dtUser != null && dtUser.Rows.Count > 0)
                {
                    string partnerResult = partnerService.smsGiaHan(msisdn, "1");
                    if (partnerResult.Trim() == "1")
                    {
                        reContent = "Goi dich vu Game Thanh Nu  cua Quy Khach da duoc gia han thanh cong. Quy khach duoc cong 110 G_Coin vao tk. Cam on Quy Khach da su dung goi dich vu .";
                    }

                    #region LOG DOANH THU

                    //LOG DOANH THU
                    var e = new ThanhNuChargedUserLogInfo();

                    e.ID                   = ConvertUtility.ToInt32(dtUser.Rows[0]["ID"].ToString());
                    e.User_ID              = msisdn;
                    e.Request_ID           = "0";
                    e.Service_ID           = serviceId;
                    e.Command_Code         = "DK";
                    e.Service_Type         = 0;
                    e.Charging_Count       = 0;
                    e.FailedChargingTime   = 0;
                    e.RegisteredTime       = DateTime.Now;
                    e.ExpiredTime          = DateTime.Now.AddDays(1);
                    e.Registration_Channel = "SMS";
                    e.Status               = 1;
                    e.Operator             = GetTelco(msisdn);

                    e.Reason = "Succ";

                    e.Price         = 1000;
                    e.PartnerResult = partnerResult;

                    ViSport_S2_Registered_UsersController.ThanhNuChargedUserLog(e);

                    #endregion
                }
            }
            else if (type == "3")//HUY DICH VU
            {
                #region GOI HAM HUY BEN DOI TAC

                string partnerResult = AppEnv.ThanhNuHuy(msisdn);
                if (partnerResult.Trim() == "1")
                {
                    DataTable value = ViSport_S2_Registered_UsersController.ThanhNuRegisterUserStatusUpdate(msisdn, 0);
                    if (value.Rows[0]["RETURN_ID"].ToString() == "1")
                    {
                        reContent = "Toan bo tai khoan Game Thanh Nu cua Quy khach se bi huy.De dang ki lai Qk vui long soan tin DK TN gui 2288";
                    }
                }

                #endregion
            }
        }



        var aSerializer = new JavaScriptSerializer();

        var obj = new MT();
        var ct1 = new ContentInfo();
        obj.List = new ContentInfo[1];

        ct1.Type    = reType;
        ct1.Content = reContent;
        obj.List[0] = ct1;

        string strReturn = aSerializer.Serialize(obj);

        log.Debug(" ");
        log.Debug(" ");
        log.Debug("strReturn: " + strReturn);
        log.Debug(" ");
        log.Debug(" ");

        context.Response.ContentType = "text/html";
        context.Response.Write(strReturn);
    }