예제 #1
0
        public MessageReport Create(AccountCourseLog obj)
        {
            var rp = new MessageReport();

            try
            {
                _IAccountCourseLogRepository.Add(obj);
                rp.Success = true;
                rp.Message = "Thêm thành công!";
            }catch (Exception ex)
            {
                rp.Message = ex.Message;
            }
            return(rp);
        }
예제 #2
0
        public MessageReport Update(string _id, AccountCourseLog obj)
        {
            var rp = new MessageReport();

            try
            {
                var query = Builders <AccountCourseLog> .Filter.Eq(x => x._id, _id);

                var update = Builders <AccountCourseLog> .Update.Set(x => x.Course_id, obj.Course_id)
                             .Set(x => x.Account_id, obj.Account_id)
                             .Set(x => x.CreatedDate, obj.CreatedDate)
                             .Set(x => x.IsActive, obj.IsActive)
                             .Set(x => x.Price, obj.Price);

                _IAccountCourseLogRepository.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);
        }
예제 #3
0
 public JsonResult Update(string _id, [FromBody] AccountCourseLog obj)
 {
     return(Json(_AccountCourseLogService.Update(_id, obj)));
 }
예제 #4
0
 public JsonResult Create([FromBody] AccountCourseLog obj)
 {
     return(Json(_AccountCourseLogService.Create(obj)));
 }