Example #1
0
        public async Task <ActionResult <JsonData> > Add(ReqJobAdd reqJobAdd)
        {
            var job = new Job();

            job.UserID      = LoginUserID;
            job.CollectTime = DateTime.Now;
            job.Describe    = reqJobAdd.Describe;
            job.Time        = reqJobAdd.Time.Date;
            await _context.Job.AddAsync(job);

            await _context.SaveChangesAsync();

            return(_jsonData);
        }
Example #2
0
        public async Task <ActionResult <JsonData> > LifelongModify(string describe)
        {
            LifelongTarget lifelongTarget = await _context.LifelongTarget.FindAsync(LoginUserID);

            if (lifelongTarget == null)
            {
                lifelongTarget = new LifelongTarget();
                _context.LifelongTarget.Add(lifelongTarget);
            }
            lifelongTarget.Describe = describe;
            await _context.SaveChangesAsync();

            return(_jsonData);
        }