我正在開發使用ASP.NET MVC 3.0的銷售訂單管理應用程序。我需要開發一個可以添加客戶詳細信息的頁面。ASP MVC 3.0複雜視圖
客戶詳細信息包括
public class Customer
{
public int ID { get; set; }
public string Code { get; set; }
public string Name { get; set; }
public string Alias { get; set; }
public int DefaultCreditPeriod { get; set; }
public Accounts Accounts { get; set; }
public IList<Address> Addresses { get; set; }
public IList<Contact> Contacts { get; set; }
}
public class Accounts
{
public int ID { get; set; }
public string VATNo { get; set; }
public string CSTNo { get; set; }
public string PANNo { get; set; }
public string TANNo { get; set; }
public string ECCNo { get; set; }
public string ExciseNo { get; set; }
public string ServiceTaxNo { get; set; }
public bool IsServiceTaxApplicable { get; set; }
public bool IsTDSDeductable { get; set; }
public bool IsTCSApplicable { get; set; }
}
public class Address
{
public int ID { get; set; }
public AddressType Type { get; set; }
public string Line1 { get; set; }
public string Line2 { get; set; }
public string Line3 { get; set; }
public string Line4 { get; set; }
public string Country { get; set; }
public string PostCode { get; set; }
}
public class Contact
{
public int ID { get; set; }
public ContactType Type { get; set; }
public string Name { get; set; }
public string Title { get; set; }
public string PhoneNumber { get; set; }
public string Extension { get; set; }
public string MobileNumber { get; set; }
public string EmailId { get; set; }
public string FaxNumber { get; set; }
public string Website { get; set; }
}
客戶需要一個單一的頁面,以填補所有客戶的詳細信息(一般信息,帳戶信息,地址信息和聯繫信息)。將有多個地址(賬單,發貨等)和多個聯繫人(銷售,採購)。我是MVC的新手。如何爲上述創建視圖並動態添加多個地址?
沒有冒犯,但你期待什麼樣的答案?你所要求的將涉及*許多*不連貫的步驟,所有這些都需要一些學習。最好的辦法是看一些例子(比如官方的[音樂商店示例](http://www.asp.net/mvc/tutorials/mvc-music-store-part-1)),並嘗試創建頁面一旦你提出了更具體的問題,你就回到SO上來。 –