Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- using Orders.Models;
- namespace Orders.Controllers
- {
- public class HomeController : Controller
- {
- private OrderBaza baza = new OrderBaza();
- public ActionResult Index()
- {
- return View();
- }
- public ActionResult Orders()
- {
- ViewBag.listOrders = baza.Orders.ToList<Order>();
- return View();
- }
- public ActionResult Confirm(Guid userid, string status)
- {
- Order confirmedOrder = baza.Orders.Find(userid);
- confirmedOrder.Completed_On = DateTime.UtcNow;
- confirmedOrder.Status = status;
- return View("Orders");
- }
- public ActionResult Pay()
- {
- Order newOrder;
- baza.Orders.Add(newOrder = new Order
- {
- Order_Id = Guid.NewGuid(),
- Product_Name = "Gold",
- Amount = 5,
- Created_On = DateTime.Now
- });
- baza.SaveChanges();
- ViewBag.urlString = $"https://stage.centili.com/widget/WidgetModule?api=ce797d8eeab183872300e64cd877a4e3&clientid={newOrder.Order_Id}&country=RS";
- return View("Widget");
- }
- public ActionResult About()
- {
- ViewBag.Message = "Your application description page.";
- return View();
- }
- public ActionResult Contact()
- {
- ViewBag.Message = "Your contact page.";
- return View();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement