Beispiel #1
0
        protected void rptlstCategory_ItemDataBound(object sender, RepeaterItemEventArgs e)
        {
            if (e.Item.ItemIndex < 0)
            {
                return;
            }
            DataRowView curData = (DataRowView)e.Item.DataItem;
            HyperLink   lnkDL   = (HyperLink)e.Item.FindControl("lnkDL");
            Literal     ltrStt  = (Literal)e.Item.FindControl("ltrStt");
            Label       lblTen  = (Label)e.Item.FindControl("lblTen");
            Literal     ltrCasy = (Literal)e.Item.FindControl("ltrCasy");

            ltrStt.Text = (e.Item.ItemIndex + 1 + (curpage - 1) * pagesize).ToString() + ". ";
            if (ltrStt.Text.Length == 3)
            {
                ltrStt.Text = "0" + ltrStt.Text;
            }
            if (lang == 1)
            {
                lblTen.Text  = curData["SongNameUnicode"].ToString();
                ltrCasy.Text = curData["ArtistNameUnicode"].ToString();
            }
            else
            {
                lblTen.Text  = curData["SongName"].ToString();
                ltrCasy.Text = curData["ArtistName"].ToString();
            }
            //lnkDL.NavigateUrl = UrlProcess.GetRingToneDetailUrl(lang.ToString(), "detail", width, curData["W_RTItemID"].ToString());
            if (showDL)
            {
                lnkDL.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", curData["W_RTItemID"].ToString(), SecurityMethod.MD5Encrypt(curData["W_RTItemID"].ToString()));
            }
            else
            {
                lnkDL.Visible = false;
            }
        }
Beispiel #2
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;
            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = RTController.GetRingToneDetailByIDHasCache(Session["telco"].ToString(), id);

            chitietGiaodich = "Nhạc: " + dtDetail.Rows[0]["SongNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            if (thuchien)
            {
                DataTable dtKhuyenMai = RTController.GetRingToneDetailRandom(Session["telco"].ToString(), id);
                string    khuyenmaiID = ConvertUtility.ToString(dtKhuyenMai.Rows[0]["W_RTItemID"]);
                lnkKhuyenMai.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", khuyenmaiID, SecurityMethod.MD5Encrypt(khuyenmaiID));
                if (lang == "1")
                {
                    ltrTieuDe.Text    = linkStr;
                    lblTen.Text       = dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkDownload.Text  = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text   = Resources.Resource.wMuaThanhCong + " bản nhạc " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkKhuyenMai.Text = "Nhạc tặng: " + dtKhuyenMai.Rows[0]["SongNameUnicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text    = linkStr_KD;
                    lblTen.Text       = dtDetail.Rows[0]["SongName"].ToString();
                    lnkDownload.Text  = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text   = Resources.Resource.wMuaThanhCong_KD + " ban nhac " + dtDetail.Rows[0]["SongName"].ToString();
                    lnkKhuyenMai.Text = "Nhac tang: " + dtKhuyenMai.Rows[0]["SongName"].ToString();
                };
                lnkDownload.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));

                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 2);
                RTController.SetDownloadCounter(Session["telco"].ToString(), id);
            }
            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, 2, messageReturn);

                //--Thông báo lỗi thanh toán
            }
            //log charging
            ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN:" + Session["msisdn"].ToString());
            logger.Debug("Dich vu: Nhac chuong - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["SongName"].ToString() + " - id: " + id);
            logger.Debug("Nhac chuong Url:" + lnkDownload.NavigateUrl);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
        protected void HienThiNoiDung(Boolean thuchien, Boolean isLog)
        {
            pnlNoiDung.Visible = true;
            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = MusicController.GetItemDetailHasCache(AppEnv.CheckFreeContentTelco(), id);

            //chitietGiaodich = "Nhạc: " + dtDetail.Rows[0]["SongNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            chitietGiaodich = "Nhạc: " + dtDetail.Rows[0]["SongNameUnicode"].ToString() + " -- id:" + id.ToString();
            if (thuchien)
            {
                DataTable dtKhuyenMai = MusicController.GetItemDetailRandom(AppEnv.CheckFreeContentTelco(), id);
                string    khuyenmaiID = ConvertUtility.ToString(dtKhuyenMai.Rows[0]["W_MItemID"]);
                lnkKhuyenMai.NavigateUrl = UrlProcess.GetGameDownloadItem(AppEnv.CheckFreeContentTelco(), "22", khuyenmaiID, SecurityMethod.MD5Encrypt(khuyenmaiID));
                //if (lang == "1")
                //{
                ltrTieuDe.Text    = "ÂM NHẠC";
                lblTen.Text       = dtDetail.Rows[0]["SongNameUnicode"].ToString();
                lnkDownload.Text  = Resources.Resource.wBamDeTai;
                ltrNoiDung.Text   = Resources.Resource.wMuaThanhCong + " bản nhạc " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                lnkKhuyenMai.Text = "Nhạc tặng: " + dtKhuyenMai.Rows[0]["SongNameUnicode"].ToString();
                //}
                //else
                //{
                //    ltrTieuDe.Text = "AM NHAC";
                //    lblTen.Text = dtDetail.Rows[0]["SongName"].ToString();
                //    lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                //    ltrNoiDung.Text = Resources.Resource.wMuaThanhCong_KD + " ban nhac " + dtDetail.Rows[0]["SongName"].ToString();
                //    lnkKhuyenMai.Text = "Nhac tang: " + dtKhuyenMai.Rows[0]["SongName"].ToString();
                //}
                lnkDownload.NavigateUrl = UrlProcess.GetGameDownloadItem(AppEnv.CheckFreeContentTelco(), "22", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));

                if (free != true)
                {
                    if (isLog)
                    {
                        Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 2);
                    }
                }

                MusicController.SetDownloadCounter(AppEnv.CheckFreeContentTelco(), id);
            }
            else
            {
                //Thông báo lỗi thanh toán
                //if (lang == "1")
                //{
                ltrTieuDe.Text  = Resources.Resource.wThongBao;
                ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan;
                //}
                //else
                //{
                //    ltrTieuDe.Text = Resources.Resource.wThongBao_KD;
                //    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                //}
                if (isLog)
                {
                    Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 2, messageReturn);
                }

                //--Thông báo lỗi thanh toán
            }
            //log charging
            if (free != true)
            {
                if (isLog)
                {
                    ILog logger = LogManager.GetLogger(Session["telco"].ToString());
                    logger.Debug("--------------------------------------------------");
                    logger.Debug("MSISDN:" + Session["msisdn"]);
                    logger.Debug("Dich vu: Am nhac - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["SongName"] + " - id: " + id);
                    logger.Debug("Am nhac Url:" + lnkDownload.NavigateUrl);
                    logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                    logger.Debug("Error:" + messageReturn);
                    logger.Debug("Current Url:" + Request.RawUrl);
                }
            }
            //end log
        }
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = RTController.GetRingToneDetailByID(Session["telco"].ToString(), id);

            chitietGiaodich = "Nhạc: " + dtDetail.Rows[0]["SongNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            SoDT            = MobileUtils.ToSTDMobileNumber(SoDT);
            if (thuchien)
            {
                DataTable dtKhuyenMai = RTController.GetRingToneDetailRandom(Session["telco"].ToString(), id);
                string    khuyenmaiID = ConvertUtility.ToString(dtKhuyenMai.Rows[0]["W_RTItemID"]);
                lnkKhuyenMai.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", khuyenmaiID, SecurityMethod.MD5Encrypt(khuyenmaiID));
                if (lang == "1")
                {
                    ltrTieuDe.Text = linkStr;
                    lblTen.Text    = dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    //lnkDownload.Text = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text   = Resources.Resource.wTangThanhCong + " bản nhạc " + dtDetail.Rows[0]["SongNameUnicode"].ToString();
                    lnkKhuyenMai.Text = "Nhạc tặng: " + dtKhuyenMai.Rows[0]["SongNameUnicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text = linkStr_KD;
                    lblTen.Text    = dtDetail.Rows[0]["SongName"].ToString();
                    //lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text   = Resources.Resource.wTangThanhCong_KD + " ban nhac " + dtDetail.Rows[0]["SongName"].ToString();
                    lnkKhuyenMai.Text = "Nhac tang: " + dtKhuyenMai.Rows[0]["SongName"].ToString();
                };
                string url    = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "2", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));
                MTInfo mtInfo = new MTInfo();
                Random random = new Random();
                //Thông báo cho người được tặng
                mtInfo.User_ID       = SoDT;
                mtInfo.Service_ID    = ConfigurationSettings.AppSettings.Get("ringtonecommandcode");
                mtInfo.Command_Code  = ConfigurationSettings.AppSettings.Get("ringtonecode");
                mtInfo.Message_Type  = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID    = random.Next(100000000, 999999999).ToString();
                mtInfo.Total_Message = 1;
                mtInfo.Message_Index = 0;
                mtInfo.IsMore        = 0;
                mtInfo.Content_Type  = 0;
                mtInfo.Message_Type  = (int)Constant.MessageType.FREE;
                mtInfo.Message       = "Ban nhan duoc qua tang nhac chuong " + dtDetail.Rows[0]["Code"].ToString() + " tu so dien thoai " + "0" + Session["msisdn"].ToString().Remove(0, 2);
                MTController.SMS_MTInsert(mtInfo);

                //MT thong bao cho nguoi gui tang biet
                mtInfo.Content_Type = 0;
                mtInfo.User_ID      = Session["msisdn"].ToString();
                mtInfo.Message      = "Ban da gui tang thanh cong nhac chuong " + dtDetail.Rows[0]["Code"].ToString() + " toi so dt " + SoDT;
                mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                MTController.SMS_MTInsert(mtInfo);

                //Build waplink send to customer and insert to MT table
                mtInfo.User_ID      = SoDT;
                mtInfo.Message      = "Tai nhac chuong duoc tang theo dia chi: " + url;
                mtInfo.Content_Type = 8;
                mtInfo.Message_Type = (int)Constant.MessageType.FREE;
                mtInfo.Request_ID   = random.Next(100000000, 999999999).ToString();
                MTController.SMS_MTInsert(mtInfo);

                Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, url, id.ToString(), chitietGiaodich, 2);
                RTController.SetDownloadCounter(Session["telco"].ToString(), id);
            }
            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, 2, messageReturn);
                //--Thông báo lỗi thanh toán
            }
            //log charging
            ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());

            logger.Debug("--------------------------------------------------");
            logger.Debug("MSISDN: " + Session["msisdn"].ToString());
            logger.Debug("So gui tang: " + SoDT);
            logger.Debug("Dich vu: Nhac chuong - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["SongName"].ToString() + " - id: " + id);
            logger.Debug("Nhac chuong Url:" + lnkDownload.NavigateUrl);
            logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
            logger.Debug("Error:" + messageReturn);
            logger.Debug("Current Url:" + Request.RawUrl);
            //end log
        }
Beispiel #5
0
        protected void HienThiNoiDung(Boolean thuchien)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = VideoController.GetVideoDetailByID(Session["telco"].ToString(), id);

            chitietGiaodich = "Video: " + dtDetail.Rows[0]["VTitle_Unicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            if (thuchien)
            {
                if (lang == "1")
                {
                    ltrTieuDe.Text   = linkStr;
                    lblTen.Text      = dtDetail.Rows[0]["VTitle_Unicode"].ToString();
                    lnkDownload.Text = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text  = Resources.Resource.wMuaThanhCong + " video " + dtDetail.Rows[0]["VTitle_Unicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text   = linkStr;
                    lblTen.Text      = dtDetail.Rows[0]["VTitle"].ToString();
                    lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text  = Resources.Resource.wMuaThanhCong_KD + " video " + dtDetail.Rows[0]["VTitle"].ToString();
                };

                string viewLink;

                if (!string.IsNullOrEmpty(dtDetail.Rows[0]["SmartPhonePath"].ToString()))
                {
                    viewLink = dtDetail.Rows[0]["SmartPhonePath"].ToString();
                }
                else
                {
                    viewLink = dtDetail.Rows[0]["VMobilePath"].ToString();
                }

                if (HttpContext.Current.Request.UserAgent != null)
                {
                    if (HttpContext.Current.Request.UserAgent.ToLower().Contains("safari"))
                    {
                        lnkDownload.NavigateUrl = ConfigurationSettings.AppSettings.Get("vnmviewIphone") + viewLink.Replace("~/", "/");
                    }
                    else
                    {
                        lnkDownload.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "5", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));
                    }
                }
                else
                {
                    lnkDownload.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "5", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));
                }

                bool log = true;
                if (ConvertUtility.ToString(Session["transactionid_detail"]) == chitietGiaodich)
                {
                    log = false;
                }
                Session["transactionid_detail"] = chitietGiaodich;
                if (log)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 5);
                }
            }
            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 + " » " + Resources.Resource.wThongBao_KD;
                    ltrNoiDung.Text = Resources.Resource.wThongBaoLoiThanhToan_KD;
                }
                Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 5, messageReturn);
                //--Thông báo lỗi thanh toán
            }


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

            logger.Info("Dich vu: Video - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["VTitle"].ToString() + " - id: " + id);
            logger.Info("Video Url:" + lnkDownload.NavigateUrl);
            string clientIP = HttpContext.Current.Request.UserHostAddress;

            if (Session["telco"].ToString() == Constant.T_Viettel)
            {
                clientIP = ConvertUtility.ToString(HttpContext.Current.Request.Headers.Get("VX-Forwarded-For"));
            }
            logger.Info("IP:" + clientIP);
            logger.Info("Current Url:" + Request.RawUrl);
            logger.Info("Header: " + Request.Headers.ToString());
            logger.Info("Current TransactionID: " + ConvertUtility.ToString(Session["transactionid"]));
            //end log
        }