Exemple #1
0
        public IActionResult ProductAdd()
        {
            var custi = new Products
            {
                name       = "stand arrow",
                price      = 9999999,
                created_at = DateTime.Now,
                updated_at = DateTime.Now
            };

            _context.Product.Add(custi);
            _context.SaveChanges();
            return(Ok(new { message = "success post data", status = true, data = custi }));
        }
Exemple #2
0
        public IActionResult DriverAdd()
        {
            var custi = new Drivers
            {
                full_name    = "Speedwagon",
                phone_number = "6533456432",
                created_at   = DateTime.Now,
                updated_at   = DateTime.Now
            };

            _context.Driver.Add(custi);
            _context.SaveChanges();
            return(Ok(new { message = "success post data", status = true, data = custi }));
        }
Exemple #3
0
        public IActionResult OrderAdd()
        {
            var custi = new Orders
            {
                user_id      = 1,
                order_status = "ok",
                driver_id    = 1,
                created_at   = DateTime.Now,
                updated_at   = DateTime.Now
            };

            _context.Order.Add(custi);
            _context.SaveChanges();
            return(Ok(new { message = "success post data", status = true, data = custi }));
        }
Exemple #4
0
        public IActionResult CustomerAdd()
        {
            var custi = new Customers
            {
                full_name    = "Jonathan Joestar",
                username     = "******",
                email        = "*****@*****.**",
                phone_number = "32676546342",
                created_at   = DateTime.Now,
                updated_at   = DateTime.Now
            };

            _context.Customer.Add(custi);
            _context.SaveChanges();
            return(Ok(new { message = "success post data", status = true, data = custi }));
        }
Exemple #5
0
 public IActionResult Post(Driver data)
 {
     _context.Drivers.Add(data);
     _context.SaveChanges();
     return(CreatedAtAction("created", new { Status = "Database has been updated", Data = "" }));
 }
Exemple #6
0
 public IActionResult Post(Product data)
 {
     _context.Products.Add(data);
     _context.SaveChanges();
     return(Ok());
 }
 public IActionResult Post(Customer data)
 {
     _context.Customers.Add(data);
     _context.SaveChanges();
     return(Ok());
 }