예제 #1
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean isLog, string gamePrice)
        {
            pnlNoiDung.Visible = true;
            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = GameController.GetGameDetailByID(AppEnv.CheckFreeContentTelco(), id);

            //chitietGiaodich = "Game: " + dtDetail.Rows[0]["GameNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            chitietGiaodich = "Game: " + dtDetail.Rows[0]["GameNameUnicode"].ToString() + " -- id:" + id.ToString();

            if (thuchien)
            {
                ltrTieuDe.Text = linkStr;
                //if (lang == "1")
                //{
                lblTen.Text      = dtDetail.Rows[0]["GameNameUnicode"].ToString();
                lnkDownload.Text = Resources.Resource.wBamDeTai;
                ltrNoiDung.Text  = Resources.Resource.wMuaThanhCong + " game " + dtDetail.Rows[0]["GameNameUnicode"].ToString() + " (" + dtDetail.Rows[0]["Game_Code"].ToString() + ")";
                //}
                //else
                //{
                //    lblTen.Text = dtDetail.Rows[0]["GameName"].ToString();
                //    lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                //    ltrNoiDung.Text = Resources.Resource.wMuaThanhCong_KD + " game " + dtDetail.Rows[0]["GameName"].ToString() + " (" + dtDetail.Rows[0]["Game_Code"].ToString() + ")";
                //};
                string url;
                try
                {
                    //VMGGame.MOReceiver urlservice = new VMGGame.MOReceiver();

                    //url = urlservice.VMG_ReturnUrlForGame(ConvertUtility.ToString(dtDetail.Rows[0]["GID"]),
                    //                                        0,
                    //                                        ConvertUtility.ToString(AppEnv.CheckFreeContentMsisdn()),
                    //                                        ConvertUtility.ToInt32(dtDetail.Rows[0]["Partner_ID"]),
                    //                                        "VNM",
                    //                                        "WAP",
                    //                                        AppEnv.CheckFreeContentTelco(),
                    //                                        Constant.T_VietnamobileWap,
                    //                                        "",
                    //                                        "");

                    var gameUrl = new GameHandler();
                    url = gameUrl.VMG_ReturnUrlForGame(ConvertUtility.ToString(dtDetail.Rows[0]["GID"]),
                                                       0,
                                                       ConvertUtility.ToString(AppEnv.CheckFreeContentMsisdn()),
                                                       ConvertUtility.ToInt32(dtDetail.Rows[0]["Partner_ID"]),
                                                       "VNM",
                                                       "WAP",
                                                       AppEnv.CheckFreeContentTelco(),
                                                       Constant.T_VietnamobileWap,
                                                       "",
                                                       "",
                                                       112,
                                                       ConvertUtility.ToInt32(price)
                                                       );

                    if (url.StartsWith("-1")) // if Non-Success : FIX TRA VE 1 LINK GAME VMG
                    {
                        url = gameUrl.VMG_ReturnUrlForGame("8629",
                                                           0,
                                                           AppEnv.CheckFreeContentMsisdn(),
                                                           ConvertUtility.ToInt32(dtDetail.Rows[0]["Partner_ID"]),
                                                           "VNM",
                                                           "WAP",
                                                           AppEnv.CheckFreeContentTelco(),
                                                           Constant.T_VietnamobileWap,
                                                           "", "", 112, ConvertUtility.ToInt32(price));
                    }

                    int indexofhttp = url.IndexOf("http://");
                    if (indexofhttp == -1)
                    {
                        url = "http://" + url;
                    }
                    else
                    {
                        url = url.Substring(indexofhttp);
                    }
                }
                catch (Exception ex) { url = ""; }

                lnkDownload.NavigateUrl = url;
                if (freecate == false)
                {
                    if (isLog)
                    {
                        Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, url, id.ToString(), chitietGiaodich, 3);
                        GameController.SetGamePrice(Session["msisdn"].ToString(), url, Constant.T_VietnamobileWap, ConvertUtility.ToInt32(price));
                    }
                    //GameController.SetDownloadCounter(AppEnv.CheckFreeContentTelco(), id);
                }
                GameController.SetDownloadCounter(AppEnv.CheckFreeContentTelco(), 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 + " » " + 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, 3, messageReturn);
                }
                //--Thông báo lỗi thanh toán
            }
            if (freecate == false)
            {
                if (isLog)
                {
                    //log charging
                    ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                    logger.Debug("--------------------------------------------------");
                    logger.Debug("MSISDN:" + Session["msisdn"].ToString());
                    logger.Debug("Dich vu: Game - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["GameName"].ToString() + " - id: " + id);
                    logger.Debug("Game Url:" + lnkDownload.NavigateUrl);
                    logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                    logger.Debug("Error:" + messageReturn);
                    logger.Debug("Current Url:" + Request.RawUrl);
                    //end log
                }
            }
        }
예제 #2
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean isLog)
        {
            pnlNoiDung.Visible = true;

            id = ConvertUtility.ToInt32(Request.QueryString["id"]);
            DataTable dtDetail = PhanmemController.GetAPPDetailByID(AppEnv.CheckFreeContentTelco(), id);

            //chitietGiaodich = "Phần mềm: " + dtDetail.Rows[0]["AppNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            chitietGiaodich = "Phần mềm: " + dtDetail.Rows[0]["AppNameUnicode"].ToString() + " -- id:" + id.ToString();
            if (thuchien)
            {
                if (lang == "1")
                {
                    ltrTieuDe.Text   = linkStr;
                    lblTen.Text      = dtDetail.Rows[0]["AppNameUnicode"].ToString();
                    lnkDownload.Text = Resources.Resource.wBamDeTai;
                    ltrNoiDung.Text  = Resources.Resource.wMuaThanhCong + " phần mềm " + dtDetail.Rows[0]["AppNameUnicode"].ToString();
                }
                else
                {
                    ltrTieuDe.Text   = linkStr_KD;
                    lblTen.Text      = dtDetail.Rows[0]["AppName"].ToString();
                    lnkDownload.Text = Resources.Resource.wBamDeTai_KD;
                    ltrNoiDung.Text  = Resources.Resource.wMuaThanhCong_KD + " phan mem " + dtDetail.Rows[0]["AppName"].ToString();
                }
                string url;
                try
                {
                    VMGGame.MOReceiver urlservice = new VMGGame.MOReceiver();
                    url = urlservice.VMG_ReturnUrlForApplication(ConvertUtility.ToString(dtDetail.Rows[0]["AppID"]), 0, AppEnv.CheckFreeContentMsisdn(), ConvertUtility.ToInt32(dtDetail.Rows[0]["Partner_ID"]), "XZONE", "WAP", AppEnv.CheckFreeContentTelco(), "WAP.XZONE.VN", "", "");
                    int indexofhttp = url.IndexOf("http://");
                    if (indexofhttp == -1)
                    {
                        url = "http://" + url;
                    }
                    else
                    {
                        url = url.Substring(indexofhttp);
                    }
                }
                catch { url = ""; }
                lnkDownload.NavigateUrl = url;
                //lnkDownload.NavigateUrl = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "4", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString()));
                if (isLog)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 4);
                }
                PhanmemController.SetDownloadCounter(AppEnv.CheckFreeContentTelco(), 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;
                }

                if (isLog)
                {
                    Transaction.Failure(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 4, messageReturn);
                }

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

            if (isLog)
            {
                //log charging
                ILog logger = log4net.LogManager.GetLogger(AppEnv.CheckFreeContentTelco());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN:" + Session["msisdn"].ToString());
                logger.Debug("Dich vu: Phan mem - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["AppName"].ToString() + " - id: " + id);
                logger.Debug("Phan mem Url:" + lnkDownload.NavigateUrl);
                logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error:" + messageReturn);
                logger.Debug("Current Url:" + Request.RawUrl);
                //end log
            }
        }
예제 #3
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean isLog)
        {
            pnlNoiDung.Visible = true;

            gameid = Request.QueryString["id"];//ThethaoController.GetSport_GameDetailBySportID(ConvertUtility.ToInt32(Request.QueryString["id"])).Rows[0]["PK_Game_ID"].ToString();
            DataTable sportinfo = ThethaoController.GetSport_GameDetailByID(gameid);

            //string chitietGiaodich = "Ket qua cho tran dau: " + sportinfo.Rows[0]["Team_Name1"].ToString() + " - " + sportinfo.Rows[0]["Team_Name2"].ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            string chitietGiaodich = "Ket qua cho tran dau: " + sportinfo.Rows[0]["Team_Name1"] + " - " + sportinfo.Rows[0]["Team_Name2"];

            if (thuchien)
            {
                //insertMT
                string smscontent = "Bạn đã đăng ký thành công dịch vụ Kết quả chờ trận đấu " + sportinfo.Rows[0]["Team_Name1"].ToString() + " - " + sportinfo.Rows[0]["Team_Name2"].ToString() + ". Cảm ơn bạn đã sử dụng dịch vụ.";
                mt              = new MTInfo();
                mt.User_ID      = Session["msisdn"].ToString();
                mt.Message      = UnicodeUtility.UnicodeToKoDau(smscontent);
                mt.Service_ID   = ConfigurationSettings.AppSettings.Get("kqchocommandcode");
                mt.Command_Code = ConfigurationSettings.AppSettings.Get("kqchocode");
                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   = 4;//servicetype of kq cho;
                MTController.SmsMtInsert(mt);
                //insert mt waitting
                mtwaitting               = new MTWaittingInfo();
                mtwaitting.User_ID       = Session["msisdn"].ToString();
                mtwaitting.Message       = "";
                mtwaitting.Service_ID    = ConfigurationSettings.AppSettings.Get("kqchocommandcode");
                mtwaitting.Command_Code  = ConfigurationSettings.AppSettings.Get("kqchocode");
                mtwaitting.Message_Type  = (int)Constant.MessageType.FREE;
                mtwaitting.Request_ID    = random.Next(100000000, 999999999).ToString();
                mtwaitting.Total_Message = 10;
                mtwaitting.Message_Index = 1;
                mtwaitting.IsMore        = 0;
                mtwaitting.Content_Type  = 0;
                mtwaitting.ServiceType   = 4;//dv  ket qua cho
                mtwaitting.UniqueId      = gameid;
                mtwaitting.ExpiredDate   = DateTime.Now.AddDays(10);
                mtwaitting.PartnerID     = string.Empty;
                mtwaitting.Operator      = AppEnv.CheckFreeContentMsisdn();
                MTController.SMS_MTWaittingInsert(mtwaitting);
                //insert wap transaction

                //
                if (lang == "1")
                {
                    ltrTieuDe.Text  = "BÓNG ĐÁ";
                    lblTen.Text     = "Kết quả chờ trận đấu";
                    ltrNoiDung.Text = smscontent;
                }
                else
                {
                    ltrTieuDe.Text  = "BONG DA";
                    lblTen.Text     = "Ket qua cho tran dau";
                    ltrNoiDung.Text = UnicodeUtility.UnicodeToKoDau(smscontent);
                }

                if (isLog)
                {
                    Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, Request.Url.ToString(), gameid, chitietGiaodich, 8);
                }
            }
            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(), gameid, chitietGiaodich, 8, messageReturn);
                }
                //--Thông báo lỗi thanh toán
            }

            if (isLog)
            {
                //log charging
                ILog logger = log4net.LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug("MSISDN: " + Session["msisdn"].ToString());
                logger.Debug("Dich vu: Ket qua cho (truc tiep) " + gameid);
                logger.Debug("Chi tiet: " + chitietGiaodich);
                logger.Debug("IP: " + HttpContext.Current.Request.UserHostAddress);
                logger.Debug("Error: " + messageReturn);
                logger.Debug("Current Url: " + Request.RawUrl);
                //end log
            }
        }