示例#1
0
        public void Update()
        {
            WorkWithAgreeOtherPlyer work = new WorkWithAgreeOtherPlyer();
            DateTime date = new DateTime();

            date = DateTime.Today;
            Play result = (from p in db.Play
                           where p.FirstId == work.queryToUsersSecond(work.queryToUsersFirst()) && p.SecondId == work.queryToUsersFirst()
                           select p).SingleOrDefault();

            result.Date  = date;
            result.Start = true;

            db.SaveChanges();
        }
示例#2
0
        public void Delete()
        {
            WorkWithAgreeOtherPlyer work = new WorkWithAgreeOtherPlyer();
            CodeFirst context            = new CodeFirst();
            Play      play = context.Play
                             .Where(o => o.FirstId == work.queryToUsersSecond(work.queryToUsersFirst()) && o.SecondId == work.queryToUsersFirst())
                             .FirstOrDefault();

            context.Play.Remove(play);
            context.SaveChanges();
        }
示例#3
0
        public void Delete()
        {
            CodeFirst         context = new CodeFirst();
            IEnumerable <int> indexes = unit.Sql.queryToUsersFirst();

            int index = 0;

            foreach (int i in indexes)
            {
                index = i;
            }
            Play play = context.Play
                        .Where(o => o.SecondId == index || o.FirstId == index)
                        .FirstOrDefault();

            context.Play.Remove(play);
            context.SaveChanges();
        }
示例#4
0
 public void Save()
 {
     context.SaveChanges();
 }