public override ADL_Order MapOrdertoDLOrder(Order order) { var result = new DL_Order(); result.CustomerId = order.CustomerId; result.DateOrderPlaced = order.DateOrderPlaced; result.DateOrderDispatched = order.DateOrderDispatched; result.SourceId = order.SourceId; result.Cancelled = order.Cancelled; return(result); }
public string CreateOrder(List <ProductModel> products) { try { DL_Order dlOrder = new DL_Order(); string id = Guid.NewGuid().ToString(); foreach (var product in products) { dlOrder.AddOrder(product, id); } } catch (Exception ex) { Console.WriteLine(ex.ToString()); return("false"); } return("true"); }
protected void btnSubmit_Click(object sender, EventArgs e) { DL_Order dlOrder = new DL_Order(); OrderModel orderModel = new OrderModel(); orderModel.FirstName = txtFirstName.Text; orderModel.LastName = txtLastName.Text; orderModel.CredentialID = txtCredentialID.Text; orderModel.DateValid = DateTime.Parse(dateValid.Text); orderModel.DateOfBirth = DateTime.Parse(txtDateOfBirth.Text); orderModel.Province = txtProvince.Text; orderModel.City = txtCity.Text; orderModel.Ward = txtWard.Text; orderModel.Address = txtAddress.Text; orderModel.StoreID = int.Parse(ddlStore.SelectedValue); orderModel.StoreID2 = int.Parse(ddlSubStore.SelectedValue); orderModel.ProductID = int.Parse(Request.QueryString["id"]); dlOrder.InsertData(orderModel); Response.Redirect("ThankYou.aspx"); }