public void Update(string img) { int id = 8; User evaSum = userRepository.Get(id); //evaSum.Teacher_evaluation = summary.Teacher_evaluation; evaSum.Image = img; userRepository.Update(evaSum); }
public bool UserCheck(int userId) { try { var query = userManage.Query().Where(m => m.ID == userId); User userList = query.FirstOrDefault(); userList.IsExamine = true; userManage.Update(userList); return(true); } catch { return(false); } }
/// <summary> /// 数据更新 /// </summary> /// <param name="Equip"></param> /// <returns></returns> public bool Update(EquipBaseDto Equip) { try { Equipment evaEquip = EquipRepository.Get(Equip.ID); evaEquip.IsExamine = Equip.IsExamine; evaEquip.Pass = Equip.Pass; EquipRepository.Update(evaEquip); return(true); } catch { return(false); } }
public bool Update(LeaveBaseDto leave) { try { Leave evaLeave = LeaveRepository.Get(leave.ID); evaLeave.IsExamine = leave.IsExamine; evaLeave.Pass = leave.Pass; LeaveRepository.Update(evaLeave); return(true); } catch { return(false); } }
public bool InsertNoticeData(string oNoticeTitle, string oNoticeText, DateTime oNowTime, int UserId) { Notice aTable = new Notice(); aTable.Enabled = 1; aTable.Text = oNoticeText; aTable.Title = oNoticeTitle; aTable.Time = oNowTime; aTable.User_ID = UserId; var list = LabRepository.Query().Where(c => c.Enabled == 1); List <Notice> NoticeList = list.ToList().ConvertAll(c => AutoMapperHelp.ConvertToDto <Notice, Notice>(c)); if (NoticeList.Count != 0) { NoticeList[0].Enabled = 0; LabRepository.Update(NoticeList[0]); } LabRepository.Add(aTable); return(true); }
public bool Update(SumBaseDto summary) { try { Summary evaSum = SumRepository.Get(summary.TID); //evaSum.Teacher_evaluation = summary.Teacher_evaluation; evaSum.Teacher_evaluation = System.Text.RegularExpressions.Regex.Replace(summary.Teacher_evaluation, @"<[^>]*>", ""); SumRepository.Update(evaSum); return(true); } catch { return(false); } //var list = SumRepository.Query().Where(m => m.ID == id).ToList(); //List<SumBaseDto> SumList = list.ConvertAll(c=>AutoMapperHelp.ConvertToDto<Summary, SumBaseDto>(c)); ////RegisterDto tt = infoList.FirstOrDefault(); ////User ss = AutoMapperHelp.ConvertModel<User, RegisterDto>(tt); //SumBaseDto sumEva = SumList.FirstOrDefault(); //sumEva.Teacher_evaluation = summary.Teacher_evaluation; //Summary evaList = AutoMapperHelp.ConvertModel<Summary, SumBaseDto>(sumEva); //Summary sumDt = SumRepository.Update(evaList); }