public void RecoveryDeleted(long id) { using (Dbcontext ctx = new Dbcontext()) { BaseService <GuideUser> bs = new BaseService <GuideUser>(ctx); GuideUser gu = bs.GetRecoveries().Where(e => e.GuideId == id).SingleOrDefault(); gu.IsDeleted = false; ctx.SaveChanges(); } }
public long AddGuideUser(long uid, long gid) { GuideUser g = new GuideUser(); g.Uid = uid; g.GuideId = gid; using (Dbcontext ctx = new Dbcontext()) { ctx.GuideUser.Add(g); ctx.SaveChanges(); } return(g.Id); }
public bool appointment(long GuideId, long Uid) { using (Dbcontext ctx = new Dbcontext()) { try { GuideUser u = new GuideUser(); u.GuideId = GuideId; u.Uid = Uid; ctx.GuideUser.Add(u); ctx.SaveChanges(); return(true); } catch (Exception e) { return(false); } } }