public ServiceResult UpdateInfo(LearningInfoModel model) { ServiceResult result = new ServiceResult(); LearningInfo info = SingleInfo(model.Id); info.Desc = model.Desc; info.LastDate = DateTime.Now; info.LastUserId = model.UserId; info.Title = model.Title; info.Content = model.Content; info.ParentId = model.ParentId; info.Labs = model.Labs; info.Id = model.Id; info.TitleImgs = model.TitleImgs; _learningInfo.Update(info); result.Code = 1; result.Message = "更新成功"; result.State = ServiceState.Success; return(result); }
public LearningInfoModel ConverToInfoModel(LearningInfo model) { LearningInfoModel vmodel = new LearningInfoModel(); vmodel.Id = model.Id; vmodel.Labs = model.Labs; vmodel.Title = model.Title; vmodel.TitleImgs = model.TitleImgs; vmodel.ParentId = model.ParentId; vmodel.UserId = model.CreateUserId; vmodel.Desc = model.Desc; vmodel.Content = model.Content; vmodel.CompanyId = model.CompanyId; vmodel.CreateDate = model.CreateDate; return(vmodel); }
public ServiceResult AddInfo(LearningInfoModel model) { ServiceResult result = new ServiceResult(); LearningInfo info = new LearningInfo(); info.CreateDate = DateTime.Now; info.LastDate = DateTime.Now; info.Desc = model.Desc; info.Content = model.Content; info.LastUserId = model.UserId; info.Labs = model.Labs; info.CreateUserId = model.UserId; info.CompanyId = model.CompanyId; info.Title = model.Title; info.TitleImgs = model.TitleImgs; _learningInfo.Insert(info); return(result); }