private IList<EWebSMSAndUser_New> ConvertEntity(EWebSMSInfo info) { IList<EWebSMSAndUser_New> ltResult = new List<EWebSMSAndUser_New>(); if (info.SMSAndUser != null && info.SMSAndUser.Count > 0) { foreach (var item in info.SMSAndUser) { EWebSMSAndUser_New entity = new EWebSMSAndUser_New(); entity.Content = item.Content; entity.IsDel = item.IsDel; entity.IsRead = item.IsRead; entity.ReadTime = item.ReadTime; entity.ReceiveTime = item.ReceiveTime; entity.ReceiveUserCode = item.ReceiveUserCode; entity.RecordID = item.RecordID; entity.SMSInfoID = info.RecordID; entity.SMSInfoType = item.SMSInfoType; entity.Title = item.Title; ltResult.Add(entity); } } return ltResult; }
public void Add(EWebSMSAndUser_New entity) { using (IRepository repository = SessionManager.CreateRepository(typeof(EWebSMSAndUser_New))) { repository.Save(entity); } }