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