Exemple #1
0
        public void Send(string tenantCode, string content, string mobile) 
        {
            AccountServcie service = new AccountServcie();
            decimal balance = service.GetBalance(tenantCode);

            if (balance >= StaticValues.SMSFee)
            {
                //发送查车短信
                SMSSender.Send(content, mobile);

                //更新租户账户
                service.DecreaseBalance(tenantCode, StaticValues.SMSFee);

                //记录消费明细
                AccountDetailService detailService = new AccountDetailService();
                detailService.AddDetail(tenantCode, StaticValues.SMSFee, Enum.ConsumeType.SMSQuery);
            }
            else 
            {
                if (IsAllowSend(tenantCode, mobile)) 
                {
                    SMSSender.Send(StaticValues.ContentOfBalanceIsLessThan, mobile);

                    //更新最后发送短信时间
                    SMSQueryVehicleSettingService settingService = new SMSQueryVehicleSettingService();
                    settingService.UpdateLastSendTime(tenantCode, mobile);
                }
            }
        }
Exemple #2
0
        public void Send(string tenantCode,string content, string mobile) 
        {
            AccountServcie service = new AccountServcie();
            decimal balance = service.GetBalance(tenantCode);

            if (balance >= StaticValues.SMSFee) 
            {
                //发送报警短信
                SMSSender.Send(content, mobile);

                //更新租户账户
                service.DecreaseBalance(tenantCode, StaticValues.SMSFee);

                //记录消费明细
                AccountDetailService detailService = new AccountDetailService();
                detailService.AddDetail(tenantCode, StaticValues.SMSFee, Enum.ConsumeType.SMSAlert);
            }
        }