public static void NewVoteChargedUserLogInsertForSub(VoteChargedUserLogInfo e) { SqlConnection dbConn = new SqlConnection(AppEnv.ConnectionString); SqlCommand dbCmd = new SqlCommand("Vote_New_Charged_Users_Log_Insert_ForSub_Like", dbConn); dbCmd.CommandType = CommandType.StoredProcedure; dbCmd.Parameters.AddWithValue("@ID", e.ID); dbCmd.Parameters.AddWithValue("@User_ID", e.User_ID); dbCmd.Parameters.AddWithValue("@Request_ID", e.Request_ID); dbCmd.Parameters.AddWithValue("@Service_ID", e.Service_ID); dbCmd.Parameters.AddWithValue("@Command_Code", e.Command_Code); dbCmd.Parameters.AddWithValue("@Service_Type", e.Service_Type); dbCmd.Parameters.AddWithValue("@Charging_Count", e.Charging_Count); dbCmd.Parameters.AddWithValue("@FailedChargingTimes", e.FailedChargingTime); dbCmd.Parameters.AddWithValue("@RegisteredTime", e.RegisteredTime); dbCmd.Parameters.AddWithValue("@ExpiredTime", e.ExpiredTime); dbCmd.Parameters.AddWithValue("@Registration_Channel", e.Registration_Channel); dbCmd.Parameters.AddWithValue("@Status", e.Status); dbCmd.Parameters.AddWithValue("@Operator", e.Operator); dbCmd.Parameters.AddWithValue("@Reason", e.Reason); dbCmd.Parameters.AddWithValue("@Price", e.Price); dbCmd.Parameters.AddWithValue("@Vote_PersonId", e.Vote_PersonId); try { dbConn.Open(); dbCmd.ExecuteNonQuery(); } finally { dbConn.Close(); } }
private void NewVoteLogDoanhThu(string user_Id, string request_Id, string service_Id, string command_Code) { #region Log Doanh Thu var e = new VoteChargedUserLogInfo(); e.User_ID = user_Id; e.Request_ID = request_Id; e.Service_ID = service_Id; e.Command_Code = command_Code; e.Service_Type = 1; e.Charging_Count = 0; e.FailedChargingTime = 0; e.RegisteredTime = DateTime.Now; e.ExpiredTime = DateTime.Now.AddDays(1); e.Registration_Channel = "SMS"; e.Status = 1; e.Operator = GetTelco(user_Id); e.Reason = "Succ"; e.Price = 2000; e.Vote_PersonId = 0; VoteRegisterController.NewVoteChargedUserLogInsert(e); #endregion }
public static void Mo949ChargedUserLogInsert(VoteChargedUserLogInfo entity) { SqlHelper.ExecuteNonQuery(AppEnv.ConnectionString, "Mo949_Charged_Users_Log_Insert" , entity.User_ID , entity.Request_ID , entity.Service_ID , entity.Command_Code , entity.Service_Type , entity.RegisteredTime , entity.Registration_Channel , entity.Operator , entity.Reason , entity.Price ); }
public static void WorldCupChargedUserLogInsert(VoteChargedUserLogInfo entity) { SqlHelper.ExecuteNonQuery(AppEnv.ConnectionString, "World_Cup_Charged_Users_Log_Insert" , entity.User_ID , entity.Request_ID , entity.Service_ID , entity.Command_Code , entity.Service_Type , entity.Charging_Count , entity.FailedChargingTime , entity.RegisteredTime , entity.ExpiredTime , entity.Registration_Channel , entity.Status , entity.Operator , entity.Reason , entity.Price ); }
public int Execute(int jobID) { WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g(); string userName = "******"; string userPass = "******"; string cpId = "1928"; string price = "5000"; try { DataTable dtUsers = VoteRegisterController.SecretGetUserByType(false); if (dtUsers != null && dtUsers.Rows.Count > 0) { string message = string.Empty; string returnValue = string.Empty; string notEnoughMoney = "Result:12,Detail:Not enough money."; string serviceType = "BiMat_HotGirl"; string serviceName = "BiMat_HotGirl"; string reasonLog = string.Empty; foreach (DataRow dr in dtUsers.Rows) { string userId = dr["User_ID"].ToString(); returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId); if (returnValue.Trim() == notEnoughMoney) { price = "3000"; returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId); if (returnValue.Trim() == notEnoughMoney) { price = "2000"; returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId); if (returnValue.Trim() == notEnoughMoney) { price = "1000"; returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId); } } } if (returnValue.Trim() == "1")//CHARGED THANH CONG { reasonLog = "Succ"; } else { reasonLog = returnValue; } #region LOG DOANH THU VoteChargedUserLogInfo logInfo = new VoteChargedUserLogInfo(); logInfo.ID = ConvertUtility.ToInt32(dr["ID"].ToString()); logInfo.User_ID = userId; logInfo.Request_ID = dr["Request_ID"].ToString(); logInfo.Service_ID = dr["Service_ID"].ToString(); logInfo.Command_Code = dr["Command_Code"].ToString(); logInfo.Service_Type = 0;//Charged Sub Service_Type logInfo.Charging_Count = ConvertUtility.ToInt32(dr["Charging_Count"].ToString()); logInfo.FailedChargingTime = ConvertUtility.ToInt32(dr["FailedChargingTimes"].ToString()); logInfo.RegisteredTime = DateTime.Now; logInfo.ExpiredTime = DateTime.Now.AddDays(1); logInfo.Registration_Channel = dr["Registration_Channel"].ToString(); logInfo.Status = ConvertUtility.ToInt32(dr["Status"].ToString()); logInfo.Operator = dr["Operator"].ToString(); logInfo.Price = ConvertUtility.ToInt32(price); logInfo.Vote_PersonId = 1; logInfo.Reason = reasonLog; VoteRegisterController.SecretChargedUserLogInsertForSub(logInfo); #endregion #region GUI SMS CHO KHACH_HANG if (returnValue.Trim() == "1") { string serviceId = dr["Service_ID"].ToString(); string commandCode = dr["Command_Code"].ToString(); string requestId = dr["Request_ID"].ToString(); DataTable dt = VoteRegisterController.SecretGetCountByPersonId(userId, 1); message = "So luot Dat gach cua ban: " + dt.Rows[0]["Count"] + ". Ban dang thuoc top " + dt.Rows[0]["Top"] + " nhung nguoi dat gach nhieu nhat. Dat gach cang nhieu ban cang co nhieu co hoi gap mat de biet BI MAT DONG TROI cua hot girl Mai Tho. De tiep tuc dat gach, Soan Gach gui 8379 hoac su dung 3G truy cap http://wap.vietnamobile.com.vn. HT: 19001255"; SendMtSecret(userId, serviceId, commandCode, message, requestId); //GUI THEM TIN TUC BI_MAT_MAI_THO DataTable dtSecretContent = VoteRegisterController.SecretGetRandomContent(); if (dtSecretContent != null && dtSecretContent.Rows.Count > 0) { message = dtSecretContent.Rows[0]["MT1"].ToString(); SendMtSecret(userId, serviceId, commandCode, message, requestId); } } #endregion } } return(1); } catch (Exception ex) { log.Error(ex.ToString()); return(0); } }
public int Execute(int jobID) { //var webServiceCharging3G = new WebServiceCharging3g(); //string userName = "******"; //string userPass = "******"; //string cpId = "1928"; string price = "0"; DataTable dtUser = VoteRegisterController.Mo949GetUserForReCharged(); if (dtUser != null && dtUser.Rows.Count > 0) { string userId; string commandCode; string requestId; string serviceId; string msg; foreach (DataRow dr in dtUser.Rows) { userId = dr["User_ID"].ToString(); commandCode = dr["Command_Code"].ToString().ToUpper(); requestId = dr["Request_ID"].ToString(); serviceId = dr["Service_ID"].ToString(); if (commandCode == "GAMEHOT" || commandCode == "NCHAY") { price = "10000"; } else if (commandCode == "VIDEOHAY") { price = "2000"; } else if (commandCode == "TRUYENHOT") { price = "5000"; } string msgReturn = PaymentVnmWapChargingOptimize(price, userId, commandCode); string[] msgResult = msgReturn.Split('|'); msg = msgResult[0].Trim(); price = msgResult[1].Trim(); #region Log Doanh Thu var e = new VoteChargedUserLogInfo(); e.ID = ConvertUtility.ToInt32(dr["ID"].ToString()); e.User_ID = userId; e.Request_ID = requestId; e.Service_ID = serviceId; e.Command_Code = commandCode; e.Service_Type = 0; e.RegisteredTime = DateTime.Now; e.Registration_Channel = "SMS"; e.Operator = dr["Operator"].ToString(); e.Reason = msg == "1" ? "Succ" : msg; e.Price = ConvertUtility.ToInt32(price); VoteRegisterController.Mo949ChargedUserLogInsertForSub(e); #endregion if (msg == "1") { string url = string.Empty; string messageContent; if (commandCode == "GAMEHOT") { #region GAME DataTable dtGame = VoteRegisterController.Mo949GetRandomGame(); url = ""; if (dtGame != null && dtGame.Rows.Count > 0) { try { var urlservice = new VMGGame.MOReceiver(); url = urlservice.VMG_ReturnUrlForGame(ConvertUtility.ToString(dtGame.Rows[0]["GID"]), 0, userId, ConvertUtility.ToInt32(dtGame.Rows[0]["Partner_ID"]), "XZONE", "WAP", "vnmobile", "WAP.XZONE.VN", "", ""); int indexofhttp = url.IndexOf("http://"); if (indexofhttp == -1) { url = "http://" + url; } else { url = url.Substring(indexofhttp); } } catch (Exception ex) { url = ""; } } messageContent = "Ban da mua GAME thanh cong. Click vao link sau de tai ve may " + url; SendMtMo949(userId, messageContent, serviceId, commandCode, requestId); #endregion } else if (commandCode == "NCHAY") { #region MUSIC DataTable dtMusic = VoteRegisterController.Mo949GetRandomMusic(); if (dtMusic != null && dtMusic.Rows.Count > 0) { url = GetVnmDownloadItem(GetTelco(userId), "22", dtMusic.Rows[0]["W_MItemID"].ToString(), AppEnv.MD5Encrypt(dtMusic.Rows[0]["W_MItemID"].ToString())); } messageContent = "Ban da mua Nhac Chuong thanh cong. Click vao link sau de tai ve may " + url; SendMtMo949(userId, messageContent, serviceId, commandCode, requestId); #endregion } else if (commandCode == "VIDEOHAY") { #region VIDEO DataTable dtVideo = VoteRegisterController.Mo949GetRandomVideo(); if (dtVideo != null && dtVideo.Rows.Count > 0) { url = GetDownloadItem(GetTelco(userId), "5", dtVideo.Rows[0]["W_VItemID"].ToString(), AppEnv.MD5Encrypt(dtVideo.Rows[0]["W_VItemID"].ToString())); } messageContent = "Ban da mua Video hot thanh cong. Click vao link sau de tai ve may " + url; SendMtMo949(userId, messageContent, serviceId, commandCode, requestId); #endregion } else if (commandCode == "TRUYENHOT") { #region TRUYEN HOT string key = DateTime.Now.ToString("yyyyMMdd"); string en = AppEnv.MD5Encrypt(key); DataTable dtTruyen = VoteRegisterController.Mo949GetRandomVideo(); if (dtTruyen != null && dtTruyen.Rows.Count > 0) { url = "http://wap.vietnamobile.com.vn/thugian/truyenmoi.aspx?k=" + en; } messageContent = "Ban da mua Truyen Hot thanh cong. Click vao link sau de doc truyen " + url; SendMtMo949(userId, messageContent, serviceId, commandCode, requestId); #endregion } } } } //{"List":[{"Type":"text","Content":"noi dung text 1"},{"Type":"wappush","Content":"http://xzone.vn"}]} return(1); }
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; ltrXinChao.Text = "Xin chào <b>" + msisdn + "</b>"; } else { Session["msisdn"] = null; Session["telco"] = Constant.T_Undefined; ltrXinChao.Text = "Xin chào <b>khách</b>"; } } else { ltrXinChao.Text = "Xin chào <b>" + Session["msisdn"] + "</b>"; } #region Xử lý ĐẶT GẠCH string message = string.Empty; string serviceId = "8379"; madichvu = Request.QueryString["t"]; madichvu = madichvu.ToUpper(); string regisChannel = "WAP"; if (madichvu == "GACH1") { regisChannel = "VMG1"; } else if (madichvu == "GACH2") { regisChannel = "VMG2"; } else if (madichvu == "GACH3") { regisChannel = "VMG3"; } madichvu = madichvu.Replace("1", "").Replace("2", "").Replace("3", ""); if (!string.IsNullOrEmpty(madichvu)) { madichvu = madichvu.ToUpper().Trim(); if (Session["msisdn"] != null) { price = "5000"; string messageReturn; var charging = new Library.VNMCharging.VNMChargingGW(); messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", "Vote " + madichvu); if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))//Not Enough Money { messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", "Vote " + madichvu, out logPrice); price = logPrice; } if (messageReturn == "1")//Charged Thanh Cong { #region DK USER var entity = new VoteRegisteredInfo(); entity.User_ID = Session["msisdn"].ToString(); entity.Request_ID = "0"; entity.Service_ID = serviceId; entity.Command_Code = madichvu; entity.Service_Type = 1; entity.Charging_Count = 0; entity.FailedChargingTime = 0; entity.RegisteredTime = DateTime.Now; entity.ExpiredTime = DateTime.Now.AddDays(1); entity.Registration_Channel = regisChannel; entity.Status = 1; entity.Operator = "vnmobile"; entity.Vote_Count = 1; entity.Vote_PersonId = 1; entity.IsDislike = 0; entity.Dislike_Count = 1; entity.Dislike_PersonId = 0; DataTable dt = WapController.SecretRegisterInsert(entity); if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//DK DICH VU LAN DAU { litThongBao.Text = "Chúc mừng bạn đã đăng ký thành công Gameshow 'BÍ MẬT ĐỘNG TRỜI CỦA MAI THỎ'.<br /> Hãy đặt gạch càng nhiều để có cơ hội hẹn hò và biết bí mật đằng sau của Mai Thỏ là gì.<br /> Chi tiết truy cập http://wap.vietnamobile.com.vn. HT: 19001255"; } else if (dt.Rows[0]["RETURN_ID"].ToString() == "1") { DataTable dtVoteInfo = WapController.SecretGetCountByPersonId(Session["msisdn"].ToString(), 1); litThongBao.Text = "Bạn đã ĐẶT GẠCH thành công cho : " + dtVoteInfo.Rows[0]["Name"] + ".<br /> Số lượt GẠCH của bạn : " + dtVoteInfo.Rows[0]["Count"] + "<br /> Bạn đang thuộc top : " + dtVoteInfo.Rows[0]["Top"] + " những người ĐẶT GẠCH nhiều nhất <br /> ĐẶT GẠCH càng nhiều bạn càng có cơ hội hẹn hò và biết bí mật đằng sau của Mai Thỏ là gì.<br /> Chi tiết truy cập: http://wap.vietnamobile.com.vn. HT: 19001255"; } #endregion } else { litThongBao.Text = lang == "1" ? "Đăng ký không thành công. Vui lòng thử loại hoặc tài khoản không đủ tiền" : "Dang ky khong thanh cong. Vui long thu lai hoac tai khoan khong du tien"; } #region Log Doanh Thu var eLog = new VoteChargedUserLogInfo(); eLog.User_ID = Session["msisdn"].ToString(); eLog.Request_ID = "0"; eLog.Service_ID = serviceId; eLog.Command_Code = madichvu; eLog.Service_Type = 1; eLog.Charging_Count = 0; eLog.FailedChargingTime = 0; eLog.RegisteredTime = DateTime.Now; eLog.ExpiredTime = DateTime.Now.AddDays(1); eLog.Registration_Channel = regisChannel; eLog.Status = 1; eLog.Operator = "vnmobile"; if (messageReturn == "1") { eLog.Reason = "Succ"; } else { eLog.Reason = messageReturn; } eLog.Price = ConvertUtility.ToInt32(price); eLog.Vote_PersonId = 1; WapController.SecretChargedUserLogInsert(eLog); #endregion } else { if (madichvu == "GACH") { message = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS<br /> Hoặc soạn tin: " + madichvu + " gửi " + serviceId; litThongBao.Text = message; } else { message = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS"; litThongBao.Text = message; } } } #endregion DataSet dsMt = WapController.SecretGetTopUserVote(1); if (dsMt != null && dsMt.Tables[0].Rows.Count > 0) { rptMaiTho.DataSource = dsMt.Tables[0]; rptMaiTho.DataBind(); lblMtUnLike.Text = dsMt.Tables[1].Rows[0]["Like"].ToString(); rptLinhMiu.DataSource = dsMt.Tables[0]; rptLinhMiu.DataBind(); lblLmUnLike.Text = dsMt.Tables[1].Rows[0]["Like"].ToString(); } #region FACEBOOK Comment string url = AppEnv.GetSetting("WapDefault") + Request.RawUrl; ltCommentFB.Text = "<div class=\"fb-comments\" data-mobile=\"false\" data-href='" + url + "' data-width=\"320\" data-num-posts=\"5\"></div>"; string Facebook_raw_data = get_web_content("http://api.facebook.com/restserver.php?method=links.getStats&urls=" + url); XmlDocument dom = new XmlDocument(); dom.LoadXml(Facebook_raw_data); #endregion } }
public int Execute(int jobId) { WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g(); string userName = "******"; string userPass = "******"; string cpId = "1928"; string price = "5000"; try { DataTable dtUsers = VoteRegisterController.NewVoteGetUserByType(false); if (dtUsers != null && dtUsers.Rows.Count > 0) { string message = string.Empty; string returnValue = string.Empty; string notEnoughMoney = "Result:12,Detail:Not enough money."; string serviceType = "HotGirl_QuanTu"; string serviceName = "HotGirl_QuanTu"; string reasonLog = string.Empty; foreach (DataRow dr in dtUsers.Rows) { string userId = dr["User_ID"].ToString(); returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId); if (returnValue.Trim() == notEnoughMoney) { price = "3000"; returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId); if (returnValue.Trim() == notEnoughMoney) { price = "2000"; returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId); if (returnValue.Trim() == notEnoughMoney) { price = "1000"; returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId); } } } if (returnValue.Trim() == "1")//CHARGED THANH CONG { reasonLog = "Succ"; } else { reasonLog = returnValue; } #region LOG DOANH THU var logInfo = new VoteChargedUserLogInfo(); logInfo.ID = ConvertUtility.ToInt32(dr["ID"].ToString()); logInfo.User_ID = userId; logInfo.Request_ID = dr["Request_ID"].ToString(); logInfo.Service_ID = dr["Service_ID"].ToString(); logInfo.Command_Code = dr["Command_Code"].ToString(); logInfo.Service_Type = 0;//Charged Sub Service_Type logInfo.Charging_Count = ConvertUtility.ToInt32(dr["Charging_Count"].ToString()); logInfo.FailedChargingTime = ConvertUtility.ToInt32(dr["FailedChargingTimes"].ToString()); logInfo.RegisteredTime = DateTime.Now; logInfo.ExpiredTime = DateTime.Now.AddDays(1); logInfo.Registration_Channel = dr["Registration_Channel"].ToString(); logInfo.Status = ConvertUtility.ToInt32(dr["Status"].ToString()); logInfo.Operator = dr["Operator"].ToString(); logInfo.Price = ConvertUtility.ToInt32(price); logInfo.Vote_PersonId = 1; logInfo.Reason = reasonLog; VoteRegisterController.NewVoteChargedUserLogInsertForSub(logInfo); #endregion #region GUI SMS CHO KHACH_HANG if (returnValue.Trim() == "1") { string serviceId = dr["Service_ID"].ToString(); string commandCode = dr["Command_Code"].ToString(); string requestId = dr["Request_ID"].ToString(); DataTable dt = VoteRegisterController.NewVoteRegisterUserGetInfo(userId); int voteCount = ConvertUtility.ToInt32(dt.Rows[0]["Vote_Count"]); string voteTop = GetTopVote(voteCount); message = "So luot vote cua ban: " + voteCount + ".Ban dang thuoc top: " + voteTop + " nhung nguoi Vote nhieu nhat.Soan: Vote1 gui 8579 de Hen Ho voi 1 trong 5 Hot Girl Xinh Dep.Chi tiet truy cap: http://wap.vietnamobile.com.vn. HT: 19001255"; SendMtNewVote(userId, serviceId, commandCode, message, requestId); } #endregion } } return(1); } catch (Exception ex) { log.Error(ex.ToString()); return(0); } }
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; //ltrXinChao.Text = "Xin chào <b>" + msisdn + "</b>"; } else { Session["msisdn"] = null; Session["telco"] = Constant.T_Undefined; //ltrXinChao.Text = "Xin chào <b>khách</b>"; } } string madichvu = Request.QueryString["t"]; string message = string.Empty; string serviceId = "8579"; if (!string.IsNullOrEmpty(madichvu)) { if (Session["msisdn"] != null) { price = "5000"; string messageReturn; madichvu = madichvu.ToUpper(); var charging = new Library.VNMCharging.VNMChargingGW(); messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", "Vote " + madichvu); if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))//Not Enough Money { messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", madichvu, out logPrice); price = logPrice; } if (messageReturn == "1")//Charged Thanh Cong { #region DK USER var entity = new VoteRegisteredInfo(); entity.User_ID = Session["msisdn"].ToString(); entity.Request_ID = "0"; entity.Service_ID = serviceId; entity.Command_Code = madichvu; entity.Service_Type = 1; entity.Charging_Count = 0; entity.FailedChargingTime = 0; entity.RegisteredTime = DateTime.Now; entity.ExpiredTime = DateTime.Now.AddDays(1); entity.Registration_Channel = "WAP"; entity.Status = 1; entity.Operator = "vnmobile"; entity.Vote_Count = 1; entity.Vote_PersonId = 1; entity.IsDislike = 0; entity.Dislike_Count = 1; entity.Dislike_PersonId = 0; DataTable dt = WapController.NewVoteRegisterInsert(entity); if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//DK DICH VU LAN DAU { litThongBao.Text = "Chúc mừng bạn đã đăng ký thành công Gameshow 'Hẹn Hò cùng Hot Girl'.<br /> Hãy vote để Hẹn Hò với 1 trong 5 Hot Girl Xinh Đẹp"; } else if (dt.Rows[0]["RETURN_ID"].ToString() == "1") { DataTable dtVoteInfo = WapController.NewVoteGetUserInfo(Session["msisdn"].ToString()); int voteCount = ConvertUtility.ToInt32(dtVoteInfo.Rows[0]["Vote_Count"].ToString()); string voteTop = GetTopVote(voteCount); litThongBao.Text = "Số lượt Vote của bạn : " + voteCount + " .<br />Bạn đang thuộc top : " + voteTop + " những người Vote nhiều nhất. <br />Hãy vote để Hẹn Hò với 1 trong 5 Hot Girl Xinh Đẹp"; } #endregion } else { litThongBao.Text = "Đăng ký không thành công. Vui lòng thử loại hoặc tài khoản không đủ tiền"; } #region Log Doanh Thu var eLog = new VoteChargedUserLogInfo(); eLog.User_ID = Session["msisdn"].ToString(); eLog.Request_ID = "0"; eLog.Service_ID = serviceId; eLog.Command_Code = madichvu; eLog.Service_Type = 1; eLog.Charging_Count = 0; eLog.FailedChargingTime = 0; eLog.RegisteredTime = DateTime.Now; eLog.ExpiredTime = DateTime.Now.AddDays(1); eLog.Registration_Channel = "WAP"; eLog.Status = 1; eLog.Operator = "vnmobile"; if (messageReturn == "1") { eLog.Reason = "Succ"; } else { eLog.Reason = messageReturn; } eLog.Price = ConvertUtility.ToInt32(price); eLog.Vote_PersonId = 1; WapController.NewVoteChargedUserLogInsert(eLog); #endregion } else { if (madichvu == "VOTE1") { message = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS<br /> Hoặc soạn tin: " + madichvu + " gửi " + serviceId; litThongBao.Text = message; } else { message = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS"; litThongBao.Text = message; } } } DataSet dtVote = WapController.NewGetTopUserVote(); if (dtVote.Tables[0].Rows.Count > 0) { rptTop.DataSource = dtVote.Tables[0]; rptTop.DataBind(); VoteSum = dtVote.Tables[1].Rows[0]["Like"].ToString(); } #region FACEBOOK Comment string url = AppEnv.GetSetting("WapDefault") + Request.RawUrl; ltCommentFB.Text = "<div class=\"fb-comments\" data-mobile=\"false\" data-href='" + url + "' data-width=\"320\" data-num-posts=\"5\"></div>"; string Facebook_raw_data = get_web_content("http://api.facebook.com/restserver.php?method=links.getStats&urls=" + url); XmlDocument dom = new XmlDocument(); dom.LoadXml(Facebook_raw_data); #endregion } }
protected void Page_Load(object sender, EventArgs e) { lang = Request.QueryString["lang"]; width = ConvertUtility.ToInt32(Request.QueryString["w"]); madichvu = Request.QueryString["t"]; madichvu = madichvu.ToUpper().Trim(); //int votePrice = 2000; price = "5000"; if (!Page.IsPostBack) { //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\" />"; 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; litMsisdn.Text = "Xin chào <b>" + msisdn + "</b>"; } else { Session["msisdn"] = null; Session["telco"] = Constant.T_Undefined; litMsisdn.Text = "Xin chào <b>khách</b>"; } } string messageReturn; int votePersonId = 1; if (Session["msisdn"] != null) { #region Xu Ly Charging var charging = new Library.VNMCharging.VNMChargingGW(); //if (AppEnv.GetSetting("TestFlag") == "1") //{ // messageReturn = "1"; //} //else //{ //messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price.ToString(), "D", "VID", "Vote " + madichvu); //} //var charging = new Library.VNMCharging.VNMChargingGW(); messageReturn = charging.NavigatePaymentVnm(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", "Vote " + madichvu); if (messageReturn == AppEnv.GetSetting("NotEnoughMoney"))//Not Enough Money { messageReturn = AppEnv.VnmChargingOptimizeNotEnoughMoney(Session["msisdn"].ToString(), "VIDEOGIFT", "VIDEO_GIFT", price, "D", "VID", "Vote " + madichvu, out logPrice); price = logPrice; } //pnlSMS.Visible = false; //pnlThongBao.Visible = false; //pnlNoiDung.Visible = true; if (messageReturn == "1")//Charged Thanh Cong { int disLike = 0; int dislikePersonId = 1; string personName = ""; if (madichvu == "VOTE1") { votePersonId = 1; disLike = 0; personName = "Mai Thỏ"; } else if (madichvu == "VOTE2") { votePersonId = 2; disLike = 0; personName = "Linh Miu"; } else if (madichvu == "GACH1") { votePersonId = 2; dislikePersonId = 1; disLike = 1; personName = "Mai Thỏ"; } else if (madichvu == "GACH2") { votePersonId = 1; dislikePersonId = 2; disLike = 1; personName = "Linh Miu"; } var entity = new VoteRegisteredInfo(); entity.User_ID = Session["msisdn"].ToString(); entity.Request_ID = "0"; entity.Service_ID = "8279"; entity.Command_Code = madichvu; entity.Service_Type = 1; entity.Charging_Count = 0; entity.FailedChargingTime = 0; entity.RegisteredTime = DateTime.Now; entity.ExpiredTime = DateTime.Now.AddDays(1); entity.Registration_Channel = "WAP"; entity.Status = 1; entity.Operator = "vnmobile"; entity.Vote_Count = 1; entity.Vote_PersonId = votePersonId; entity.IsDislike = disLike; entity.Dislike_Count = 1; entity.Dislike_PersonId = dislikePersonId; if (madichvu == "VOTE1" || madichvu == "VOTE2") { DataTable dt = WapController.VoteRegisterInsert(entity); if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//DK DICH VU LAN DAU { litThongBao.Text = "Chúc mừng bạn đã đăng ký thành công Gameshow 'Hẹn hò cùng thần tượng'.<br /> Hãy vote cho " + personName + " để trở thành người chiến thắng.<br /> Chi tiết truy cập http://wap.vietnamobile.com.vn. HT: 19001255"; } else if (dt.Rows[0]["RETURN_ID"].ToString() == "1") { //litThongBao.Text = "Bạn đã vote thành công cho " + personName + ".<br /> Vote càng nhiều bạn càng có cơ hội là 1 trong 3 người hẹn hò thần tượng.<br /> Soạn: Vote1 gửi 8279 để gặp Mai Thỏ. Soạn: Vote2 gửi 8279 để gặp Linh Miu<br /> Chi tiết truy cập: http://wap.vietnamobile.com.vn. HT: 19001255"; //DataTable dtVoteInfo = WapController.VoteGetCount(Session["msisdn"].ToString(), madichvu); //if (dtVoteInfo.Rows[0]["Count"].ToString() == "0") //{ int revotePersonId = 0; if (madichvu == "VOTE2") { revotePersonId = 2; } else if (madichvu == "VOTE1") { revotePersonId = 1; } DataTable dtVoteInfo = WapController.VoteGetCountByPersonId(Session["msisdn"].ToString(), revotePersonId); //} litThongBao.Text = "Bạn đã vote thành công cho : " + dtVoteInfo.Rows[0]["Name"] + ".<br /> Số lượt vote của bạn : " + dtVoteInfo.Rows[0]["Count"] + "<br /> Bạn đang thuộc top : " + dtVoteInfo.Rows[0]["Top"] + " những người vote nhiều nhất <br /> Vote càng nhiều bạn càng có cơ hội là 1 trong 4 người hẹn hò thần tượng.<br /> Chi tiết truy cập: http://wap.vietnamobile.com.vn. HT: 19001255"; } } else if (madichvu == "GACH1" || madichvu == "GACH2") { DataTable dtDislike = WapController.VoteRegisterDislikeInsert(entity); DataTable dt = WapController.VoteRegisterInsert(entity); if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//DK DICH VU LAN DAU { litThongBao.Text = "Chúc mừng bạn đã đăng ký thành công Gameshow 'Hẹn hò cùng thần tượng'.<br /> Hãy ném gạch " + personName + " mà bạn không thích để trở thành người chiến thắng.<br /> Chi tiết truy cập: http://wap.vietnamobile.com.vn. HT: 19001255"; } else if (dt.Rows[0]["RETURN_ID"].ToString() == "1") { //litThongBao.Text = "Bạn đã Ném gạch " + personName + " thành công.<br /> Ném gạch càng nhiều bạn có cơ hội là 1 trong 3 người hẹn hò thần tượng.<br /> Soạn: Gach1 gửi 8279 để gặp gỡ Linh Miu. Soạn: Gach2 gửi 8279 để gặp Mai Thỏ .<br /> Chi tiết truy cập: http://wap.vietnamobile.com.vn. HT: 19001255"; DataTable dtGachInfo = WapController.VoteGetCount(Session["msisdn"].ToString(), madichvu); litThongBao.Text = "Bạn đã ném gạch " + dtGachInfo.Rows[0]["Name"] + " thành công .<br />Số Gạch của bạn : " + dtGachInfo.Rows[0]["Count"] + "<br /> Bạn đang thuộc top: " + dtGachInfo.Rows[0]["Top"] + " những người Ném Gạch nhiều nhất <br />Ném Gạch càng nhiều bạn càng có cơ hội là 1 trong 4 người hẹn hò thần tượng.<br /> Chi tiết truy cập : http://wap.vietnamobile.com.vn. HT: 19001255"; } } //#region Log Doanh Thu //var eLog = new VoteChargedUserLogInfo(); //eLog.User_ID = Session["msisdn"].ToString(); ; //eLog.Request_ID = "0"; //eLog.Service_ID = "8279"; //eLog.Command_Code = madichvu; //eLog.Service_Type = 1; //eLog.Charging_Count = 0; //eLog.FailedChargingTime = 0; //eLog.RegisteredTime = DateTime.Now; //eLog.ExpiredTime = DateTime.Now.AddDays(1); //eLog.Registration_Channel = "WAP"; //eLog.Status = 1; //eLog.Operator = "vnmobile"; //eLog.Reason = "Succ"; //eLog.Price = 2000; //eLog.Vote_PersonId = votePersonId; //WapController.VoteChargedUserLogInsert(eLog); //#endregion } else { litThongBao.Text = lang == "1" ? "Đăng ký không thành công. Vui lòng thử loại hoặc tài khoản không đủ tiền" : "Dang ky khong thanh cong. Vui long thu lai hoac tai khoan khong du tien"; } #region Log Doanh Thu var eLog = new VoteChargedUserLogInfo(); eLog.User_ID = Session["msisdn"].ToString();; eLog.Request_ID = "0"; eLog.Service_ID = "8279"; eLog.Command_Code = madichvu; eLog.Service_Type = 1; eLog.Charging_Count = 0; eLog.FailedChargingTime = 0; eLog.RegisteredTime = DateTime.Now; eLog.ExpiredTime = DateTime.Now.AddDays(1); eLog.Registration_Channel = "WAP"; eLog.Status = 1; eLog.Operator = "vnmobile"; if (messageReturn == "1") { eLog.Reason = "Succ"; } else { eLog.Reason = messageReturn; } eLog.Price = ConvertUtility.ToInt32(price); eLog.Vote_PersonId = votePersonId; WapController.VoteChargedUserLogInsert(eLog); #endregion #endregion } else { if (madichvu == "VOTE1" || madichvu == "VOTE2" || madichvu == "GACH1" || madichvu == "GACH2") { litThongBao.Text = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS<br /> Hoặc soạn tin: " + madichvu + " gửi " + "8279";; } else { litThongBao.Text = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS"; } //litThongBao.Text = "Hệ thống không xác định được số điện thoại của bạn.<br /> Vui lòng truy cập bằng 3G/GPRS <br /> Hoặc soạn tin: " + madichvu + " gửi " + "8279"; //pnlSMS.Visible = true; //if (lang == "1") //{ // ltrHuongdan.Text = "Thông Báo"; // ltrSMS.Text = "Hệ thống không xác định được số điện thoại của bạn. Vui lòng truy cập bằng 3G/GPRS hoặc soạn tin: " + madichvu + " gửi " + "8279"; //} //else //{ // ltrHuongdan.Text = "Thong Bao"; // ltrSMS.Text = // "He thong khong xac dinh duoc so dien thoai cua ban. Vui long truy cap bang 3G/GPRS hoac soan tin " + madichvu + " gui " + "8279"; //} } DataSet dsMt = WapController.GetTopUserVote(1); DataSet dsLm = WapController.GetTopUserVote(2); //DataTable dtMt = WapController.GetTopUserVote(1); //DataTable dtLm = WapController.GetTopUserVote(2); if (dsMt != null && dsMt.Tables[0].Rows.Count > 0) { rptMaiTho.DataSource = dsMt.Tables[0]; rptMaiTho.DataBind(); lblMtLike.Text = dsMt.Tables[1].Rows[0]["Like"].ToString(); lblMtUnLike.Text = dsMt.Tables[2].Rows[0]["UnLike"].ToString(); } if (dsLm != null && dsLm.Tables[0].Rows.Count > 0) { rptLinhMiu.DataSource = dsLm.Tables[0]; rptLinhMiu.DataBind(); lblLmLike.Text = dsLm.Tables[1].Rows[0]["Like"].ToString(); lblLmUnLike.Text = dsLm.Tables[2].Rows[0]["UnLike"].ToString(); } #region FACEBOOK Comment string url = AppEnv.GetSetting("WapDefault") + "/vote.aspx"; ltCommentFB.Text = "<div class=\"fb-comments\" data-mobile=\"false\" data-href='" + url + "' data-width=\"320\" data-num-posts=\"5\"></div>"; string Facebook_raw_data = get_web_content("http://api.facebook.com/restserver.php?method=links.getStats&urls=" + url); XmlDocument dom = new XmlDocument(); dom.LoadXml(Facebook_raw_data); #endregion } }