Esempio n. 1
0
        protected void btnSearch_Click(object sender, EventArgs e)
        {
            string key = txtKey.Text.Trim();

            key = UnicodeUtility.RemoveSpecialCharacter(key);
            key = UnicodeUtility.RemoveHtmlTags(key);
            key = UnicodeUtility.UnicodeToKoDau(key);
            if (!string.IsNullOrEmpty(key))
            {
                key = key.Replace(" ", "+");
                string url = UrlProcess.YoutubeTimKiem(key, 1, "tim-phim");

                HttpContext.Current.RewritePath(url, false);

                Response.Redirect(url);
            }
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            string key = Request.QueryString["key"];

            key = UnicodeUtility.RemoveSpecialCharacter(key);
            key = UnicodeUtility.RemoveHtmlTags(key);
            key = UnicodeUtility.UnicodeToKoDau(key);
            key = key.ToLower();

            if (!string.IsNullOrEmpty(key))
            {
                int    totalrecord = 0;
                string cateName    = "tim-phim";

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

                DataSet ds = VideoController.KhoClipSearch(key, pagesize, curpage);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    rptList.DataSource = ds.Tables[0];
                    rptList.DataBind();

                    totalrecord = ConvertUtility.ToInt32(ds.Tables[1].Rows[0]["totalRows"]);

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

                    Paging1.defaultparam = UrlProcess.YoutubeTimKiem(key, curpage, cateName);
                    Paging1.queryparam   = UrlProcess.YoutubeTimKiem(key, curpage, cateName);
                }

                lblKetqua.Text = "Tìm thấy <b>" + totalrecord + "</b> phim";
            }
        }
Esempio n. 3
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);
            }
        }