示例#1
0
        // POST: api/Ptask
        public void Post([FromBody] Ptask value)
        {
            ProjectdbContext db = new ProjectdbContext();

            db.Ptask.Add(value);
            db.SaveChanges();
        }
示例#2
0
        // PUT: api/Ptask/5
        public void Put(int id, [FromBody] Ptask value)
        {
            ProjectdbContext db = new ProjectdbContext();
            Ptask            p  = db.Ptask.Where(emp => emp.Tid == id).FirstOrDefault();

            if (p != null)
            {
                p.Tid    = value.Tid;
                p.AsTo   = value.AsTo;
                p.tsdate = value.tsdate;
                p.tedate = value.tedate;
                p.Tc     = value.Tc;
                p.uid    = value.uid;
                db.SaveChanges();
            }
        }