示例#1
0
        void rptItem_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }

            HyperLink lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar");
            Image     imgAvatar = (Image)e.Item.FindControl("imgAvatar");
            HyperLink lnkTen    = (HyperLink)e.Item.FindControl("lnkTen");

            DataRowView row      = (DataRowView)e.Item.DataItem;
            string      download = AppEnv.GetSetting("VNMdownload");

            imgAvatar.ImageUrl = "http://media.xzone.vn/" + row["Path"].ToString().Replace("~/", "");
            lnkTen.NavigateUrl = lnkAvatar.NavigateUrl = download + "?type=1&id=" + row["ID"].ToString() + "&code=" + SecurityMethod.MD5Encrypt(row["ID"].ToString());
            if (lang == "1")
            {
                lnkTen.Text = row["Wallpaper_Name"].ToString();
            }
            else
            {
                lnkTen.Text = UnicodeUtility.UnicodeToKoDau(row["Wallpaper_Name"].ToString());
            }
        }
        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")));
                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 += new RepeaterItemEventHandler(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());
            }
        }
示例#3
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"];
            }

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

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


                DataTable dtMusic = GameController.GetAllGame_ByPackageID(ConvertUtility.ToInt32(AppEnv.GetSetting("packageIdGame")));
                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ụ game <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 game <b style=\"color:blue\">(Miễn Phí)</b> cua Vietnamobile" + "</div>";
                }
                //title.Text += "<div style=\"padding-left:5px;margin:5px 0 5px 0;\">Click để tải:";
                plList.Controls.Add(title);
                foreach (DataRow row in dtMusic.Rows)
                {
                    HyperLink lnkfile = new HyperLink();
                    //Literal ltr = new Literal();
                    //ltr.Text = "</br>";
                    if (lang == "1")
                    {
                        lnkfile.Text = row["Name"].ToString();
                    }
                    else
                    {
                        lnkfile.Text = UnicodeUtility.UnicodeToKoDau(row["Name"].ToString());
                    }
                    lnkfile.NavigateUrl = AppEnv.GetSetting("JavaGameDownload") + "?id=" + row["GameID"] + "&type=3" + "&code=" + SecurityMethod.MD5Encrypt(row["GameID"].ToString());
                    lnkfile.Attributes.Add("style", "color:#006CBF;padding-left:15px;padding-top:5px;padding-bottom:5px;display:block");
                    lnkfile.Attributes.Add("class", "bold");
                    //plList.Controls.Add(ltr);
                    plList.Controls.Add(lnkfile);
                }
                //Khuyen mai
                ltrEnd1.Text = "</div><div style=\"border-bottom: 1px solid #790083;height: 7px; margin: 5px 0 10px 0; width: 100%;\"></div>";

                ltrEnd.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%;\">";
                ltrEnd.Text += "<a style=\"color:#fff\" href=\"" + wapHomeURL + "\">Trang chủ</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Game/Default.aspx?lang=1&display=home&hotro=0\">Game</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Music/Default.aspx?lang=1&display=home\">Nhạc</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Thethao/Default.aspx?lang=1&display=home\">Bóng đá</a></div>";
                plList.Controls.Add(ltrEnd);
            }
            catch (Exception ex)
            {
                Response.Write(ex.ToString());
            }
        }
示例#4
0
        protected void Page_Load(object sender, EventArgs e)
        {
            string partnerid = string.Empty;

            try
            {
                DesSecurity des   = new DesSecurity();
                string      token = des.Des3Decrypt(Request.QueryString["c"], AppEnv.GetSetting("msisdnkey"));

                logger.Debug("token =" + token);
                logger.Debug("c =" + Request.QueryString["c"]);

                DataTable dtTrans = DBController.Transaction_Online_GetByToken(token);
                if (dtTrans != null && dtTrans.Rows.Count > 0)
                {
                    //logger.Debug("dtTrans.Rows.Count =" + dtTrans.Rows.Count);

                    int    status       = 1;
                    string debit_status = string.Empty;
                    string strType      = Constant.pmContentTypeVNM[ConvertUtility.ToInt32(dtTrans.Rows[0]["ItemType"])];

                    partnerid = dtTrans.Rows[0]["PartnerID"].ToString();
                    WapXzone_VNM.Library.VNMCharging.VNMChargingGW charging = new WapXzone_VNM.Library.VNMCharging.VNMChargingGW();

                    string productId  = string.Empty;
                    string productKey = string.Empty;

                    string price = dtTrans.Rows[0]["Price"].ToString();

                    if (strType == "TEXT")
                    {
                        if (price == "1000")
                        {
                            productId  = "RELAXSTORYREAD";
                            productKey = "READ";
                        }
                        else if (price == "15000")
                        {
                            productId  = "RELAXSTORYMONTHLY";
                            productKey = "READ_MONTHLY";
                        }
                        else if (price == "2000")
                        {
                            productId  = "RELAXLOVER";
                            productKey = "LOVER";
                        }
                        else if (price == "3000")
                        {
                            productId  = "RELAXPLACE";
                            productKey = "PLACE";
                        }
                        else if (price == "5000")
                        {
                            productId  = "RELAXADVISESEX";
                            productKey = "ADVISE_SEX";
                        }
                    }
                    else if (strType == "WP")
                    {
                        productId  = "PICDOWN";
                        productKey = "PIC_DOWN";
                    }
                    else if (strType == "TT")
                    {
                        productId  = "FOOTBALLSUMARY";
                        productKey = "FOOTBALL_SUMARY";
                    }
                    else if (strType == "JG")
                    {
                        productId  = "GAMEDOWN";
                        productKey = "GAME_DOWN";
                    }
                    else if (strType == "APP")
                    {
                        productId  = "APPDOWN";
                        productKey = "APP_DOWN";
                    }
                    else if (strType == "VID")
                    {
                        productId  = "VIDEODOWN";
                        productKey = "VIDEO_DOWN";
                    }
                    else if (strType == "YKCG")
                    {
                        productId  = "FOOTBALLADVISE";
                        productKey = "FOOTBALL_ADVISE";
                    }
                    else if (strType == "TIP")
                    {
                        productId  = "FOOTBALLADVISE";
                        productKey = "FOOTBALL_ADVISE";
                    }
                    else if (strType == "KQCHO")
                    {
                        productId  = "FOOTBALLRESULT";
                        productKey = "FOOTBALL_RESULT";
                    }
                    else if (strType == "KQXS")
                    {
                        productId  = "LOTOLASTRESULT";
                        productKey = "LAST_RESULT";
                    }
                    else if (strType == "SOICAU")
                    {
                        productId  = "LOTOSOICAU";
                        productKey = "SOICAU";
                    }
                    else if (strType == "XSKQCHO")
                    {
                        productId  = "LOTORESULT";
                        productKey = "RESULT";
                    }
                    else if (strType == "XOSO20")
                    {
                        productId  = "LOTORESULTMONTHLY";
                        productKey = "RESULTMONTHLY";
                    }
                    else if (strType == "RELAX")
                    {
                        productId  = "RELAXSTORYREAD";
                        productKey = "READ";
                    }
                    else if (strType == "GAME87")
                    {
                        productId  = "FOOTBALLADVISE";
                        productKey = "FOOTBALL_RESULT";
                    }
                    else if (strType == "Tu vi")
                    {
                        productId  = "HOROSCOPE";
                        productKey = "HOROSCOPE";
                    }

                    debit_status = charging.NavigatePaymentVnm(dtTrans.Rows[0]["msisdn"].ToString(), productId, productKey, price, "D", strType, UnicodeUtility.RemoveSpecialCharacter(UnicodeUtility.UnicodeToKoDau(dtTrans.Rows[0]["ItemDetail"].ToString())));

                    //debit_status = charging.PaymentVNM(dtTrans.Rows[0]["msisdn"].ToString(),productId,productKey);
                    if (!string.IsNullOrEmpty(debit_status) && debit_status == "1")
                    {
                        // Thanh toán thành công >> trả nội dung
                        status = 0;
                    }

                    //logger.Debug("debit_status =" + debit_status);

                    //Tạo Transaction_Online mới
                    string vTransactionID = DBController.Transaction_Online_Insert(dtTrans.Rows[0]["msisdn"].ToString(), 4, ConvertUtility.ToInt32(partnerid), "", "");
                    //Ghi Transaction, Transaction_Log, xoá Transaction_Online cũ
                    DBController.Transaction_Insert_New(dtTrans.Rows[0]["ItemID"].ToString(), dtTrans.Rows[0]["ItemDetail"].ToString(), ConvertUtility.ToInt32(dtTrans.Rows[0]["ItemType"]),
                                                        dtTrans.Rows[0]["msisdn"].ToString(), 4, 0, ConvertUtility.ToInt32(dtTrans.Rows[0]["Price"]), ConvertUtility.ToInt32(partnerid),
                                                        ConvertUtility.ToDecimal(dtTrans.Rows[0]["TransactionID"]), ConvertUtility.ToDateTime(dtTrans.Rows[0]["Created"]), "debit_status: " + debit_status, status);
                    WapController.Transaction_Online_Delete(dtTrans.Rows[0]["msisdn"].ToString());

                    //Trả kết quả qua URL
                    if (status == 0)
                    {
                        if (AppEnv.GetSetting("ExceptPartner").IndexOf("|" + ConvertUtility.ToString(dtTrans.Rows[0]["PartnerID"]) + "|") > -1)
                        {
                            logger.Debug("http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?&p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()));

                            Response.Redirect(@"http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?&p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                            //HttpContext.Current.ApplicationInstance.CompleteRequest();
                            return;
                        }
                        else
                        {
                            logger.Debug("http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()));
                            if (dtTrans.Rows[0]["CallBackUrl"].ToString().IndexOf("?") > -1)
                            {
                                Response.Redirect(@"http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "&p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                            }
                            else
                            {
                                Response.Redirect(@"http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                            }
                            //HttpContext.Current.ApplicationInstance.CompleteRequest();
                            return;
                        }
                    }
                    else
                    {
                        if (dtTrans.Rows[0]["CallBackUrl"].ToString().IndexOf("?") > -1)
                        {
                            Response.Redirect("http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "&p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|-1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                        }
                        else
                        {
                            Response.Redirect("http://" + dtTrans.Rows[0]["Domain"].ToString() + dtTrans.Rows[0]["CallBackUrl"].ToString() + "?p=" + des.Des3Encrypt(dtTrans.Rows[0]["msisdn"].ToString() + "|-1|" + vTransactionID + "|" + dtTrans.Rows[0]["TransactionID"].ToString(), dtTrans.Rows[0]["KeyCode"].ToString()), false);
                        }
                    }
                }
                else
                {
                    Response.Redirect("http://payment.xzone.vn/e.aspx", false);
                }
            }
            catch (Exception ex)
            {
                logger.Debug("Exception=" + ex.ToString());
                Response.Redirect("http://payment.xzone.vn/e.aspx", false);
                //Response.Write(ex.ToString());
                //Response.Redirect("http://payment.xzone.vn/sc.aspx?pid=" + partnerid);
            }
        }