Reputation: 243
I'm deploying a Adventure Cycle page where the people can order one of bikes. I want to create a Shipping Information
include (Address 1, Address 2, City, Country, Zip/Postal, and State/Province). When click the Submit Order
it will redirect to Complete
page to inform User
that order is successful.
Address
model:
public partial class Address
{
public Address()
{
this.SalesOrderHeaders = new HashSet<SalesOrderHeader>();
this.SalesOrderHeaders1 = new HashSet<SalesOrderHeader>();
}
public int AddressID { get; set; }
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string City { get; set; }
public Nullable<int> StateProvinceID { get; set; }
public string PostalCode { get; set; }
public System.Guid rowguid { get; set; }
public Nullable<System.DateTime> ModifiedDate { get; set; }
public virtual StateProvince StateProvince { get; set; }
public virtual ICollection<SalesOrderHeader> SalesOrderHeaders { get; set; }
public virtual ICollection<SalesOrderHeader> SalesOrderHeaders1 { get; set; }
}
Sales Order Header
:
public partial class SalesOrderHeader
{
public SalesOrderHeader()
{
this.SalesOrderDetails = new HashSet<SalesOrderDetail>();
}
public int SalesOrderID { get; set; }
public byte RevisionNumber { get; set; }
public Nullable<System.DateTime> OrderDate { get; set; }
public Nullable<System.DateTime> DueDate { get; set; }
public Nullable<System.DateTime> ShipDate { get; set; }
public byte Status { get; set; }
public bool OnlineOrderFlag { get; set; }
public string SalesOrderNumber { get; set; }
public string PurchaseOrderNumber { get; set; }
public string AccountNumber { get; set; }
public int CustomerID { get; set; }
public Nullable<int> SalesPersonID { get; set; }
public Nullable<int> TerritoryID { get; set; }
public Nullable<int> BillToAddressID { get; set; }
public Nullable<int> ShipToAddressID { get; set; }
public int ShipMethodID { get; set; }
public Nullable<int> CreditCardID { get; set; }
Upvotes: 0
Views: 535
Reputation:
Hope it will help you, On your Complete View you must put the model Address to the redirect method of the Complet e form: Like
`Public ActionResult SubmitOrder(Address address)
{
...
return View("Complete", address);
}
`
and
on your Complete View
first line must be
`
@Model namespace.Model.Address
//then you can use
@model.AddressLine1
@model.AddressLine2
@model.City
@model.PostalCode
@model.StateProvinceID // You will retrieve an Id here I guess but at least you will
//have your data. embedded in your razor code
`
Upvotes: 1