// GET: AppApi/AppBrowse public ActionResult Save() { AppBrowseRecordedArgs args = RequestArgs <AppBrowseRecordedArgs>(); App_Browse appBrowse = new App_Browse(); appBrowse.member_id = this.UserContext.Member.id; appBrowse.client_type = args.ClientType; appBrowse.create_time = DateTime.Now; _appBrowseManager.CreateBrowse(appBrowse); return(ApiResult(true, "浏览记录保存成功!")); }
public NormalResult CreateBrowse(App_Browse appBrowse) { using (Entities db = new Entities()) { Member dbMember = db.Member.FirstOrDefault(t => t.id == appBrowse.member_id); if (dbMember != null) { //新增访问APP次数 db.App_Browse.Add(appBrowse); //更新会员总访问数 dbMember.app_browse_count += 1; db.SaveChanges(); } } return(new NormalResult()); }