コード例 #1
0
        public static void UpdateScore(Score score)
        {
            ARCCproposalsDbContext db = new ARCCproposalsDbContext();

            db.Entry(score).State = EntityState.Modified;
            db.SaveChanges();
        }
コード例 #2
0
        // update if scoring is complete
        public static void UpdateProposal(Proposal proposal)
        {
            ARCCproposalsDbContext db = new ARCCproposalsDbContext();

            db.Entry(proposal).State = EntityState.Modified;
            db.SaveChanges();
        }
コード例 #3
0
        public static bool CreateUser(User user)
        {
            ARCCproposalsDbContext db    = new ARCCproposalsDbContext();
            List <User>            users = new List <User>();

            users = db.Users.ToList();
            bool userExists = false;

            foreach (User u in users)
            {
                if (user.email == u.email)
                {
                    userExists = true;
                }
            }
            if (!userExists)
            {
                db.Users.Add(user);
                db.SaveChanges();
                return(true);
            }
            return(false);
        }