Beispiel #1
0
        public async Task <IActionResult> PutLBMail(int id, LBMail lBMail)
        {
            if (id != lBMail.idlbmail)
            {
                return(BadRequest());
            }

            _context.Entry(lBMail).State = EntityState.Modified;

            try
            {
                lBMail.hmod = DateTime.Now.ToString("HH:mm");
                lBMail.fmod = DateTime.Now.ToString("dd/M/yyyy");

                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!LBMailExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }
Beispiel #2
0
        public async Task <ActionResult <LBMail> > PostLBMail(LBMail lBMail)
        {
            lBMail.faltrto = DateTime.Now;
            lBMail.hmod    = DateTime.Now.ToString("HH:mm");
            lBMail.fmod    = DateTime.Now.ToString("dd/M/yyyy");

            _context.LBMail.Add(lBMail);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetLBMail", new { id = lBMail.idlbmail }, lBMail));
        }