public MessageReport Update(string _id, ConquestTopic obj) { var rp = new MessageReport(); try { var query = Builders <ConquestTopic> .Filter.Eq(x => x._id, _id); var update = Builders <ConquestTopic> .Update .Set(x => x.Topics_id, obj.Topics_id) .Set(x => x.Note, obj.Note) .Set(x => x.IsComplete, obj.IsComplete) .Set(x => x.CreatedDate, obj.CreatedDate) .Set(x => x.Account_id, obj.Account_id) .Set(x => x.CompleteDate, obj.CompleteDate); _IConquestTopicsRepository.Update(query, update); rp.Success = true; rp.Message = "Cập nhật thành công!"; }catch (Exception ex) { rp.Message = ex.Message; } return(rp); }
public MessageReport Create(ConquestTopic obj) { var rp = new MessageReport(); try { _IConquestTopicsRepository.Add(obj); rp.Success = true; rp.Message = "Thêm thành công!"; }catch (Exception ex) { rp.Message = ex.Message; } return(rp); }
public JsonResult Update(string _id, [FromBody] ConquestTopic obj) { return(Json(_ConquestTopics.Update(_id, obj))); }
public JsonResult Create([FromBody] ConquestTopic obj) { return(Json(_ConquestTopics.Create(obj))); }