コード例 #1
0
 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();
     }
 }
コード例 #2
0
        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);
        }
コード例 #3
0
 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);
         }
     }
 }