コード例 #1
0
        public IActionResult Put(int id, [FromBody] Interaction interaction)
        {
            Interaction tempInteraction = _context.interactions.FirstOrDefault(i => i.interaction_id == id);

            if (tempInteraction == null)
            {
                return(NotFound("Could not find a lead"));
            }

            _context.interactions.Remove(tempInteraction);
            _context.Add(interaction);
            _context.SaveChanges();
            return(Ok(_context.interactions.Include(i => i.lead.customer).Include(i => i.lead.priority_type).Include(i => i.lead.status_type).Include(l => l.employee).ToList()));
        }
コード例 #2
0
        public IActionResult Put(int id, [FromBody] Lead lead)
        {
            Lead tempLead = _context.leads.FirstOrDefault(l => l.lead_id == id);

            if (tempLead == null)
            {
                return(NotFound("Could not find a lead"));
            }

            _context.leads.Remove(tempLead);
            _context.Add(lead);
            _context.SaveChanges();
            return(Ok(_context.leads.Include(l => l.customer.detail).Include(l => l.employee).Include(l => l.status_type).Include(l => l.priority_type).ToList()));
        }
コード例 #3
0
        public IActionResult Put(int id, [FromBody] Customer customer)
        {
            Customer tempCustomer = _context.customers.FirstOrDefault(w => w.customer_id == id);

            if (tempCustomer == null)
            {
                return(NotFound("Could not find a tweet"));
            }

            _context.customers.Remove(tempCustomer);
            _context.Add(customer);
            _context.SaveChanges();
            return(Ok(_context.customers.Include(c => c.detail).ToList()));
        }