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 }
protected void HienThiNoiDung(Boolean thuchien) { pnlNoiDung.Visible = true; id = ConvertUtility.ToInt32(Request.QueryString["id"]); DataTable dtDetail = GameController.GetGameDetailByID(Session["telco"].ToString(), id); chitietGiaodich = "Game: " + dtDetail.Rows[0]["GameNameUnicode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]); SoDT = MobileUtils.ToSTDMobileNumber(SoDT); if (thuchien) { ltrTieuDe.Text = linkStr; if (lang == "1") { lblTen.Text = dtDetail.Rows[0]["GameNameUnicode"].ToString(); ltrNoiDung.Text = Resources.Resource.wTangThanhCong + " game " + dtDetail.Rows[0]["GameNameUnicode"].ToString() + " (" + dtDetail.Rows[0]["Game_Code"].ToString() + ")"; } else { lblTen.Text = dtDetail.Rows[0]["GameName"].ToString(); ltrNoiDung.Text = Resources.Resource.wTangThanhCong_KD + " game " + dtDetail.Rows[0]["GameName"].ToString() + " (" + dtDetail.Rows[0]["Game_Code"].ToString() + ")"; }; string url; //if (",1,2,3,6,12,".LastIndexOf("," + ConvertUtility.ToString(dtDetail.Rows[0]["Partner_ID"]) + ",") == -1) //{ // url = UrlProcess.GetGameDownloadItem(Session["telco"].ToString(), "3", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString())); //} //else //{ // GameUrl.MOReceiver urlservice = new WapXzone_VNM.GameUrl.MOReceiver(); // url = urlservice.ReturnWapUrlForGame(ConvertUtility.ToInt32(dtDetail.Rows[0]["GID"])); // if (url.IndexOf("http://") == -1) // { // url = "http://" + url; // } //} VMGGame.MOReceiver urlservice = new VMGGame.MOReceiver(); url = urlservice.VMG_ReturnUrlForGame(ConvertUtility.ToString(dtDetail.Rows[0]["GID"]), 0, ConvertUtility.ToString(Session["msisdn"]), ConvertUtility.ToInt32(dtDetail.Rows[0]["Partner_ID"]), "XZONE", "WAP", Session["telco"].ToString(), "WAP.XZONE.VN", "", ""); int indexofhttp = url.IndexOf("http://"); if (indexofhttp == -1) { url = "http://" + url; } else { url = url.Substring(indexofhttp); } MTInfo mtInfo = new MTInfo(); Random random = new Random(); mtInfo.Service_ID = ConfigurationSettings.AppSettings.Get("gamecommandcode"); mtInfo.Command_Code = ConfigurationSettings.AppSettings.Get("gamecode"); mtInfo.Message_Type = (int)Constant.MessageType.FREE; mtInfo.Total_Message = 1; mtInfo.Message_Index = 0; mtInfo.IsMore = 0; if (freecate == false) { //Thông báo cho người được tặng mtInfo.User_ID = SoDT; mtInfo.Request_ID = random.Next(100000000, 999999999).ToString(); mtInfo.Content_Type = 0; mtInfo.Message_Type = (int)Constant.MessageType.FREE; mtInfo.Message = "Ban nhan duoc qua tang game " + dtDetail.Rows[0]["GameName"].ToString() + " tu so dien thoai " + "0" + ConvertUtility.ToString(Session["msisdn"]).Remove(0, 2); MTController.SmsMtInsert(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 game " + dtDetail.Rows[0]["GameName"].ToString() + " toi so dt " + SoDT; mtInfo.Message_Type = (int)Constant.MessageType.FREE; mtInfo.Request_ID = random.Next(100000000, 999999999).ToString(); MTController.SmsMtInsert(mtInfo); } //Build waplink send to customer and insert to MT table mtInfo.User_ID = SoDT; mtInfo.Message = "Tai game 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.SmsMtInsert(mtInfo); if (freecate == false) { Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, url, id.ToString(), chitietGiaodich, 3); GameController.SetDownloadCounter(Session["telco"].ToString(), 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; } 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) { //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: Game - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["GameName"].ToString() + " - id: " + id); logger.Debug("Game Url:" + ConvertUtility.ToString(lnkDownload.NavigateUrl)); logger.Debug("IP:" + HttpContext.Current.Request.UserHostAddress); logger.Debug("Error:" + messageReturn); logger.Debug("Current Url:" + Request.RawUrl); //end log } }