public JsonResult CustomerOrderUpdate(ENCustomerOrder order) { try { order.Save(); return(Json(new { Result = "OK" })); } catch (Exception ex) { return(Json(new { Result = "ERROR", Message = ex.Message })); } }
public JsonResult CustomerOrderList() { try { var reader = new ENCustomerOrder(); var list = reader.ReadAll(); return(Json(new { Result = "OK", Records = list, TotalRecordCount = list.Count })); } catch (Exception ex) { return(Json(new { Result = "ERROR", Message = ex.Message })); } }
public ActionResult Checkout() { var cart = ShoppingCart.Instance; var order = new ENCustomerOrder(); order.DataOrder = DateTime.Now; order.CustomerId = 1;//TODO: Get Customer from Session foreach (var item in cart.Items) { order.AddLine(item.Book, item.Quantity); } try { order.Save(); cart.Items.Clear(); } catch (Exception ex) { } return(View("Cart", ShoppingCart.Instance)); }
//PEDIDOS CLIENTES private void buttonMostrarPedidosPadres_Click(object sender, EventArgs e) { ENCustomerOrder customerorder = new ENCustomerOrder(); // List<ENCustomerOrder> list = customerorder. }