public OperationResult Delete(int Id) { var model = EduTypes.FirstOrDefault(t => t.Id == Id); model.IsDeleted = true; EduTypeRepository.Update(model); return(new OperationResult(OperationResultType.Success, "删除成功")); }
public OperationResult Update(EduTypeModel model) { var entity = EduTypes.First(t => t.Id == model.Id); entity.Name = model.Name; entity.Description = model.Description; entity.OrderSort = model.OrderSort; entity.Enabled = model.Enabled; entity.ModifyId = model.ModifyId; entity.ModifyBy = model.ModifyBy; entity.ModifyTime = model.ModifyTime; EduTypeRepository.Update(entity); return(new OperationResult(OperationResultType.Success, "更新成功")); }
public OperationResult Insert(EduTypeModel model) { var entity = new EduType { Name = model.Name, Description = model.Description, OrderSort = model.OrderSort, Enabled = model.Enabled, CreateId = model.CreateId, CreateBy = model.CreateBy, CreateTime = DateTime.Now, ModifyId = model.ModifyId, ModifyBy = model.ModifyBy, ModifyTime = DateTime.Now }; EduTypeRepository.Insert(entity); return(new OperationResult(OperationResultType.Success, "添加成功")); }