示例#1
0
    private static void SendMtSecret(string User_ID, string Service_ID, string Command_Code, string Message, string Request_ID)
    {
        var objSentMt = new ServiceProviderService();

        string message = Message;

        if (AppEnv.GetSetting("TestFlag") == "0")
        {
            objSentMt.sendMT(User_ID, message, Service_ID, Command_Code, "1", Request_ID, "1", "1", "0", "0");
        }

        var objMt = new VoteSmsMtInfo();

        objMt.User_ID       = User_ID;
        objMt.Message       = message;
        objMt.Service_ID    = Service_ID;
        objMt.Command_Code  = Command_Code;
        objMt.Message_Type  = 1;
        objMt.Request_ID    = Request_ID;
        objMt.Total_Message = 1;
        objMt.Message_Index = 0;
        objMt.IsMore        = 0;
        objMt.Content_Type  = 0;
        objMt.ServiceType   = 0;
        objMt.ResponseTime  = DateTime.Now;
        objMt.IsLock        = 0;
        objMt.PartnerId     = "Xzone";
        objMt.Operator      = GetTelco(User_ID);

        VoteRegisterController.SecretSmsMtInsert(objMt);
    }
    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
    }
示例#3
0
    public int Execute(int jobId)
    {
        try
        {
            DataTable dtActiveUser = VoteRegisterController.VoteGetVnmUserActive();
            if (dtActiveUser != null && dtActiveUser.Rows.Count > 0)
            {
                foreach (DataRow dr in dtActiveUser.Rows)
                {
                    string userId      = dr["User_ID"].ToString();
                    string serviceId   = dr["Service_ID"].ToString();
                    string requestId   = dr["Request_ID"].ToString();
                    string commandCode = dr["Command_Code"].ToString();
                    string message     = "Thong bao, het ngay 30/11/2013 Chuong trinh 'Hen ho hot girl' se ket thuc. Tiep ngay sau la Gameshow con HOT hon 'Bi mat HOT girl'. Ngoai viec gap go HOT girl Sieu Vong 1 - Mai Tho, Quy khach con co co hoi thuong thuc mot clip 102 doc quyen va biet duoc bi mat Dong Troi an chua ben trong Mai Tho. He thong se tu dong chuyen thue bao cua QK sang chuong trinh moi ke tu ngay 01/12/2013, neu khong muon tham gia chuong trinh, soan HUY gui 8279. Hoac truy cap http://wap.vietnamobile.com.vn/bi-mat-hot-girl/mai-tho.aspx de biet thong tin. HT 19001255";

                    log.Debug(" ");
                    log.Debug(" ");
                    log.Debug("--------------------VOTE VNM SEND MT HUY-------------------------");
                    log.Debug("User_ID: " + userId);
                    log.Debug("Service_ID: " + serviceId);
                    log.Debug("Command_Code: " + commandCode);
                    log.Debug("Message: " + message.ToUpper());
                    log.Debug("Request_ID: " + requestId);
                    log.Debug(" ");
                    log.Debug(" ");

                    SendMt(userId, serviceId, commandCode, message, requestId);
                }
            }

            return(1);
        }
        catch (Exception ex)
        {
            log.Error(ex.ToString());
            return(0);
        }
    }
示例#4
0
    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);
        }
    }
示例#5
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);
    }
    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);
        }
    }
    public void ProcessRequest(HttpContext context)
    {
        //context.Response.ContentType = "text/plain";
        //context.Response.Write("Hello World");

        string serviceCode = context.Request.QueryString["serviceCode"];

        if (!string.IsNullOrEmpty(serviceCode))
        {
            serviceCode = serviceCode.ToUpper();
        }

        string msisdn = context.Request.QueryString["msisdn"];
        string type   = context.Request.QueryString["Type"];

        string serviceId = "8979";

        const string reType    = "text";
        string       reContent = string.Empty;

        log4net.ILog log = log4net.LogManager.GetLogger("File");
        log.Debug(" ");
        log.Debug(" ");
        log.Debug("--------------------VOTE MOBI FROM Mr.T-------------------------");
        log.Debug("User_ID: " + msisdn);
        log.Debug("Command_Code: " + serviceCode);
        log.Debug("Type: " + type);
        log.Debug(" ");
        log.Debug(" ");


        if (serviceCode == "V1" || serviceCode == "V2" || serviceCode == "G1" || serviceCode == "G2")//DV VOTE1 & VOTE2
        {
            int    votePersonId = 1;
            string personName   = "Mai Tho";
            string commandCode  = "VOTE1";

            int dislikePersonId = 0;

            if (serviceCode == "V2")
            {
                votePersonId = 2;
                personName   = "Linh Miu";
                commandCode  = "VOTE2";
            }
            else if (serviceCode == "G1")
            {
                votePersonId    = 2;
                dislikePersonId = 1;
                personName      = "Mai Tho";
                commandCode     = "GACH1";
            }
            else if (serviceCode == "G2")
            {
                votePersonId    = 1;
                dislikePersonId = 2;
                personName      = "Linh Miu";
                commandCode     = "GACH2";
            }

            if (type == "1")//DK DV LAN DAU
            {
                var entity = new VoteRegisteredInfo();
                entity.User_ID              = msisdn;
                entity.Request_ID           = "0";
                entity.Service_ID           = serviceId;
                entity.Command_Code         = commandCode;
                entity.Service_Type         = 1;
                entity.Charging_Count       = 0;
                entity.FailedChargingTime   = 0;
                entity.RegisteredTime       = DateTime.Now;
                entity.ExpiredTime          = DateTime.Now.AddDays(1);
                entity.Registration_Channel = "SMS";
                entity.Status     = 1;
                entity.Operator   = "vms";
                entity.Vote_Count = 1;

                entity.Vote_PersonId = votePersonId;
                entity.IsDislike     = dislikePersonId;

                if (serviceCode == "V1" || serviceCode == "V2")
                {
                    DataTable dt = VoteRegisterController.NewVoteRegisterInsert(entity);

                    if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//CHUA DK USER
                    {
                        reContent = AppEnv.GetSetting("Vote_Sms_RegisterSucess_Mt2_Like_Mobi").Replace("VoteCount", "1").Replace("VoteTop", "100");
                    }
                    else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                    {
                        int    voteCount = ConvertUtility.ToInt32(dt.Rows[0]["VOTE_SUM"]);
                        string voteTop   = GetTopVote(voteCount);
                        reContent = AppEnv.GetSetting("Vote_Sms_RegisterSucess_Mt2_Like_Mobi").Replace("VoteCount", voteCount.ToString()).Replace("VoteTop", voteTop);
                    }

                    #region LOG DOANH THU

                    NewVoteLogDoanhThu(msisdn, "0", serviceId, "VOTE1");

                    #endregion
                }
                //else
                //{
                //    DataTable dt = VoteRegisterController.VoteRegisterInsert(entity);
                //    DataTable dtDislike = VoteRegisterController.VoteRegisterDislikeInsert(entity);

                //    if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//DK DICH VU LAN DAU
                //    {
                //        reContent = AppEnv.GetSetting("Vote_Sms_RegisterSucess_Mt2_Like_Mobi").Replace("PersonName", personName);
                //    }
                //    else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                //    {
                //        reContent = AppEnv.GetSetting("Vote_Sms_AlreadyRegister_Mobi");
                //    }
                //}
            }
            else if (type == "2")//UPDATE LUOT VOTE (SUB HANG NGAY)
            {
                DataTable info = VoteRegisterController.NewVoteGetUserInfo(msisdn);
                if (info != null && info.Rows.Count > 0)
                {
                    var logInfo = new ViSport_S2_Charged_Users_LogInfo();

                    logInfo.ID                   = ConvertUtility.ToInt32(info.Rows[0]["ID"].ToString());
                    logInfo.User_ID              = msisdn;
                    logInfo.Request_ID           = info.Rows[0]["Request_ID"].ToString();
                    logInfo.Service_ID           = info.Rows[0]["Service_ID"].ToString();
                    logInfo.Command_Code         = info.Rows[0]["Command_Code"].ToString();
                    logInfo.Service_Type         = 0;//Charged Sub Service_Type
                    logInfo.Charging_Count       = ConvertUtility.ToInt32(info.Rows[0]["Charging_Count"].ToString());
                    logInfo.FailedChargingTimes  = ConvertUtility.ToInt32(info.Rows[0]["FailedChargingTimes"].ToString());
                    logInfo.RegisteredTime       = DateTime.Now;
                    logInfo.ExpiredTime          = DateTime.Now.AddDays(1);
                    logInfo.Registration_Channel = info.Rows[0]["Registration_Channel"].ToString();
                    logInfo.Status               = ConvertUtility.ToInt32(info.Rows[0]["Status"].ToString());
                    logInfo.Operator             = info.Rows[0]["Operator"].ToString();
                    logInfo.Price                = 2000;
                    logInfo.Vote_PersonId        = ConvertUtility.ToInt32(info.Rows[0]["Vote_PersonId"].ToString());
                    logInfo.Reason               = "Succ";

                    if (serviceCode == "V1" || serviceCode == "V2")
                    {
                        VoteRegisterController.NewInsertLogLike(logInfo);

                        DataTable dt        = VoteRegisterController.NewVoteGetUserInfo(msisdn);
                        int       voteCount = ConvertUtility.ToInt32(dt.Rows[0]["Vote_Count"]);
                        string    voteTop   = GetTopVote(voteCount);

                        reContent = AppEnv.GetSetting("Vote_Sms_RegisterSucess_Mt2_Like_Mobi").Replace("VoteCount", voteCount.ToString()).Replace("VoteTop", voteTop);

                        //DataTable dt = VoteRegisterController.GetVoteAccountInfo(msisdn, info.Rows[0]["Command_Code"].ToString());
                        //reContent = AppEnv.GetSetting("Vote_Sms_ChargedSubSucess_Like").Replace("PersonName", dt.Rows[0]["Name"].ToString());
                        //reContent = reContent.Replace("VoteCount", dt.Rows[0]["Count"].ToString());
                        //reContent = reContent.Replace("VoteTop", dt.Rows[0]["Top"].ToString());
                    }
                    //else if(serviceCode == "G1" || serviceCode == "G2")
                    //{
                    //    if (info.Rows[0]["Vote_PersonId"].ToString() == "1")
                    //    {
                    //        logInfo.Vote_PersonId = 2;
                    //    }
                    //    else if (info.Rows[0]["Vote_PersonId"].ToString() == "2")
                    //    {
                    //        logInfo.Vote_PersonId = 1;
                    //    }
                    //    VoteRegisterController.InsertLogDisLike(logInfo);
                    //    DataTable dt = VoteRegisterController.GetVoteAccountInfo(msisdn, info.Rows[0]["Command_Code"].ToString());

                    //    reContent = AppEnv.GetSetting("Vote_Sms_ChargedSubSucess_UnLike").Replace("PersonName", dt.Rows[0]["Name"].ToString());
                    //    reContent = reContent.Replace("DislikeCount", dt.Rows[0]["Count"].ToString());
                    //    reContent = reContent.Replace("DislikeTop", dt.Rows[0]["Top"].ToString());
                    //}
                }
            }
            else if (type == "3")//HUY DICH VU
            {
                DataTable dt = VoteRegisterController.NewVoteRegisterUserLock(msisdn);

                if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//CHUA DK USER
                {
                    reContent = AppEnv.GetSetting("Vote_Sms_LockUserError_Mobi");
                }
                else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                {
                    reContent = AppEnv.GetSetting("Vote_Sms_LockUserSuccess_Mobi");
                }
                //DataTable dt = VoteRegisterController.VoteRegisterUserLock(msisdn, 1);

                //if (dt.Rows[0]["RETURN_ID"].ToString() == "0")//CHUA DK USER
                //{
                //    reContent = AppEnv.GetSetting("Vote_Sms_LockUserError_Mobi");
                //}
                //else if (dt.Rows[0]["RETURN_ID"].ToString() == "1")
                //{
                //    reContent = AppEnv.GetSetting("Vote_Sms_LockUserSuccess_Mobi");
                //}
            }
        }

        if (serviceCode == "T1") //DV GAME THANH_NU
        {
            if (type == "1")     //DK DV LAN DAU
            {
                var entity = new ThanhNuRegisteredUsers();
                entity.UserId              = msisdn;
                entity.RequestId           = "0";
                entity.ServiceId           = "2288";
                entity.CommandCode         = "DK";
                entity.ServiceType         = 1;
                entity.ChargingCount       = 0;
                entity.FailedChargingTimes = 0;
                entity.RegisteredTime      = DateTime.Now;
                entity.ExpiredTime         = DateTime.Now.AddDays(1);
                entity.RegistrationChannel = "SMS";
                entity.Status              = 1;
                entity.Operator            = GetTelco(msisdn);

                #region GOI HAM DK BEN DOI TAC

                string partnerResult = AppEnv.ThanhNuDangKy(msisdn);

                log.Debug(" ");
                log.Debug("**********");
                log.Debug("Partner_Thanh_Nu_smsKichHoat : " + partnerResult);
                log.Debug("**********");
                log.Debug(" ");

                string[] arrValue = partnerResult.Split('|');
                if (arrValue[0].Trim() == "1")
                {
                    ViSport_S2_Registered_UsersController.ThanhNuRegisterUserStatusUpdate(msisdn, 1);
                    reContent = "Ban da la thanh vien cua Game Thanh Nu. Click vao link sau de dang nhap Game " + arrValue[1];
                }
                else if (arrValue[0].Trim() == "0")
                {
                    DataTable value = ViSport_S2_Registered_UsersController.ThanhNuRegisterUserInsert(entity);
                    if (value.Rows[0]["RETURN_ID"].ToString() == "0")
                    {
                        reContent = "Chuc mung Quy Khach da dang ky thanh cong Game Thanh Nu Gia cuoc 1000d-ngay, Goi dich vu se duoc tu dong gia han hang ngay.Kich hoat tai khoan " + arrValue[1] + " .De huy dang ky, Quy Khach soan HUY TN gui 2288.";
                    }
                    else if (value.Rows[0]["RETURN_ID"].ToString() == "1")
                    {
                        ViSport_S2_Registered_UsersController.ThanhNuRegisterUserStatusUpdate(msisdn, 1);
                        reContent = "Ban da la thanh vien cua Game Thanh Nu. Click vao link sau de dang nhap Game " + arrValue[1];
                    }
                }

                #endregion
            }
            else if (type == "2")//CHARGED SUB
            {
                var partnerService = new vn.thanhnu.Service();

                DataTable dtUser = ViSport_S2_Registered_UsersController.ThanhNuGetUserInfo(msisdn);
                if (dtUser != null && dtUser.Rows.Count > 0)
                {
                    string partnerResult = partnerService.smsGiaHan(msisdn, "1");
                    if (partnerResult.Trim() == "1")
                    {
                        reContent = "Goi dich vu Game Thanh Nu  cua Quy Khach da duoc gia han thanh cong. Quy khach duoc cong 110 G_Coin vao tk. Cam on Quy Khach da su dung goi dich vu .";
                    }

                    #region LOG DOANH THU

                    //LOG DOANH THU
                    var e = new ThanhNuChargedUserLogInfo();

                    e.ID                   = ConvertUtility.ToInt32(dtUser.Rows[0]["ID"].ToString());
                    e.User_ID              = msisdn;
                    e.Request_ID           = "0";
                    e.Service_ID           = serviceId;
                    e.Command_Code         = "DK";
                    e.Service_Type         = 0;
                    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(msisdn);

                    e.Reason = "Succ";

                    e.Price         = 1000;
                    e.PartnerResult = partnerResult;

                    ViSport_S2_Registered_UsersController.ThanhNuChargedUserLog(e);

                    #endregion
                }
            }
            else if (type == "3")//HUY DICH VU
            {
                #region GOI HAM HUY BEN DOI TAC

                string partnerResult = AppEnv.ThanhNuHuy(msisdn);
                if (partnerResult.Trim() == "1")
                {
                    DataTable value = ViSport_S2_Registered_UsersController.ThanhNuRegisterUserStatusUpdate(msisdn, 0);
                    if (value.Rows[0]["RETURN_ID"].ToString() == "1")
                    {
                        reContent = "Toan bo tai khoan Game Thanh Nu cua Quy khach se bi huy.De dang ki lai Qk vui long soan tin DK TN gui 2288";
                    }
                }

                #endregion
            }
        }



        var aSerializer = new JavaScriptSerializer();

        var obj = new MT();
        var ct1 = new ContentInfo();
        obj.List = new ContentInfo[1];

        ct1.Type    = reType;
        ct1.Content = reContent;
        obj.List[0] = ct1;

        string strReturn = aSerializer.Serialize(obj);

        log.Debug(" ");
        log.Debug(" ");
        log.Debug("strReturn: " + strReturn);
        log.Debug(" ");
        log.Debug(" ");

        context.Response.ContentType = "text/html";
        context.Response.Write(strReturn);
    }