Ejemplo n.º 1
0
        protected void HienThiNoiDung(Boolean thuchien, Boolean isLog)
        {
            pnlNoiDung.Visible = true;

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

            //chitietGiaodich = "Phần mềm: " + dtDetail.Rows[0]["AppNameUnicode"] + " -- id:" + id + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]);
            chitietGiaodich = "Phần mềm: " + dtDetail.Rows[0]["AppNameUnicode"] + " -- id:" + id;
            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
                {
                    string appId     = ConvertUtility.ToString(dtDetail.Rows[0]["AppID"]);
                    string msisdn    = ConvertUtility.ToString(AppEnv.CheckMsisdn());
                    int    partnerId = ConvertUtility.ToInt32(dtDetail.Rows[0]["Partner_ID"]);
                    string telco     = ConvertUtility.ToString(AppEnv.CheckSessionTelco());

                    var urlservice = new VMGGame.MOReceiver();
                    url = urlservice.VMG_ReturnUrlForApplication(
                        appId,
                        0,
                        msisdn,
                        partnerId,
                        "XZONE",
                        "WAP",
                        telco,
                        "WAP.XZONE.VN",
                        "",
                        "");

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

                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 = LogManager.GetLogger(Session["telco"].ToString());
                logger.Debug("--------------------------------------------------");
                logger.Debug(string.Format("MSISDN:{0}", Session["msisdn"]));
                logger.Debug(string.Format("Dich vu: Phan mem - parameter: {0} - Ten: {1} - id: {2}", price, dtDetail.Rows[0]["AppName"], 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
            }
        }