using System; using WX.CRM.CRMServices.PkgSms.InterfaceExec; namespace WX.CRM.CRMServices.SMS { internal class MsgSend : IMsgSend { IMsgSend execSms; InterfaceModel.SmsAccountID accountId; public MsgSend(InterfaceModel.SmsAccountID _accountId, string account = "", string password = "") { accountId = _accountId; switch (_accountId) { case InterfaceModel.SmsAccountID.HuiZhi: execSms = new InterfaceExec.HuiZhi(account, password); break; case InterfaceModel.SmsAccountID.RuiXin: execSms = new InterfaceExec.ExecRuiXin(account, password); break; case InterfaceModel.SmsAccountID.QiXinTong: execSms = new InterfaceExec.QiXinTong(); break; case InterfaceModel.SmsAccountID.Ent: execSms = new InterfaceExec.EntSms(account, password); break; case InterfaceModel.SmsAccountID.Ent2: execSms = new InterfaceExec.EntSms2(account, password); break; case InterfaceModel.SmsAccountID.ENT3: execSms = new InterfaceExec.EntSms(account, password); break; case InterfaceModel.SmsAccountID.SM360: execSms = new InterfaceExec.Sms360(account, password); break; case InterfaceModel.SmsAccountID.CAT: execSms = new upCat(account, password); break; case InterfaceModel.SmsAccountID.LianTong: execSms = new InterfaceExec.LianTong(account, password); break; case InterfaceModel.SmsAccountID.TaoBaoTxt: execSms = new InterfaceExec.TbTxt(account, password); break; case InterfaceModel.SmsAccountID.TaoBaoTxtVoice: execSms = new InterfaceExec.TbTxtToVoice(account, password); break; case InterfaceModel.SmsAccountID.QQSms: execSms = new InterfaceExec.QQSms(account, password); break; case InterfaceModel.SmsAccountID.ZJZXSms: execSms = new InterfaceExec.ZQZXSms(account, password); break; case InterfaceModel.SmsAccountID.QYXS: execSms = new WX.CRM.CRMServices.PkgSms.InterfaceExec.QYXS(); break; case InterfaceModel.SmsAccountID.AliYun: execSms = new InterfaceExec.AliYunSms(account, password); break; 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 InterfaceModel.ReturnResult Execute(string[] mobiles, string msg) { if (execSms == null) { return new InterfaceModel.ReturnResult() { ReturnStr = string.Format("参数accountId:{0}错误!", accountId) }; } return execSms.Execute(mobiles, msg); } public decimal queryAmt() { if (execSms == null) throw new Exception(string.Format("参数accountId:{0}错误!", accountId)); return execSms.queryAmt(); } } }