/// <summary> /// 保存技术问答评论 /// </summary> /// <param name="data"></param> public void SaveAnswerComment(List <EduAnswerEntity> data, EduBaseInfoEntity entity) { IRepository db = new RepositoryFactory().BaseRepository().BeginTrans(); var oldEntity = db.FindEntity <EduBaseInfoEntity>(entity.ID); var list = db.FindList <EduAnswerEntity>(x => x.EduId == entity.ID).ToList(); oldEntity.Teacher = entity.Teacher; oldEntity.TeacherId = entity.TeacherId; oldEntity.RegisterPeople = entity.RegisterPeople; oldEntity.RegisterPeopleId = entity.RegisterPeopleId; oldEntity.Theme = entity.Theme; oldEntity.RunWay = entity.RunWay; oldEntity.Answers = null; oldEntity.Files = null; //遍历 foreach (var item in list) { var newItem = data.Where(s => s.ID == item.ID).FirstOrDefault(); if (newItem != null) { if (string.IsNullOrEmpty(newItem.Grade)) { item.Grade = "0"; } else { item.Grade = newItem.Grade; } item.AppraiseContent = newItem.AppraiseContent; item.Files = null; } } try { db.Update(list); db.Update(oldEntity); db.Commit(); } catch { db.Rollback(); } }
public void Add(EduBaseInfoEntity entity) { baseService.Add(entity); }
public void EditEducation(EduBaseInfoEntity data) { baseService.EditEducation(data); }
public void UdateAnswerComment(List <EduAnswerEntity> data, EduBaseInfoEntity entity) { answerService.SaveAnswerComment(data, entity); }
public void updataEduBaseInfo(EduBaseInfoEntity entity) { baseService.update(entity); }
//public DataTable GetEducationPageList(Pagination pagination, string queryJson) //{ // return baseService.GetEducationPageList(pagination, queryJson); //} public void SaveEduBaseInfo(string id, EduBaseInfoEntity entity) { baseService.SaveForm(id, entity); }
public void Modify(EduBaseInfoEntity entity) { baseService.Modify(entity); }