コード例 #1
0
        //// GET: Posts/Create
        //public async Task<IActionResult> Create()
        //{

        //    var cust = _customerMapper.BlGetAllCustomer();
        //    ViewData["CustomerId"] = new SelectList(cust, "CustomerId", "FullName");
        //    return View();
        //}

        //// POST: Posts/Create
        //[HttpPost]
        //[ValidateAntiForgeryToken]
        //public async Task<IActionResult> Create([Bind("OrderId,CustomerId,OrderNumber,OrderDate,RequiredDate,AdvancePaymentTax,IsOffer,OfferlDetails,Paid")] OrderVm order)
        //{
        //    var cust = _customerMapper.BlGetAllCustomer();
        //    if (ModelState.IsValid)
        //    {
        //        await _OrderMapper.BlInser(order);

        //        return RedirectToAction(nameof(Index));

        //    }

        //    ViewData["CustomerID"] = new SelectList(cust, "CustomerID", "FullName", order.CustomerId);
        //    return View(order);
        //}

        // GET: Order/Details/5
        // GET: OrderDetails/Create
        public IActionResult Create()
        {
            var cust = _customerMapper.BlGetAllCustomer();

            ViewData["CustomerId"] = new SelectList(cust, "CustomerId", "FullName");
            var prod = _productMapper.BlGetAllProduct();

            ViewData["ProductId"] = new SelectList(prod, "ProductId", "Article");
            return(View());
        }