public override void WorkHandle() { if (!AppContent.IsMoReceive) { this.Stop(); } else { try { List <SmsEnterpriseInfo> users = config.GetEnterprise(); foreach (var item in users) { List <SmsMoInfo> smsMoInfos = new List <SmsMoInfo>(); SmsEnterpriseCfgInfo configmodel = config.GetModelWithKey("chinamobile", item.ID); string keyvalue = configmodel.CfgValue; foreach (int i in config.GetChannels(configmodel)) { smsMoInfos.AddRange(changeMos(ServicesFactory.Execute(i).GetMo(), users)); } configmodel = config.GetModelWithKey("union", item.ID); string ukeyvalue = configmodel.CfgValue; if (keyvalue != configmodel.CfgValue) { foreach (int i in config.GetChannels(configmodel)) { smsMoInfos.AddRange(changeMos(ServicesFactory.Execute(i).GetMo(), users)); } } configmodel = config.GetModelWithKey("cdma", item.ID); if (keyvalue != configmodel.CfgValue && ukeyvalue != configmodel.CfgValue) { foreach (int i in config.GetChannels(configmodel)) { smsMoInfos.AddRange(changeMos(ServicesFactory.Execute(i).GetMo(), users)); } } InsertMo(smsMoInfos); Thread.Sleep(AppContent.MoReceive); } } catch (Exception ex) { Print(ex.Message, ex); } } }