コード例 #1
0
        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));
            }
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public async Task <MessageReport> Create(SY_ReminderSystem model)
 {
     return(await _SY_ReminderSystemRepository.Add(model));
 }