Пример #1
0
    public int Execute(int jobId)
    {
        try
        {
            DataTable dt = ViSport_S2_Registered_UsersController.GetQuestionInfoSportGameHero();
            if (dt != null && dt.Rows.Count > 0)
            {
                var    webServiceCharging3G = new WebServiceCharging3g();
                string returnValue          = webServiceCharging3G.PaymentVnmWithAccount("9999999", "1000", "Charged Sub Anh Tai", "Anh_Tai_Sub", "", "", "");
                log.Error("****");
                log.Error("****");
                log.Error("163 Call 139 : Sucess");
                log.Error("Call charging Service : " + returnValue);
                log.Error("****");
                log.Error("****");
            }
        }
        catch (Exception ex)
        {
            log.Error("****");
            log.Error("****");
            log.Error("163 Call 139 : " + ex);
            log.Error("****");
            log.Error("****");
        }

        return(1);
    }
Пример #2
0
    public string PaymentChargingOptimize(string userId)
    {
        var webServiceCharging3G = new WebServiceCharging3g();

        string voiceChatUserName = "";
        string voiceChatPassword = "";
        string voiceChatCpId     = "";

        string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

        string price     = "3000";
        string msgReturn = webServiceCharging3G.PaymentVnmWithAccount(userId, price, "voicechat:" + userId, "voicechat", voiceChatUserName, voiceChatPassword, voiceChatCpId);

        if (msgReturn.Trim() == notEnoughMoney)
        {
            price     = "2000";
            msgReturn = webServiceCharging3G.PaymentVnmWithAccount(userId, price, "voicechat:" + userId, "voicechat", voiceChatUserName, voiceChatPassword, voiceChatCpId);
            if (msgReturn.Trim() == notEnoughMoney)
            {
                price     = "1000";
                msgReturn = webServiceCharging3G.PaymentVnmWithAccount(userId, price, "voicechat:" + userId, "voicechat", voiceChatUserName, voiceChatPassword, voiceChatCpId);
            }
        }

        return(msgReturn + "|" + price);
    }
Пример #3
0
    public int Execute(int jobID)
    {
        try
        {
            var    webServiceCharging3G = new WebServiceCharging3g();
            string userName             = AppEnv.GetSetting("userName_3g_WapVnm");
            string userPass             = AppEnv.GetSetting("password_3g_WapVnm");
            string cpId = AppEnv.GetSetting("cpId_3g_WapVnm");
            string price;

            string returnValue = string.Empty;

            string serviceType = "Charged Sub S2_94x Bonus";
            string serviceName = "S2_94x Bonus";


            DataTable dtUser = ViSport_S2_Registered_UsersController.S294XGetUserRegisteredByServiceId(4);
            if (dtUser != null && dtUser.Rows.Count > 0)
            {
                foreach (DataRow dr in dtUser.Rows)
                {
                    string userId = dr["User_ID"].ToString();
                    price       = "1000";
                    returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId);

                    if (returnValue == "1")//CHARGED THANH CONG
                    {
                        #region GHI LOG DOANH THU

                        ViSport_S2_Registered_UsersController.S294XChargedUserLog3G(
                            userId, dr["Request_ID"].ToString(), dr["Service_Type"].ToString(),
                            dr["Service_ID"].ToString(), dr["Id"].ToString(), dr["Short_Code"].ToString(),
                            dr["Command_Code"].ToString(), "1000", "Charged 4 Shit", "1", userName);

                        #endregion
                    }
                }
            }
        }
        catch (Exception ex)
        {
            _log.Error("S2 94x Lay tap User Loi : " + ex);
            return(0);
        }
        return(1);
    }
Пример #4
0
    public string ChuyenGiaBongDaCharged(string userId, string price, string Request_ID)
    {
        var          webServiceCharging3G = new WebServiceCharging3g();
        const string userName             = "******";
        const string userPass             = "******";
        const string cpId = "1930";
        //const string price = "1000";
        const string content     = "Charged chay cung Euro @2016";
        const string serviceName = "CGBD_Euro_2016";
        string       returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, content, serviceName, userName, userPass, cpId);

        //if (returnValue == "1")//CHARGED THANHCONG
        //{
        #region LOG DOANH THU

        //var logInfo = new ThanTaiChargedUserLogInfo();
        //logInfo.User_ID = userId;
        //logInfo.Request_ID = Request_ID;
        //logInfo.Service_ID = "979";
        //logInfo.Command_Code = "AB";
        //logInfo.Registration_Channel = "SMS";
        //logInfo.Status = 1;
        //logInfo.Operator = "vnmobile";
        //logInfo.Price = ConvertUtility.ToInt32(price);
        //logInfo.Reason = returnValue;

        //ViSport_S2_Registered_UsersController.Euro_ChargedUser_InsertLog(logInfo);
        var logInfo = new ThanTaiChargedUserLogInfo();
        logInfo.User_ID              = userId;
        logInfo.Request_ID           = Request_ID;
        logInfo.Service_ID           = "979";
        logInfo.Command_Code         = "TT";
        logInfo.Registration_Channel = "SMS";
        logInfo.Status   = 1;
        logInfo.Operator = "vnmobile";
        logInfo.Price    = ConvertUtility.ToInt32(price);
        logInfo.Reason   = "Succ";

        ViSport_S2_Registered_UsersController.ThanTai_ChargedUser_InsertLog(logInfo);
        #endregion
        //}


        return(returnValue);
    }
Пример #5
0
    public string CapSoThanTaiCharged(string userId, string Request_ID, string Service_ID)
    {
        var          webServiceCharging3G = new WebServiceCharging3g();
        const string userName             = "******";
        const string userPass             = "******";
        const string cpId        = "1930";
        const string price       = "1000";
        const string content     = "Charged CSTT";
        const string serviceName = "CSTT_DuDoan";
        string       returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, content, serviceName, userName, userPass, cpId);

        if (returnValue == "1")//CHARGED THANHCONG
        {
            #region LOG DOANH THU

            //DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameHeroUserInfoActive(userId);
            //DataRow dr = dtUsers.Rows[0];

            var logInfo = new ThanTaiChargedUserLogInfo();
            logInfo.User_ID              = userId;
            logInfo.Request_ID           = Request_ID;
            logInfo.Service_ID           = Service_ID;
            logInfo.Command_Code         = "TT";
            logInfo.Registration_Channel = "SMS";
            logInfo.Status   = 1;
            logInfo.Operator = "vnmobile";
            logInfo.Price    = ConvertUtility.ToInt32(price);
            logInfo.Reason   = "Succ";

            ViSport_S2_Registered_UsersController.ThanTai_ChargedUser_InsertLog(logInfo);

            #endregion
        }


        return(returnValue);
    }
Пример #6
0
    public int Execute(int jobId)
    {
        WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g();
        string userName = "******";
        string userPass = "******";
        string cpId     = "1930";
        string price;

        try
        {
            DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameHeroUserInfo("841864925596");
            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                string message        = string.Empty;
                string returnValue    = string.Empty;
                string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

                string serviceType = "Charge Hero";
                string serviceName = "ViSport_Hero";
                string reasonLog   = string.Empty;

                for (int i = 0; i < dtUsers.Rows.Count; i++)
                {
                    try
                    {
                        #region TIEN HANH CHARGED

                        price       = "5000";
                        returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                        if (returnValue == "1")
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = "Succ";

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion

                            returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);

                            if (returnValue == "1")
                            {
                                #region LOG DOANH THU

                                var logInfo1 = new SportGameHeroChargedUserLogInfo();

                                logInfo1.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                                logInfo1.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                                logInfo1.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                                logInfo1.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                                logInfo1.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                                logInfo1.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                                logInfo1.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                                logInfo1.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                                logInfo1.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                                logInfo1.ExpiredTime    = DateTime.Now.AddDays(1);

                                logInfo1.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                                logInfo1.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                                logInfo1.Operator = dtUsers.Rows[i]["Operator"].ToString();
                                logInfo1.Price    = ConvertUtility.ToInt32(price);
                                logInfo1.Reason   = "Succ";

                                ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo1);

                                #endregion

                                returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);

                                if (returnValue == "1")
                                {
                                    #region LOG DOANH THU

                                    var logInfo2 = new SportGameHeroChargedUserLogInfo();

                                    logInfo2.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                                    logInfo2.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                                    logInfo2.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                                    logInfo2.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                                    logInfo2.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                                    logInfo2.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                                    logInfo2.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                                    logInfo2.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                                    logInfo2.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                                    logInfo2.ExpiredTime    = DateTime.Now.AddDays(1);

                                    logInfo2.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                                    logInfo2.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                                    logInfo2.Operator = dtUsers.Rows[i]["Operator"].ToString();
                                    logInfo2.Price    = ConvertUtility.ToInt32(price);
                                    logInfo2.Reason   = "Succ";

                                    ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo2);

                                    #endregion
                                }
                            }
                        }


                        if (returnValue != "1")
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = returnValue;

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }

                        if (returnValue == "1")//CHARGED THANH CONG
                        {
                            //reasonLog = "Succ";

                            //SEND MT CHO KHACH HANG

                            //DataTable dtQuestion = ViSport_S2_Registered_UsersController.GetQuestionInfoSportGameHero();
                            //if (dtQuestion != null && dtQuestion.Rows.Count > 0)
                            //{
                            message = "Ban da duoc cong 960 diem cho game show Anh tai bong da.Soan DIEM gui 979 de xem so diem hien tai.";



                            string serviceId   = dtUsers.Rows[i]["Service_ID"].ToString();
                            string commandCode = dtUsers.Rows[i]["Command_Code"].ToString();
                            string requestId   = dtUsers.Rows[i]["Request_ID"].ToString();


                            SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message, serviceId, commandCode, requestId);

                            //}

                            //END SEND MT CHO KHACH HANG
                        }
                        //else
                        //{
                        //    reasonLog = returnValue;
                        //}


                        #endregion
                    }
                    catch (Exception ex)
                    {
                        log.Error("Anh tai bong da Loi charged : " + ex);
                        continue;
                    }
                    //DataTable dt = new DataTable();
                    //dt = ViSport_S2_Registered_UsersController.SportGameHeroCheckUserChargedByDay(dtUsers.Rows[i]["User_ID"].ToString());
                    //if (dt.Rows[0]["RETURN_ID"].ToString().Trim() == "0")
                    //{

                    //}
                }
            }

            return(1);
        }
        catch (Exception ex)
        {
            log.Error("Anh tai bong da Loi lay tap User : " + ex);
            return(0);
        }
    }
Пример #7
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);
        }
    }
Пример #8
0
    public int Execute(int jobID)
    {
        //log.Error(" ");
        //log.Error("****Game Thanh Nu Sub Error******");
        //log.Error("LOG Start");
        //log.Error("**********");
        //log.Error(" ");
        //return 1;

        WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g();

        vn.thanhnu.Service partnerService = new vn.thanhnu.Service();

        string userName = "******";
        string passWord = "******";
        string cpId     = "1937";

        try
        {
            DataTable dtUser = ViSport_S2_Registered_UsersController.ThanhNuGameGetUserByType();
            if (dtUser != null && dtUser.Rows.Count > 0)
            {
                string message       = string.Empty;
                string partnerResult = string.Empty;

                int price = 1000;

                foreach (DataRow dr in dtUser.Rows)
                {
                    string vnmChargedResult = webServiceCharging3G.PaymentVnmWithAccount(dr["User_ID"].ToString(), "1000", "Charged Sub Thanh Nu", "Thanh_Nu_Sub", userName, passWord, cpId);

                    if (vnmChargedResult == "1")//CHARGED THANH CONG
                    {
                        partnerResult = partnerService.smsGiaHan(dr["User_ID"].ToString(), "1");
                        if (partnerResult.Trim() == "1")
                        {
                            message = "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 .";
                            SendMtThanhNu(dr["User_ID"].ToString(), message, dr["Service_ID"].ToString(), dr["Command_Code"].ToString(), dr["Request_ID"].ToString());
                        }
                    }
                    else
                    {
                        partnerResult = partnerService.smsGiaHan(dr["User_ID"].ToString(), "0");
                        if (partnerResult == "1")// CHARGED G_Coint thanh cong
                        {
                            message          = "Quy Khach da gia han thanh cong Game Thanh Nu";
                            price            = 0;
                            vnmChargedResult = "1";
                        }
                        else if (partnerResult == "0")
                        {
                            message = "Tk cua Quy Khach khong du de gia han Game Thanh Nu ";
                        }

                        SendMtThanhNu(dr["User_ID"].ToString(), message, dr["Service_ID"].ToString(), dr["Command_Code"].ToString(), dr["Request_ID"].ToString());
                    }

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

                    e.ID                   = ConvertUtility.ToInt32(dr["ID"].ToString());
                    e.User_ID              = dr["User_ID"].ToString();
                    e.Request_ID           = dr["Request_ID"].ToString();
                    e.Service_ID           = dr["Service_ID"].ToString();
                    e.Command_Code         = dr["Command_Code"].ToString();
                    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             = "vnmobile";

                    if (vnmChargedResult == "1")
                    {
                        e.Reason = "Succ";
                    }
                    else
                    {
                        e.Reason = vnmChargedResult;
                    }

                    e.Price         = price;
                    e.PartnerResult = partnerResult;

                    ViSport_S2_Registered_UsersController.ThanhNuChargedUserLog(e);
                }
            }

            return(1);
        }
        catch (Exception ex)
        {
            log.Error(" ");
            log.Error("****Game Thanh Nu Sub Error******");
            log.Error(ex.ToString());
            log.Error("**********");
            log.Error(" ");

            return(0);
        }
    }
Пример #9
0
    public int Execute(int jobID)
    {
        try
        {
            var webServiceCharging3G = new WebServiceCharging3g();

            //string userName = AppEnv.GetSetting("userName_3g_WapVnm");
            //string userPass = AppEnv.GetSetting("password_3g_WapVnm");
            //string cpId = AppEnv.GetSetting("cpId_3g_WapVnm");

            string userName = AppEnv.GetSetting("userName_3g_visport");
            string userPass = AppEnv.GetSetting("password_3g_visport");
            string cpId     = AppEnv.GetSetting("cpId_3g_visport");

            string price;

            string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

            const string serviceType = "Charged Sub World Cup VTV";
            const string serviceName = "World_Cup_VTV";

            DataTable dtUsers = ViSport_S2_Registered_UsersController.WorldCupGetRegisterUserForChargedVtv();
            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                foreach (DataRow dr in dtUsers.Rows)
                {
                    string userId = dr["User_ID"].ToString();

                    //price = "3000";
                    //string returnValue = webServiceCharging3G.PaymentVnmWithAccount(userId, price, serviceType, serviceName, userName, userPass, cpId);

                    price = "3000";
                    string 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);
                        }
                    }

                    _log.Debug(" ");
                    _log.Debug(" ");
                    _log.Debug("UserId : " + userId);
                    _log.Debug("Price : " + price);
                    _log.Debug("ReturnValue : " + returnValue);
                    _log.Debug("UserName : "******" | UserPass : "******" | CpId : " + cpId);
                    _log.Debug(" ");
                    _log.Debug(" ");

                    if (returnValue == "1")//CHARGED THANH_CONG
                    {
                        #region GOI API sang VTV

                        string url = "http://worldcup.visport.vn/TelcoApi/service.php?action=VMGgiahan&msisdn=" + userId + "&price=" + price;

                        var post = new PostSubmitter();
                        post.Url  = url;
                        post.Type = PostSubmitter.PostTypeEnum.Get;
                        string message = post.Post();

                        _log.Debug(" ");
                        _log.Debug(" ");
                        _log.Debug("API Call : " + url);
                        _log.Debug("UserId : " + userId);
                        _log.Debug("Content From VTV : " + message);
                        _log.Debug(" ");
                        _log.Debug(" ");

                        //SendMtWorldCup(userId, message, dr["Service_ID"].ToString(), dr["Command_Code"].ToString(),dr["User_ID"].ToString());

                        #endregion

                        #region LOG DOANH THU

                        const string reasonLog = "Succ";

                        var logInfo = new SportGameHeroChargedUserLogInfo();

                        logInfo.ID           = ConvertUtility.ToInt32(dr["ID"].ToString());
                        logInfo.User_ID      = dr["User_ID"].ToString();
                        logInfo.Request_ID   = dr["Request_ID"].ToString();
                        logInfo.Service_ID   = dr["Service_ID"].ToString();
                        logInfo.Command_Code = dr["Command_Code"].ToString();

                        logInfo.Service_Type       = ConvertUtility.ToInt32(dr["Service_Type"].ToString());
                        logInfo.Charging_Count     = ConvertUtility.ToInt32(dr["Charging_Count"].ToString());
                        logInfo.FailedChargingTime = ConvertUtility.ToInt32(dr["FailedChargingTimes"].ToString());

                        logInfo.RegisteredTime = ConvertUtility.ToDateTime(dr["RegisteredTime"].ToString());
                        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.Reason   = reasonLog;

                        ViSport_S2_Registered_UsersController.WorldCupChargedUserLogForSubVtv6(logInfo);

                        #endregion
                    }
                }
            }
        }
        catch (Exception ex)
        {
            _log.Error("WC Loi lay Tap User VTV : " + ex);
            return(0);
        }
        return(1);
    }
Пример #10
0
    public int Execute(int jobID)
    {
        var    webServiceCharging3G = new WebServiceCharging3g();
        string userName             = "******";
        string userPass             = "******";
        string cpId = "1930";
        string price;

        try
        {
            DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameUserByTypeBonus();
            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                for (int i = 0; i < dtUsers.Rows.Count; i++)
                {
                    try
                    {
                        #region TIEN HANH CHARGED

                        price = "1000";
                        string returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);

                        if (returnValue == "1")
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = "Succ";

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSubBonus(logInfo);

                            #endregion
                        }
                        else
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = returnValue;

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSubBonus(logInfo);

                            #endregion
                        }

                        #endregion
                    }
                    catch (Exception ex)
                    {
                        log.Error("Anh tai bong da Loi charged : " + ex);
                    }
                }
            }

            return(1);
        }
        catch (Exception ex)
        {
            log.Error("Anh tai bong da Loi lay tap User : " + ex);
            return(0);
        }
    }
Пример #11
0
    public string PaymentVnmWapChargingOptimize(string price, string userId, string commandCode)
    {
        const string notEnoughMoney = "Result:12,Detail:Not enough money.";

        commandCode = commandCode.ToUpper();
        var webServiceCharging3G = new WebServiceCharging3g();

        string msgReturn = "";

        if (AppEnv.GetSetting("Mo949Test") == "1")
        {
            price     = "500";
            msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
        }
        else
        {
            if (price == "10000" && commandCode == "GAMEHOT")
            {
                msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                if (msgReturn == notEnoughMoney)
                {
                    price     = "5000";
                    msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                }
            }
            else if (price == "10000" && commandCode == "NCHAY")
            {
                msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                if (msgReturn == notEnoughMoney)
                {
                    price     = "5000";
                    msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                    if (msgReturn == notEnoughMoney)
                    {
                        price     = "3000";
                        msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                        if (msgReturn == notEnoughMoney)
                        {
                            price     = "2000";
                            msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                        }
                    }
                }
            }
            else if (price == "2000" && commandCode == "VIDEOHAY")
            {
                msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                if (msgReturn == notEnoughMoney)
                {
                    price     = "1000";
                    msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                }
            }
            else if (price == "5000" && commandCode == "TRUYENHOT")
            {
                msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                if (msgReturn == notEnoughMoney)
                {
                    price     = "3000";
                    msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                    if (msgReturn == notEnoughMoney)
                    {
                        price     = "2000";
                        msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                        if (msgReturn == notEnoughMoney)
                        {
                            price     = "1000";
                            msgReturn = webServiceCharging3G.PaymentVnm(userId, price, commandCode, "Mo949_Charging");
                        }
                    }
                }
            }
        }


        return(msgReturn + "|" + price);
    }
    public int Execute(int jobID)
    {
        WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g();
        string userName = "******";
        string userPass = "******";
        string cpId     = "1930";
        string price;

        try
        {
            DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameUserByTypeTp(false);
            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                string message        = string.Empty;
                string returnValue    = string.Empty;
                string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

                string serviceType = "Charge Hero";
                string serviceName = "ViSport_Hero";
                string reasonLog   = string.Empty;

                int count = 0;

                for (int i = 0; i < dtUsers.Rows.Count; i++)
                {
                    if (count >= 3)
                    {
                        Thread.Sleep(1000);
                        count = 0;
                    }

                    try
                    {
                        string msisdn = dtUsers.Rows[i]["User_ID"].ToString();

                        #region TIEN HANH CHARGED

                        price       = "5000";
                        returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Trieu phu bong da ", "Trieuphu_Sub", userName, userPass, cpId);
                        if (returnValue.Trim() == notEnoughMoney)
                        {
                            price       = "3000";
                            returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Trieu phu bong da", "Trieuphu_Sub", userName, userPass, cpId);
                            if (returnValue.Trim() == notEnoughMoney)
                            {
                                price       = "2000";
                                returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Trieu phu bong da", "Trieuphu_Sub", userName, userPass, cpId);
                                if (returnValue.Trim() == notEnoughMoney)
                                {
                                    price       = "1000";
                                    returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Trieu phu bong da", "Trieuphu_Sub", userName, userPass, cpId);
                                }
                            }
                        }

                        if (returnValue == "1")
                        {
                            #region Sinh MDT

                            string code1 = RandomActiveCode.Generate(8);
                            string code2 = RandomActiveCode.Generate(8);
                            ViSport_S2_Registered_UsersController.SportGameHeroLotteryCodeInsert(msisdn, code1);
                            ViSport_S2_Registered_UsersController.SportGameHeroLotteryCodeInsert(msisdn, code2);

                            #endregion

                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = "Succ";

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }
                        else
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = returnValue;

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }

                        if (returnValue == "1")//CHARGED THANH CONG
                        {
                            string today = DateTime.Now.DayOfWeek.ToString();

                            string serviceId   = dtUsers.Rows[i]["Service_ID"].ToString();
                            string commandCode = dtUsers.Rows[i]["Command_Code"].ToString();
                            string requestId   = dtUsers.Rows[i]["Request_ID"].ToString();

                            if (CheckDayOfWeek(today)) //Tra MT vao cac ngay 3,5,7
                            {
                                #region SEND MT THONG_TIN_TRAN_DAU

                                DataTable dtMtFootball = ViSport_S2_Registered_UsersController.SportGameHeroMatchGetByDay();
                                if (dtMtFootball != null && dtMtFootball.Rows.Count > 0)
                                {
                                    string teamA = UnicodeUtility.UnicodeToKoDau(dtMtFootball.Rows[0]["Team_A_Name"].ToString());
                                    string teamB = UnicodeUtility.UnicodeToKoDau(dtMtFootball.Rows[0]["Team_B_Name"].ToString());

                                    string message1 = "Tran dau du doan ngay hom nay la: " + teamA + " va " + teamB + ". De du doan " + teamA + " thang soan KQ 1, du doan " + teamB + " thang soan KQ 3, du doan 2 doi hoa soan KQ 2 gui 979";
                                    SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message1, serviceId, commandCode, requestId); //MT1

                                    string message2 = "De du doan tong so ban thang soan BT G gui 979 (voi G la tong so ban thang 2 doi ghi trong thoi gian thi dau chinh thuc)";
                                    SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message2, serviceId, commandCode, requestId); //MT2

                                    string message3 = "De du doan ti so trong thoi gian chinh thuc soan TS A B gui 979 trong do A la so ban thang doi " + teamA + " ghi duoc, B la so ban thang doi " + teamB + " ghi duoc.";
                                    SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message3, serviceId, commandCode, requestId); //MT3

                                    string message4 = "De du doan " + teamA + " co ti le giu bong nhieu hon soan GB 1, du doan " + teamB + " co ti le giu bong nhieu hon soan GB 3, hai doi co ti le giu bong ngang nhau soan GB 2 gui 979";
                                    SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message4, serviceId, commandCode, requestId); //MT4

                                    string message5 = "De du doan tong so the vang soan TV C gui 979 trong do C la tong so the vang trong tai rut ra cho 2 doi trong thoi gian thi dau chinh thuc ";
                                    SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message5, serviceId, commandCode, requestId); //MT5
                                }


                                #endregion
                            }
                            else //Tra Cau hoi vao cac ngay 2,4,6,CN
                            {
                                #region SEND MT CAU_HOI_BONG_DA

                                //SEND MT CHO KHACH HANG

                                DataTable dtQuestion = ViSport_S2_Registered_UsersController.GetQuestionInfoSportGameHero();
                                if (dtQuestion != null && dtQuestion.Rows.Count > 0)
                                {
                                    message = dtQuestion.Rows[0]["Question"].ToString();
                                    message = message.Replace("P1", "1").Replace("P2", "2");

                                    int    questionIdnew = ConvertUtility.ToInt32(dtQuestion.Rows[0]["Id"].ToString());
                                    string answer        = dtQuestion.Rows[0]["Answer"].ToString();
                                    answer = answer.Replace("P1", "1").Replace("P2", "2");

                                    ViSport_S2_Registered_UsersController.InsertSportGameHeroAnswerLog(dtUsers.Rows[i]["User_ID"].ToString(), questionIdnew, message, answer, DateTime.Now, 0); // LUU LOG Question
                                    SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message, serviceId, commandCode, requestId);
                                }

                                //END SEND MT CHO KHACH HANG

                                #endregion
                            }
                        }

                        #endregion

                        count = count + 1;
                    }
                    catch (Exception ex)
                    {
                        log.Error("Trieu phu bong da Loi charged : " + ex);
                    }
                }
            }

            return(1);
        }
        catch (Exception ex)
        {
            log.Error("Trieu phu bong da Loi lay tap User : " + ex);
            return(0);
        }
    }
Пример #13
0
    public int Execute(int jobID)
    {
        try
        {
            var    webServiceCharging3G = new WebServiceCharging3g();
            string userName             = AppEnv.GetSetting("userName_3g_WapVnm");
            string userPass             = AppEnv.GetSetting("password_3g_WapVnm");
            string cpId = AppEnv.GetSetting("cpId_3g_WapVnm");
            string price;

            string message        = string.Empty;
            string returnValue    = string.Empty;
            string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

            string serviceType = "Charged Sub World Cup";
            string serviceName = "World_Cup";
            string reasonLog   = string.Empty;

            DataTable dtPlayed = ViSport_S2_Registered_UsersController.WorldCupGetMatchPlayed();
            if (dtPlayed != null && dtPlayed.Rows.Count > 0)
            {
                foreach (DataRow drPlayed in dtPlayed.Rows)
                {
                    int    matchId = ConvertUtility.ToInt32(drPlayed["Id"].ToString());
                    string winner  = drPlayed["Winner"].ToString();

                    #region XU LY CONG DIEM

                    DataSet ds = ViSport_S2_Registered_UsersController.WorldCupGetMatchVoteByMatchIdRightAndWrong(matchId, winner);
                    if (ds != null && ds.Tables.Count > 0)
                    {
                        DataTable dtRight = ds.Tables[0];
                        DataTable dtWrong = ds.Tables[1];

                        #region UPDATE RIGHT POINT

                        if (dtRight != null && dtRight.Rows.Count > 0)
                        {
                            foreach (DataRow drR in dtRight.Rows)
                            {
                                ViSport_S2_Registered_UsersController.WorldCupRegisteredUserUpdatePoint(drR["User_Id"].ToString(), 5);
                            }
                        }

                        #endregion

                        #region UPDATE WRONG POINT

                        if (dtWrong != null && dtWrong.Rows.Count > 0)
                        {
                            foreach (DataRow drW in dtWrong.Rows)
                            {
                                ViSport_S2_Registered_UsersController.WorldCupRegisteredUserUpdatePoint(drW["User_Id"].ToString(), 1);
                            }
                        }

                        #endregion
                    }

                    #endregion



                    #region UPDATE Trang Thai TranDau

                    ViSport_S2_Registered_UsersController.WorldCupMatchStatusUpdate(ConvertUtility.ToInt32(drPlayed["Id"].ToString()));

                    #endregion
                }
            }
        }
        catch (Exception ex)
        {
            _log.Error("WC Loi lay Tran Dau vua da xong : " + ex);
            return(0);
        }
        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);
        }
    }
Пример #15
0
    public int Execute(int jobID)
    {
        WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g();
        string userName = "******";
        string userPass = "******";
        string cpId     = "1928";
        string price;

        try
        {
            DataTable dt = ViSport_S2_Registered_UsersController.VClipGetMTByStatus(false);
            if (dt != null && dt.Rows.Count > 0)
            {
                string message        = string.Empty;
                string returnValue    = string.Empty;
                string notEnoughMoney = "Result:12,Detail:Not enough money.";

                string serviceType = "Charged Sub VClip";
                string serviceName = "VClip";
                string reasonLog   = string.Empty;
                string status      = "1";

                foreach (DataRow dr in dt.Rows)
                {
                    string userId = dr["User_ID"].ToString();
                    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 == "1")//CHARGED THANH CONG
                    {
                        #region Log Doanh Thu

                        var logInfo = new ViSport_S2_Charged_Users_LogInfo();

                        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         = ConvertUtility.ToInt32(dr["Service_Type"].ToString());
                        logInfo.Charging_Count       = ConvertUtility.ToInt32(dr["Charging_Count"].ToString());
                        logInfo.FailedChargingTimes  = ConvertUtility.ToInt32(dr["FailedChargingTimes"].ToString());
                        logInfo.RegisteredTime       = ConvertUtility.ToDateTime(dr["RegisteredTime"].ToString());
                        logInfo.ExpiredTime          = DateTime.Now;
                        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.Reason               = "Succ";

                        ViSport_S2_Registered_UsersController.VClipInsertLog(logInfo);

                        #endregion
                    }
                    else
                    {
                        #region Log Doanh Thu

                        var logInfo = new ViSport_S2_Charged_Users_LogInfo();

                        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         = ConvertUtility.ToInt32(dr["Service_Type"].ToString());
                        logInfo.Charging_Count       = ConvertUtility.ToInt32(dr["Charging_Count"].ToString());
                        logInfo.FailedChargingTimes  = ConvertUtility.ToInt32(dr["FailedChargingTimes"].ToString());
                        logInfo.RegisteredTime       = ConvertUtility.ToDateTime(dr["RegisteredTime"].ToString());
                        logInfo.ExpiredTime          = DateTime.Now;
                        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.Reason               = returnValue;

                        ViSport_S2_Registered_UsersController.VClipInsertLog(logInfo);

                        #endregion
                    }

                    if (returnValue == "1")//CHARGED THANH CONG
                    {
                        #region Gui MT cho khach hang thong bao gia han thanh cong

                        var       objSentMt = new ServiceProviderService();
                        const int msgType   = (int)Constant.MessageType.NoCharge;

                        message = "(092)Quy khach da gia han thanh cong DV VMclip cua Vietnamobile. Moi ban truy cap: http://kho-clip.com/" + userId + ".aspx de xem cac video HOT cap nhat 24/24 MIEN PHI. De huy DK, soan CLIP OFF gui 949. HT 19001255";

                        string serviceId   = dr["Service_ID"].ToString();
                        string commandCode = dr["Command_Code"].ToString();
                        string requestId   = dr["Request_ID"].ToString();

                        int value = objSentMt.sendMT(userId, message, serviceId, commandCode, msgType.ToString(), requestId, "1", "1", "0", "0");

                        var objMt = new ViSport_S2_SMS_MTInfo();
                        objMt.User_ID       = userId;
                        objMt.Message       = message;
                        objMt.Service_ID    = serviceId;
                        objMt.Command_Code  = commandCode;
                        objMt.Message_Type  = 1;
                        objMt.Request_ID    = requestId;
                        objMt.Total_Message = 1;
                        objMt.Message_Index = 0;
                        objMt.IsMore        = 0;
                        objMt.Content_Type  = 0;
                        objMt.ServiceType   = 0;
                        objMt.ResponseTime  = DateTime.Now;
                        objMt.isLock        = false;
                        objMt.PartnerID     = "Xzone";
                        objMt.Operator      = "vnmobile";
                        ViSport_S2_SMS_MTController.InsertVClip(objMt);

                        log.Info(" ");
                        log.Info("***** LOG SEND MT VCLIP *****");

                        log.Info("User_ID : " + userId);
                        log.Info("Message : " + message);
                        log.Info("Service_ID : " + serviceId);
                        log.Info("Command_Code : " + commandCode);
                        log.Info("Send_MT : " + value);

                        log.Info("****************************************");
                        log.Info(" ");


                        #endregion
                    }
                }
            }
        }
        catch (Exception ex)
        {
            log.Info(" ");
            log.Info("***** VClip Charged Error *****");
            log.Info("Error : " + ex);
            log.Info(" ");
            return(0);
        }

        return(1);
    }
Пример #16
0
    public int Execute(int jobID)
    {
        WebServiceCharging3g webServiceCharging3G = new WebServiceCharging3g();
        string userName = "******";
        string userPass = "******";
        string cpId     = "1930";
        string price    = "4000";

        try
        {
            DataTable dtUsers = ViSport_S2_Registered_UsersController.GetSportGameUserByType(false);
            if (dtUsers != null && dtUsers.Rows.Count > 0)
            {
                string message        = string.Empty;
                string returnValue    = string.Empty;
                string notEnoughMoney = AppEnv.GetSetting("NotEnoughMoney");

                string serviceType = "Charge Hero";
                string serviceName = "ViSport_Hero";
                string reasonLog   = string.Empty;

                for (int i = 0; i < dtUsers.Rows.Count; i++)
                {
                    try
                    {
                        #region TIEN HANH CHARGED

                        price       = "5000";
                        returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                        if (returnValue.Trim() == notEnoughMoney)
                        {
                            price       = "3000";
                            returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                            if (returnValue.Trim() == notEnoughMoney)
                            {
                                price       = "2000";
                                returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                                if (returnValue.Trim() == notEnoughMoney)
                                {
                                    price       = "1000";
                                    returnValue = webServiceCharging3G.PaymentVnmWithAccount(dtUsers.Rows[i]["User_ID"].ToString(), price, "Charged Sub Anh Tai", "Anh_Tai_Sub", userName, userPass, cpId);
                                }
                            }
                        }

                        if (returnValue == "1")
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = "Succ";

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }
                        else
                        {
                            #region LOG DOANH THU

                            var logInfo = new SportGameHeroChargedUserLogInfo();

                            logInfo.ID           = ConvertUtility.ToInt32(dtUsers.Rows[i]["ID"].ToString());
                            logInfo.User_ID      = dtUsers.Rows[i]["User_ID"].ToString();
                            logInfo.Request_ID   = dtUsers.Rows[i]["Request_ID"].ToString();
                            logInfo.Service_ID   = dtUsers.Rows[i]["Service_ID"].ToString();
                            logInfo.Command_Code = dtUsers.Rows[i]["Command_Code"].ToString();

                            logInfo.Service_Type       = ConvertUtility.ToInt32(dtUsers.Rows[i]["Service_Type"].ToString());
                            logInfo.Charging_Count     = ConvertUtility.ToInt32(dtUsers.Rows[i]["Charging_Count"].ToString());
                            logInfo.FailedChargingTime = ConvertUtility.ToInt32(dtUsers.Rows[i]["FailedChargingTimes"].ToString());

                            logInfo.RegisteredTime = ConvertUtility.ToDateTime(dtUsers.Rows[i]["RegisteredTime"].ToString());
                            logInfo.ExpiredTime    = DateTime.Now.AddDays(1);

                            logInfo.Registration_Channel = dtUsers.Rows[i]["Registration_Channel"].ToString();
                            logInfo.Status   = ConvertUtility.ToInt32(dtUsers.Rows[i]["Status"].ToString());
                            logInfo.Operator = dtUsers.Rows[i]["Operator"].ToString();
                            logInfo.Price    = ConvertUtility.ToInt32(price);
                            logInfo.Reason   = returnValue;

                            ViSport_S2_Registered_UsersController.InsertSportGameHeroChargedUserLogForSub(logInfo);

                            #endregion
                        }

                        if (returnValue == "1")//CHARGED THANH CONG
                        {
                            #region SEND MT CHO USER

                            //SEND MT CHO KHACH HANG

                            DataTable dtQuestion = ViSport_S2_Registered_UsersController.GetQuestionInfoSportGameHero();
                            if (dtQuestion != null && dtQuestion.Rows.Count > 0)
                            {
                                message = dtQuestion.Rows[0]["Question"].ToString();

                                int    questionIdnew = ConvertUtility.ToInt32(dtQuestion.Rows[0]["Id"].ToString());
                                string answer        = dtQuestion.Rows[0]["Answer"].ToString();

                                string serviceId   = dtUsers.Rows[i]["Service_ID"].ToString();
                                string commandCode = dtUsers.Rows[i]["Command_Code"].ToString();
                                string requestId   = dtUsers.Rows[i]["Request_ID"].ToString();


                                ViSport_S2_Registered_UsersController.InsertSportGameHeroAnswerLog(dtUsers.Rows[i]["User_ID"].ToString(), questionIdnew, message, answer, DateTime.Now, 0); // LUU LOG Question
                                SendMtSportGame(dtUsers.Rows[i]["User_ID"].ToString(), message, serviceId, commandCode, requestId);
                            }

                            //END SEND MT CHO KHACH HANG

                            #endregion
                        }

                        #endregion
                    }
                    catch (Exception ex)
                    {
                        log.Error("Anh tai bong da Loi charged : " + ex);
                        continue;
                    }
                }
            }

            return(1);
        }
        catch (Exception ex)
        {
            log.Error("Anh tai bong da Loi lay tap User : " + ex);
            return(0);
        }
    }