using CRM.Core.CoreService.PkgSms.InterfaceModel; using System; namespace CRM.Core.CoreService.PkgSms { internal class MsgBatchSend : IMsgSend { IMsgSend execSms; InterfaceModel.SmsAccountID accountId; public MsgBatchSend(InterfaceModel.SmsAccountID _accountId, string account = "", string password = "") { accountId = _accountId; switch (_accountId) { case InterfaceModel.SmsAccountID.YZ: execSms = new InterfaceExec.YiZhengSms(account, password); break; case InterfaceModel.SmsAccountID.YZ2: execSms = new InterfaceExec.YiZhengSms2(account, password); break; case InterfaceModel.SmsAccountID.TencentSms: execSms = new InterfaceExec.TencentSms(account, password); break; default: execSms = null; break; } } public ReturnResult Execute(string[] mobiles, string msg, string typeCode) { if (execSms == null) { return new InterfaceModel.ReturnResult() { ReturnStr = string.Format("参数accountId:{0}错误!", accountId) }; } return execSms.Execute(mobiles, msg, typeCode); } public decimal queryAmt() { if (execSms == null) throw new Exception(string.Format("参数accountId:{0}错误!", accountId)); return execSms.queryAmt(); } } }