public async Task <MessageReport> EditData(string recordid, string recordtype, string datereminder, bool isdone) { //Kiểm tra đã có record chưa var obj = await GetById(recordid); if (obj == null) { obj = new SY_ReminderSystem() { Id = recordid, Type = recordtype, DateReminder = Convert.ToDateTime(datereminder), isDone = isdone, }; return(await Create(obj)); } else { obj.DateReminder = Convert.ToDateTime(datereminder); obj.isDone = isdone; return(await Update(obj)); } }
private async Task <MessageReport> UpdateLog(SY_ReminderSystem model) { var query = new StringBuilder(); query.AppendLine("{"); query.AppendLine("'_id': { '$eq': '" + model.Id + "' }"); query.AppendLine("}"); return(await _SY_ReminderSystemRepository.Update(MongoHelper.ConvertQueryStringToDocument(query.ToString()), model)); }
public async Task <MessageReport> Create(SY_ReminderSystem model) { return(await _SY_ReminderSystemRepository.Add(model)); }