public static bool CheckAccount(string _email, string _password) { int userID = 0; SqlConnection dbConn = new SqlConnection(AppEnv.ConnectionString); SqlCommand dbCmd = new SqlCommand("Main_Members_CheckAccount", dbConn); dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.AddWithValue("@Email", _email); dbCmd.Parameters.AddWithValue("@Password", SecurityMethod.MD5Encrypt(_password)); try { dbConn.Open(); SqlDataReader dr = dbCmd.ExecuteReader(); if (dr.Read()) { userID = dr.GetInt32(0); } else { userID = 0; } } finally { dbConn.Close(); } return(userID > 0); }
protected void Page_Load(object sender, EventArgs e) { ILog logger = LogManager.GetLogger("DoGetDownloadURL"); try { string msisdn = Request.QueryString["Msisdn"]; string reqTime = Request.QueryString["reqTime"]; string shortCode = Request.QueryString["shortcode"]; string reqId = Request.QueryString["reqId"]; string username = Request.QueryString["username"]; string password = Request.QueryString["password"]; string gameId = Request.QueryString["GameID"]; logger.Debug(" "); logger.Debug(" "); logger.Debug("----- VMS API CALL DoGetDownloadURL ----- :" + "msisdn : " + msisdn + " |reqTime : " + reqTime + " |shortCode : " + shortCode + " |reqId : " + reqId + " |userName : "******" |password : "******" |GameId : " + gameId); logger.Debug(" "); logger.Debug(" "); if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(password)) { var item = new VmsAppboxGamelinkLog(); item.GameId = ConvertUtility.ToInt32(gameId); item.Msisdn = msisdn; item.ReqTime = reqTime; item.ShortCode = shortCode; item.ReqId = reqId; item.UserName = username; item.Password = password; ApiController.ApiVmsAppboxGamelinkLog(item); string key = DateTime.Now.ToString("ddMMyyyy") + gameId; key = SecurityMethod.MD5Encrypt(key); string strValue = string.Format("gameid={0}|reqid={1}|msisdn={2}|key={3}|source={4}|type={5}", gameId, reqId, msisdn, key, "WAP", "2"); byte[] dataEncode = Encoding.UTF8.GetBytes(strValue); Base64Encoder myEncoder = new Base64Encoder(dataEncode); StringBuilder encodevaulue = new StringBuilder(); encodevaulue.Append(myEncoder.GetEncoded()); string url = "http://vmgame.vn/wap/dlgame.ashx?value=" + encodevaulue; logger.Debug("----- VMS API CALL DoGetDownloadURL URL RESPONSE ----- :" + url); Response.Write(url); } } catch (Exception ex) { logger.Debug(" "); logger.Debug(" "); logger.Debug("----- VMS API CALL DoGetDownloadURL ----- :" + ex); logger.Debug(" "); logger.Debug(" "); } }
/// <summary> /// Get user by userName /// </summary> /// <param name="userName"></param> /// <param name="password"></param> /// <returns></returns> public UserInfo GetUser(string userName, string password) { try { var ctx = SingletonIpl.GetInstance <SqlDataProvider>(); var user = ctx.GetUser(userName, SecurityMethod.MD5Encrypt(password)); return(user); } catch (Exception) { return(null); } }
/// <summary> /// Validation UserName & Password /// </summary> /// <param name="userName"></param> /// <param name="password"></param> /// <returns></returns> public bool IsAuthenticated(string userName, string password) { try { var ctx = SingletonIpl.GetInstance <SqlDataProvider>(); return(ctx.IsAuthenticated(userName, SecurityMethod.MD5Encrypt(password))); } catch (Exception) { return(false); } }
protected void btLogin_Click(object sender, EventArgs e) { string returnUrl = Request.QueryString["returnUrl"]; if ((UserController.ValidateUser(txtUsername.Text.Trim(), SecurityMethod.MD5Encrypt(txtPassword.Text.Trim())) != null)) { AuthenticateUtility.LoginUser(txtUsername.Text.Trim(), true); AppEnv.SetLanguage("vi-VN"); Response.Redirect("/Authenticate.aspx"); } else { //Response.Write("NULL"); } }
protected void cmdUpdate_Click(object sender, EventArgs e) { if (SecurityMethod.MD5Encrypt(txtCurPwd.Text) != CurrentAdminInfo.User_Password) { lblUpdateStatus.Text = "<font color='red'>Mật khẩu cũ không đúng !</font>"; return; } CurrentAdminInfo.User_Password = SecurityMethod.MD5Encrypt(txtNewPwd.Text); try { UserDB.Update(CurrentAdminInfo); lblUpdateStatus.Text = MiscUtility.UPDATE_SUCCESS; } catch { lblUpdateStatus.Text = MiscUtility.UPDATE_ERROR; } }
protected void cmdUpdate_Click(object sender, EventArgs e) { int userID = ConvertUtility.ToInt32(txtID.Text); UserInfo info = UserDB.GetInfo(userID); if (info == null) { return; } info.User_Email = txtEmail.Text.Trim(); info.User_FullName = txtFullName.Text; if (txtPassword.Text.Trim() != string.Empty) { info.User_Password = SecurityMethod.MD5Encrypt(txtPassword.Text.Trim()); } info.User_Gender = (dropGender.SelectedValue == "1") ? true : false; info.User_Address = txtAddress.Text; info.User_Birthday = txtBirthDay.Text; info.User_Phone = txtPhone.Text; info.User_SuperAdmin = chkIsSuperAdmin.Checked; try { UserDB.Update(info); foreach (ListItem item in lstGroups.Items) { if (item.Selected) { GroupMemberDB.AddUser(info.User_ID, Convert.ToInt32(item.Value)); } else { GroupMemberDB.RemoverUser(info.User_ID, Convert.ToInt32(item.Value)); } } lblUpdateStatus.Text = MiscUtility.UPDATE_SUCCESS; } catch { lblUpdateStatus.Text = MiscUtility.UPDATE_ERROR; } }
protected void btnUpdate_Click(object sender, EventArgs e) { if (txtPassword.Text.Trim() != string.Empty && txtPassword.Text.Trim() == txtPasswordConfirm.Text.Trim()) { try { UserController.ResetPassword(userId, SecurityMethod.MD5Encrypt(txtPassword.Text.Trim())); lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_SUCCESS; } catch (Exception ex) { lblUpdateStatus.Text = ex.Message; } } else { lblUpdateStatus.Text = "Mật khẩu không đúng"; } }
protected void cmdAddNew_Click(object sender, EventArgs e) { UserInfo info = new UserInfo(); info.User_Email = txtEmail.Text.Trim(); info.User_FullName = txtFullName.Text; info.User_Password = SecurityMethod.MD5Encrypt(txtPassword.Text.Trim()); info.User_Gender = (dropGender.SelectedValue == "1") ? true : false; info.User_Address = txtAddress.Text; info.User_Birthday = txtBirthDay.Text; info.User_Phone = txtPhone.Text; info.User_SuperAdmin = chkIsSuperAdmin.Checked; try { txtID.Text = UserDB.Insert(info).ToString(); foreach (ListItem item in lstGroups.Items) { if (item.Selected) { GroupMemberDB.AddUser(Convert.ToInt32(txtID.Text), Convert.ToInt32(item.Value)); } else { GroupMemberDB.RemoverUser(Convert.ToInt32(txtID.Text), Convert.ToInt32(item.Value)); } } //Response.Write(FormsAuthentication.HashPasswordForStoringInConfigFile(txtPassword.Text.Trim(), "md5")); //Response.Write("<br />"); //Response.Write(SecurityMethod.MD5Encrypt(txtPassword.Text.Trim())); lblUpdateStatus.Text = MiscUtility.UPDATE_SUCCESS; } catch { lblUpdateStatus.Text = MiscUtility.UPDATE_ERROR; } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Session["msisdn"] == null) { int is3g = 0; string msisdn = MobileUtils.GetMSISDN(out is3g); if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile")) { Session["telco"] = Constant.T_Vietnamobile; Session["msisdn"] = msisdn; } else { Session["msisdn"] = null; Session["telco"] = Constant.T_Undefined; } } string k = Request.QueryString["k"]; string key = DateTime.Now.ToString("yyyyMMdd"); string en = SecurityMethod.MD5Encrypt(key); if (en == k) { Session["ChargedOk"] = "OK"; DataTable dt = TintucController.GetRandomForSmile(); string link = "/Thugian/Download.aspx?id=" + dt.Rows[0]["Distribution_ID"] + "&lang=1&w=320"; Response.Redirect(link); } else { Response.Redirect(AppEnv.GetSetting("WapDefault")); } } }
void rptHinhNen_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } HyperLink lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); HyperLink lnkTenAnh = (HyperLink)e.Item.FindControl("lnkTenAnh"); DataRowView row = (DataRowView)e.Item.DataItem; string download = AppEnv.GetSetting("VNMdownload"); lnkTenAnh.NavigateUrl = lnkAvatar.NavigateUrl = download + "?type=1&id=" + row["ID"] + "&code=" + SecurityMethod.MD5Encrypt(row["ID"].ToString()); if (lang == "1") { lnkTenAnh.Text = row["Wallpaper_Name"].ToString(); } else { lnkTenAnh.Text = UnicodeUtility.UnicodeToKoDau(row["Wallpaper_Name"].ToString()); } if (e.Item.ItemIndex < Count - 1) { Literal litBlank = (Literal)e.Item.FindControl("litBlank"); if (litBlank != null) { litBlank.Text = "<table width=\"100%\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#FFFFFF\"><tr><td align=\"left\" valign=\"top\"><img alt=\"\" src=\"/imagesnew/blank.gif\" width=\"5\" height=\"9\" /></td></tr></table>"; } } }
/// <summary> /// Reset password /// </summary> /// <param name="userId"></param> /// <param name="password"></param> public void ResetPassword(long userId, string password) { var ctx = SingletonIpl.GetInstance <SqlDataProvider>(); ctx.ResetPassword(userId, SecurityMethod.MD5Encrypt(password)); }
protected void btnUpdate_Click(object sender, EventArgs e) { if (Page.IsValid) { try { int userId = ConvertUtility.ToInt32(Request.QueryString["uid"]); UserInfo user = new UserInfo(); user.Username = txtUsername.Text.Trim(); user.DisplayName = txtDisplayName.Text.Trim(); user.IsAdmin = chkIsAdmin.Checked; user.IsSuperAdmin = chkIsSuperAdmin.Checked; user.MaSo = txtMaSo.Text.Trim(); user.HoTen = txtFullName.Text.Trim(); user.NgaySinh = ConvertUtility.ToDateTime(txtNgaySinh.Text.Trim()); user.GioiTinh = ConvertUtility.ToInt32(dropGioiTinh.SelectedValue); user.IDChucVu = ConvertUtility.ToInt32(dropChucVu.SelectedValue); user.IDTrungTam = ConvertUtility.ToInt32(dropTrungTam.SelectedValue); user.IDPhong = ConvertUtility.ToInt32(dropPhong.SelectedValue); user.NoiSinh = txtNoiSinh.Text.Trim(); user.NguyenQuan = txtNguyenQuan.Text.Trim(); user.QuocTich = txtQuocTich.Text.Trim(); user.DanToc = txtDanToc.Text.Trim(); user.TonGiao = txtTonGiao.Text.Trim(); user.DiaChiThuongChu = txtDiaChiThuongChu.Text.Trim(); user.DiaChiTamChu = txtDiaChiTamChu.Text.Trim(); user.TrangThai = ConvertUtility.ToInt32(dropTrangThai.SelectedValue); if (userId > 0) { user.UserID = userId; UserController.UpdateUser(user); lblUpdateStatus.Text = MiscUtility.MSG_UPDATE_SUCCESS; } else { if (txtPassword.Text.Trim() != txtPasswordConfirm.Text.Trim()) { return; } user.Password = SecurityMethod.MD5Encrypt(txtPassword.Text.Trim()); userId = UserController.AddUser(user); if (userId > 0) { RoleController.AddUserToRole(userId, AppEnv.DEFAULT_ROLE, AppEnv.PortalId()); Response.Redirect(AppEnv.AdminUrlParams("createuser") + "&uid=" + userId); } else { lblUpdateStatus.Text = "Tên đăng nhập lại đã tồn tại."; } } } catch (Exception ex) { lblUpdateStatus.Text = ex.Message; } } }
protected void Page_Load(object sender, EventArgs e) { string Msisdn = ConvertUtility.ToString(Request.QueryString["msisdn"]); string ID = ConvertUtility.ToString(Request.QueryString["id"]); string Type = ConvertUtility.ToString(Request.QueryString["type"]); string ck = ConvertUtility.ToString(Request.QueryString["ck"]); string md5 = SecurityMethod.MD5Encrypt(Msisdn + ID); string model = AppEnv.GetUserAgent(); if (Msisdn != String.Empty) { Session["msisdn"] = Msisdn; if (!string.IsNullOrEmpty(Msisdn) && MobileUtils.CheckOperator(Msisdn, "vietnammobile")) { Session["telco"] = Constant.T_Vietnamobile; } else { Session["msisdn"] = null; Session["telco"] = Constant.T_Undefined; } //CheckSum string str_check = Msisdn + ID; if (SecurityMethod.MD5Encrypt(str_check) == ck) { //Check ID dịch vụ if (ID != string.Empty) { DataTable dt = S2_TTKD_ServiceConfig_GetInfo(ConvertUtility.ToInt32(ID)); if (dt != null && dt.Rows.Count > 0) { string Link_Detail_Smartphone = dt.Rows[0]["Link_Detail_Smartphone"].ToString(); string Link_Default_Smartphone = dt.Rows[0]["Link_Default_Smartphone"].ToString(); string Link_Detail = dt.Rows[0]["Link_Detail"].ToString(); string Link_Default = dt.Rows[0]["Link_Default"].ToString(); if (Type != String.Empty) { if (model == "high") { Response.Redirect(Link_Detail_Smartphone); } else { Response.Redirect(Link_Detail); //Response.Redirect(Link_Detail_Smartphone); } //Vào trang chi tiết //lblStatus.Text = "Vào trang chi tiết"; //Response.Redirect(LinkDetail); } else { if (model == "high") { Response.Redirect(Link_Default_Smartphone); } else { Response.Redirect(Link_Default); //Response.Redirect(Link_Default_Smartphone); } //Vào trang mặc định //lblStatus.Text = "Vào trang mặc định"; //Response.Redirect(LinkDefault); } } } else { //Lỗi ko có ID dịch vụ //lblStatus.Text = "Lỗi ko có ID dịch vụ"; lblAlert.Text = "Lỗi ko có ko có dịch vụ, vui lòng xem lại !"; litScript.Text = ("<script type=\"text/javascript\">$(function () {$(\"#popup-login\").modal(); }) </script>"); } } else { //Lỗi MD5(msisdn+id) != ck //lblStatus.Text = "Lỗi MD5(msisdn+id) != ck"; lblAlert.Text = "Số điện thoại hoặc dịch vụ không đúng, vui lòng xem lại !"; litScript.Text = ("<script type=\"text/javascript\">$(function () {$(\"#popup-login\").modal(); }) </script>"); } } else { //Thông báo ko có SĐT //lblStatus.Text = "Lỗi ko có ko có SĐT"; //lblAlert.Text = "Lỗi ko có ko có số điện thoại, vui lòng xem lại !"; //litScript.Text = ("<script type=\"text/javascript\">$(function () {$(\"#popup-login\").modal(); }) </script>"); } }
void rptItem_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } HyperLink lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); Image imgAvatar = (Image)e.Item.FindControl("imgAvatar"); HyperLink lnkTen = (HyperLink)e.Item.FindControl("lnkTen"); DataRowView row = (DataRowView)e.Item.DataItem; string download = AppEnv.GetSetting("VNMdownload"); imgAvatar.ImageUrl = "http://media.xzone.vn/" + row["Path"].ToString().Replace("~/", ""); lnkTen.NavigateUrl = lnkAvatar.NavigateUrl = download + "?type=1&id=" + row["ID"].ToString() + "&code=" + SecurityMethod.MD5Encrypt(row["ID"].ToString()); if (lang == "1") { lnkTen.Text = row["Wallpaper_Name"].ToString(); } else { lnkTen.Text = UnicodeUtility.UnicodeToKoDau(row["Wallpaper_Name"].ToString()); } }
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 rptlstCategory_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } DataRowView curData = (DataRowView)e.Item.DataItem; Image imgAvatar = (Image)e.Item.FindControl("imgAvatar"); HyperLink lnkAvatar = (HyperLink)e.Item.FindControl("lnkAvatar"); HyperLink lnkTenAnh = (HyperLink)e.Item.FindControl("lnkTenAnh"); //Literal ltrTheloai = (Literal)e.Item.FindControl("ltrTheloai"); Literal ltrLuottai = (Literal)e.Item.FindControl("ltrLuottai"); HyperLink lnkTai = (HyperLink)e.Item.FindControl("lnkTai"); //HyperLink lnkTang = (HyperLink)e.Item.FindControl("lnkTang"); string sGioiThieu; lnkTenAnh.Text = "<span class=\"bold\">" + curData["Name"] + "</span>"; //ltrTheloai.Text = Resources.Resource.wTheLoai + curData["Web_Name"].ToString(); sGioiThieu = curData["Description"].ToString(); if (sGioiThieu.Length > 120) { sGioiThieu = sGioiThieu.Substring(0, sGioiThieu.LastIndexOf(" ", 110)) + "..."; } ltrLuottai.Text = Resources.Resource.wGioiThieu + sGioiThieu; lnkTai.Text = "<span class=\"orange bold\">" + Resources.Resource.wTai + "</span>"; string url = AppEnv.GetSetting("JavaGameDownloadPartner") + "?id=" + curData["GameID"] + "&code=" + SecurityMethod.MD5Encrypt(curData["GameID"] + "_" + msisdn) + "&msisdn=" + msisdn; lnkAvatar.NavigateUrl = lnkTenAnh.NavigateUrl = url; lnkTai.NavigateUrl = url; CreateAvatar.MOReceiver ws = new CreateAvatar.MOReceiver(); ws.GenerateAvatarThumnail(curData["Avatar"].ToString(), 60, 70); imgAvatar.ImageUrl = preurl + MultimediaUtility.GetAvatarThumnail(curData["Avatar"].ToString(), 60, 70).Replace("~", ""); }
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; } }
protected void Page_Load(object sender, EventArgs e) { Session["LastPage"] = Request.RawUrl; lang = Request.QueryString["lang"]; if (!IsPostBack) { width = ConvertUtility.ToInt32(Request.QueryString["w"]); if (width == 0) { width = (int)Constant.DefaultScreen.Standard; } ltrWidth.Text = "<meta content=\"width=" + width.ToString() + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />"; // var advertisement = new Advertisement { Channel = "Home", Position = "HomeCenter", Param = 0, Lang = lang, Width = width.ToString() }; litAds.Text = advertisement.GetAds(); var advertisement1 = new Advertisement { Channel = "Home", Position = "UnderLinks", Param = 0, Lang = lang, Width = width.ToString() }; litAds1.Text = advertisement1.GetAds(); } if (string.IsNullOrEmpty(Request.QueryString["display"])) { display = "home"; } else { display = Request.QueryString["display"]; } Literal title = new Literal(); Literal ltrEnd = new Literal(); Literal ltrEnd1 = new Literal(); try { string wapHomeURL = "http://wap.vietnamobile.com.vn"; DataTable dtMusic = GameController.GetAllGame_ByPackageID(ConvertUtility.ToInt32(AppEnv.GetSetting("packageIdGame"))); title.Text = "<style type=\"text/css\">body {font-family:Verdana, Arial, Helvetica; font-size:12px;} .mainmenu {display:block;width: 100%;background-color: #de60cb;color:#fff;text-align:center;line-height:25px;} .mainmenu a{color:#fff;} a:link, a:visited {text-decoration:none;}</style>"; if (lang == "1") { title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chào mừng bạn đến với dịch vụ game <b style=\"color:blue\">(Miễn Phí)</b> của Vietnamobile" + "</div>"; } else { title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chao mung ban den voi dich vu game <b style=\"color:blue\">(Miễn Phí)</b> cua Vietnamobile" + "</div>"; } //title.Text += "<div style=\"padding-left:5px;margin:5px 0 5px 0;\">Click để tải:"; plList.Controls.Add(title); foreach (DataRow row in dtMusic.Rows) { HyperLink lnkfile = new HyperLink(); //Literal ltr = new Literal(); //ltr.Text = "</br>"; if (lang == "1") { lnkfile.Text = row["Name"].ToString(); } else { lnkfile.Text = UnicodeUtility.UnicodeToKoDau(row["Name"].ToString()); } lnkfile.NavigateUrl = AppEnv.GetSetting("JavaGameDownload") + "?id=" + row["GameID"] + "&type=3" + "&code=" + SecurityMethod.MD5Encrypt(row["GameID"].ToString()); lnkfile.Attributes.Add("style", "color:#006CBF;padding-left:15px;padding-top:5px;padding-bottom:5px;display:block"); lnkfile.Attributes.Add("class", "bold"); //plList.Controls.Add(ltr); plList.Controls.Add(lnkfile); } //Khuyen mai ltrEnd1.Text = "</div><div style=\"border-bottom: 1px solid #790083;height: 7px; margin: 5px 0 10px 0; width: 100%;\"></div>"; ltrEnd.Text = "</div><div style=\"height: 7px; margin: 5px 0 0px 0; width: 100%;\"></div>"; ltrEnd.Text += "<div style=\"background-color: #EA6A00; color: #FFFFFF; display: block; line-height: 25px; text-align: center; width: 100%;\">"; ltrEnd.Text += "<a style=\"color:#fff\" href=\"" + wapHomeURL + "\">Trang chủ</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Game/Default.aspx?lang=1&display=home&hotro=0\">Game</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Music/Default.aspx?lang=1&display=home\">Nhạc</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Thethao/Default.aspx?lang=1&display=home\">Bóng đá</a></div>"; plList.Controls.Add(ltrEnd); } catch (Exception ex) { Response.Write(ex.ToString()); } }
protected void rptGameFree_ItemDataBound(object sender, RepeaterItemEventArgs e) { if (e.Item.ItemIndex < 0) { return; } DataRowView curData = (DataRowView)e.Item.DataItem; HyperLink lnkFile = (HyperLink)e.Item.FindControl("lnkFile"); if (lnkFile != null) { if (lang == 1) { lnkFile.Text = curData["Name"].ToString(); } else { lnkFile.Text = UnicodeUtility.UnicodeToKoDau(curData["Name"].ToString()); } lnkFile.NavigateUrl = AppEnv.GetSetting("JavaGameDownload") + "?id=" + curData["GameID"] + "&type=3" + "&code=" + SecurityMethod.MD5Encrypt(curData["GameID"].ToString()); } }
protected void butRegister_Click(object sender, EventArgs e) { try { if (chkAgree.Checked) { string email = txtEmail.Text.Trim(); string password = txtPassword.Text.Trim(); string confirmpassword = txtConfirmPassword.Text.Trim(); string fullname = txtFullName.Text.Trim(); if (ConvertUtility.ToInt32(MemberDB.GetIDByEmail(email)) > 0) { MessageBox.Show("Email này đã được sử dụng trên my-deal.vn"); return; } if (!MiscUtility.CheckEmail(email)) { MessageBox.Show("Email đăng ký không hợp lệ"); return; } if (email.Length == 0 || password.Length == 0 || confirmpassword.Length == 0 || fullname.Length == 0) { MessageBox.Show("Bạn phải điền đầy đủ các trường yêu cầu (*)"); return; } if (password != confirmpassword) { MessageBox.Show("Bạn nhập lại mật khẩu không đúng"); return; } string newpassword = SecurityMethod.MD5Encrypt(password); var memberInfo = new MemberInfo { Member_Email = email, Member_Password = newpassword, Member_Fullname = HTMLUtility.SecureHTML(fullname), Member_Gender = 2, Member_Avatar = "", Member_Tel = "", Member_Address = "", Member_District = "", Member_City = "", Member_Rank = 0, Member_Birthday = DateTime.Now, Member_Active = false, Member_ActiveCode = newpassword, Member_IsForgotPassword = false }; int memberid = MemberDB.Insert(memberInfo); string activeUrl = "http://" + Request.Url.Host + AppEnv.WEB_CMD + "active&code=" + newpassword + "&mi=" + memberid; string manuactiveUrl = "http://" + Request.Url.Host + AppEnv.WEB_CMD + "activemanual"; var sb = new StringBuilder(); sb.Append("Xin chao, "); sb.Append(fullname); sb.Append("<br /><br />Chao mung ban den voi My-Deal.vn!"); sb.Append("<br />De hoan tat thu tuc dang ky, ban hay click vao day de kich hoat tai khoan cua minh"); sb.Append("<br />"); sb.Append("<a href=\"" + activeUrl + "\">" + activeUrl + "</a>"); sb.Append("<br /><br />"); sb.Append("Hoac ban vao duong dan duoi day:"); sb.Append("<br />"); sb.Append(manuactiveUrl); sb.Append("<br />"); sb.Append("<br />"); sb.Append("Va dien vao cac thong tin sau:"); sb.Append("<br />"); sb.Append("<br />"); sb.Append("MI: " + memberid); sb.Append("<br />"); sb.Append("Ma kich hoat: " + newpassword); sb.Append("<br />"); sb.Append("<br />"); sb.Append("Xin chan thanh cam on!"); sb.Append("<br />My-Deal.vn"); string adminEmail = AppEnv.ContactEmail; // new email solution start MailMessage emailmess = new MailMessage(adminEmail, email); emailmess.Subject = "Kich hoat tai khoan tai My-Deal.vn"; emailmess.IsBodyHtml = true; emailmess.Body = sb.ToString(); SmtpClient smtp = new SmtpClient(); if (AppEnv.MailServer.Length == 0) { smtp.Host = "localhost"; } else { smtp.Host = AppEnv.MailServer; } if (AppEnv.MailServerPort.Length == 0) { smtp.Port = 25; } else { smtp.Port = ConvertUtility.ToInt32(AppEnv.MailServerPort); } // if authentication if (AppEnv.MailUsername.Length > 0 && AppEnv.MailPassword.Length > 0) { smtp.Credentials = new NetworkCredential(AppEnv.MailUsername, AppEnv.MailPassword); smtp.DeliveryMethod = SmtpDeliveryMethod.Network; } // if authentication end try { smtp.Send(emailmess); notice.InnerHtml = "<br><br><br><font color=red><b>Email kích hoạt đã được gửi tới hòm thư " + email + ", vui lòng kiểm trả hòm thư đăng ký để hoàn tất thủ tục đăng ký.<br /><br />Xin chân thành cảm ơn</b></font>"; } catch (Exception ex) { notice.InnerHtml = "<br /><br /><br /><font color=red><b>Email kích hoạt đã được gửi tới cho bạn, vui lòng kiểm tra hòm thư đăng ký để hoàn tất thủ tục đăng ký.<br /><br />Xin chân thành cảm ơn.</b></font>"; ErrorReportDB.NewReport(Request.RawUrl, ex.ToString()); } finally { pnRegister.Visible = false; notice.Visible = true; } } else { MessageBox.Show("Bạn phải lựa chọn đồng ý với các điều khỏa của MyDeal"); } } catch (Exception) { throw; } }
protected void HienThiNoiDung(Boolean thuchien, Boolean isLog) { 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(); //} lnkDownload.NavigateUrl = UrlProcess.GetDownloadItem(AppEnv.CheckSessionTelco(), "5", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString())); if (isLog) { Transaction.Success(Session["telco"].ToString(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 5); } VideoController.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, 5, 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("MSISDN:" + Session["msisdn"].ToString()); logger.Debug("Dich vu: Video - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["VTitle"].ToString() + " - id: " + id); logger.Debug("Video 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.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 = HinhNenController.GetWallpaperDetailByID(AppEnv.CheckSessionTelco(), id); if (thuchien) { if (lang == "1") { //ltrTieuDe.Text = linkStr; lblTen.Text = dtDetail.Rows[0]["WTitle_Unicode"].ToString(); lnkDownload.Text = Resources.Resource.wBamDeTai; ltrNoiDung.Text = Resources.Resource.wMuaThanhCong + " hình nền " + dtDetail.Rows[0]["WTitle_Unicode"].ToString() + " (" + dtDetail.Rows[0]["WCode"].ToString() + ")"; } else { //ltrTieuDe.Text = linkStr_KD; lblTen.Text = dtDetail.Rows[0]["WTitle"].ToString(); lnkDownload.Text = Resources.Resource.wBamDeTai_KD; ltrNoiDung.Text = Resources.Resource.wMuaThanhCong_KD + " hình nền " + dtDetail.Rows[0]["WTitle"].ToString() + " (" + dtDetail.Rows[0]["WCode"].ToString() + ")"; } lnkDownload.NavigateUrl = UrlProcess.GetDownloadItem(AppEnv.CheckSessionTelco(), "1", id.ToString(), SecurityMethod.MD5Encrypt(id.ToString())); if (ConvertUtility.ToInt32(dtDetail.Rows[0]["W_CategoryID"]) == ConvertUtility.ToInt32(ConfigurationSettings.AppSettings.Get("thuphapid"))) { if (isLog) { chitietGiaodich = "Thu phap: " + dtDetail.Rows[0]["WCode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]); Transaction.Success(AppEnv.CheckSessionTelco(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 15); } } else { if (isLog) { chitietGiaodich = "Hinh nen: " + dtDetail.Rows[0]["WCode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]); Transaction.Success(AppEnv.CheckSessionTelco(), Session["msisdn"].ToString(), price, lnkDownload.NavigateUrl, id.ToString(), chitietGiaodich, 1); } } //if(isLog) //{ HinhNenController.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 (ConvertUtility.ToInt32(dtDetail.Rows[0]["W_CategoryID"]) == ConvertUtility.ToInt32(ConfigurationSettings.AppSettings.Get("thuphapid"))) { chitietGiaodich = "Thu phap: " + dtDetail.Rows[0]["WCode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]); if (isLog) { Transaction.Failure(AppEnv.CheckSessionTelco(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 15, messageReturn); } } else { chitietGiaodich = "Hinh nen: " + dtDetail.Rows[0]["WCode"].ToString() + " -- id:" + id.ToString() + " -- newtransactionid: " + ConvertUtility.ToString(Session["transactionid"]) + " -- old tranid: " + ConvertUtility.ToString(Session["transactionid_old"]); if (isLog) { Transaction.Failure(AppEnv.CheckSessionTelco(), Session["msisdn"].ToString(), price, Request.Url.ToString(), id.ToString(), chitietGiaodich, 1, 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("MSISDN:" + Session["msisdn"].ToString()); logger.Debug("Dich vu: Hinh nen - parameter: " + price + " - Ten: " + dtDetail.Rows[0]["WTitle"].ToString() + " - id: " + id); logger.Debug("Wallpaper 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 }
protected void Page_Load(object sender, EventArgs e) { lang = Request.QueryString["lang"]; if (string.IsNullOrEmpty(lang)) { Response.Redirect("/Game/GameHot.aspx?w=320&lang=1"); } Session["LastPage"] = Request.RawUrl; if (!IsPostBack) { width = ConvertUtility.ToInt32(Request.QueryString["w"]); if (width == 0) { width = (int)Constant.DefaultScreen.Standard; } ltrWidth.Text = "<meta content=\"width=" + width + "; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;\" name=\"viewport\" />"; // var advertisement = new Advertisement { Channel = "Home", Position = "HomeCenter", Param = 0, Lang = lang, Width = width.ToString() }; litAds.Text = advertisement.GetAds(); var advertisement1 = new Advertisement { Channel = "Home", Position = "UnderLinks", Param = 0, Lang = lang, Width = width.ToString() }; litAds1.Text = advertisement1.GetAds(); #region TU DONG DK SUB GAME if (Session["msisdn"] == null) { int is3g; string msisdn = MobileUtils.GetMSISDN(out is3g); if (!string.IsNullOrEmpty(msisdn) && MobileUtils.CheckOperator(msisdn, "vietnammobile")) { Session["telco"] = Constant.T_Vietnamobile; Session["msisdn"] = msisdn; } else { Session["msisdn"] = null; Session["telco"] = Constant.T_Undefined; } } //string url = UrlProcess.GetGameHomeUrl("1", "320", "0"); if (Session["msisdn"] != null) { string value = AppEnv.RegisterService(AppEnv.GetSetting("S2ShortCode"), "0", Session["msisdn"].ToString(), "DK", "DK GAME"); //ANDY Service S2_94x string[] res = value.Split('|'); if (res.Length > 0) { if (res[0] == "1") //DK THANH CONG { pnlThongBao.Visible = true; } } } #endregion } if (string.IsNullOrEmpty(Request.QueryString["display"])) { display = "home"; } else { display = Request.QueryString["display"]; } Literal title = new Literal(); Literal ltrEnd = new Literal(); Literal ltrEnd1 = new Literal(); try { string wapHomeURL = "http://wap.vietnamobile.com.vn"; DataTable dtMusic = GameController.GetAllGame_ByPackageID(ConvertUtility.ToInt32(AppEnv.GetSetting("packageIdGame"))); title.Text = "<style type=\"text/css\">body {font-family:Verdana, Arial, Helvetica; font-size:12px;} .mainmenu {display:block;width: 100%;background-color: #de60cb;color:#fff;text-align:center;line-height:25px;} .mainmenu a{color:#fff;} a:link, a:visited {text-decoration:none;}</style>"; if (lang == "1") { title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chào mừng bạn đến với dịch vụ game <b style=\"color:blue\">(Miễn Phí)</b> của Vietnamobile" + "</div>"; } else { title.Text += "<div style=\"background-color:#EA6A00;color:#FFFFFF;display:block;line-height:25px;width:100%;margin-top:5px;padding-left:5px;font-weight:bold;\">" + "Chao mung ban den voi dich vu game <b style=\"color:blue\">(Miễn Phí)</b> cua Vietnamobile" + "</div>"; } plList.Controls.Add(title); foreach (DataRow row in dtMusic.Rows) { HyperLink lnkfile = new HyperLink(); if (lang == "1") { lnkfile.Text = row["Name"].ToString(); } else { lnkfile.Text = UnicodeUtility.UnicodeToKoDau(row["Name"].ToString()); } lnkfile.NavigateUrl = AppEnv.GetSetting("JavaGameDownload") + "?id=" + row["GameID"] + "&type=3" + "&code=" + SecurityMethod.MD5Encrypt(row["GameID"].ToString()); lnkfile.Attributes.Add("style", "color:#006CBF;padding-left:15px;padding-top:5px;padding-bottom:5px;display:block"); lnkfile.Attributes.Add("class", "bold"); plList.Controls.Add(lnkfile); } //Khuyen mai ltrEnd1.Text = "</div><div style=\"border-bottom: 1px solid #790083;height: 7px; margin: 5px 0 10px 0; width: 100%;\"></div>"; ltrEnd.Text = "</div><div style=\"height: 7px; margin: 5px 0 0px 0; width: 100%;\"></div>"; ltrEnd.Text += "<div style=\"background-color: #EA6A00; color: #FFFFFF; display: block; line-height: 25px; text-align: center; width: 100%;\">"; ltrEnd.Text += "<a style=\"color:#fff\" href=\"" + wapHomeURL + "\">Trang chủ</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Game/Default.aspx?lang=1&display=home&hotro=0\">Game</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Music/Default.aspx?lang=1&display=home\">Nhạc</a> | <a style=\"color:#fff\" href=\"" + wapHomeURL + "/Thethao/Default.aspx?lang=1&display=home\">Bóng đá</a></div>"; plList.Controls.Add(ltrEnd); } catch (Exception ex) { Response.Write(ex.ToString()); } }
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 }