Example #1
0
        public async Task <ActionResult <Ctmtran> > PostCtmtran(Ctmtran ctmtran)
        {
            _context.Ctmtrans.Add(ctmtran);
            await _context.SaveChangesAsync();

            return(CreatedAtAction("GetCtmtran", new { id = ctmtran.CtmtransId }, ctmtran));
        }
Example #2
0
        public async Task <IActionResult> PutCtmtran(int id, Ctmtran ctmtran)
        {
            if (id != ctmtran.CustQuoteMasterId)
            {
                return(BadRequest());
            }

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

            try
            {
                _context.Entry(ctmtran).Property(x => x.CtmamtReq).IsModified       = true;
                _context.Entry(ctmtran).Property(x => x.CtmdelAmt).IsModified       = true;
                _context.Entry(ctmtran).Property(x => x.CtmdeliveryDate).IsModified = true;
                _context.Entry(ctmtran).Property(x => x.Ctmcurrency).IsModified     = true;
                _context.Entry(ctmtran).Property(x => x.LastUpdatedBy).IsModified   = true;
                _context.Entry(ctmtran).Property(x => x.LastUpdatedDt).IsModified   = true;
                await _context.SaveChangesAsync();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!CtmtranExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(NoContent());
        }