public IActionResult SaveSmsSettings([FromBody] SmsSettingModel model) { if (ModelState.IsValid) { SmsSetting entity = new SmsSetting(); model.CopyTo(entity); int i = 0; List <SmsBody> bodies = new List <SmsBody>(); foreach (var item in model.Name) { if (item.IsNotEmpty() && model.Content[i].IsNotEmpty()) { bodies.Add(new SmsBody() { Name = item, Content = model.Content[i] }); } i++; } entity.Bodies = bodies; return(_settingService.Save(entity).SaveResult(T)); } return(SaveFailure(GetModelErrors())); }
public WebServiceClient() : base("http://service2.winic.org/Service.asmx") { //_smsSetting = new SmsSetting() { uid = "sctdhh", pwd = "Tdhh20170406" }; _smsSetting = new SmsSetting() { uid = "guochuan", pwd = "fairly123456" }; SMSReturnCode rstr = GetUserInfo(); LogHelper.Warn("smsInfoļ¼" + rstr.ReturnString); if (rstr.IsSuccess) { MaxChars = Convert.ToInt32(rstr.ReturnArray[3]); } }