I am trying to make an Intranet that allows Customers to be added to a database and then allow further information to be added about them. The main issue is that for things like employee info, there is multiple employees and so I tried to put the customer information models inside the AddCustomers model details page, however this message was returned.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Only one 'model' statement is allowed in a file.
Source Error:
Line 36: Line 37: <!--------------------------------------------------------------------------> Line 38: @model IEnumerable<Intranet.Models.EmployeeInfo> Line 39: Line 40: @{
Source File: /Views/AddCustomers/Details.cshtml Line: 38
Is there a way to get around only one model statement being allowed in a file or is there a better way to achieve what I am trying to do?
Edit:
namespace Intranet.Models
{
public class AddCustomers
{
public int AddCustomersID { get; set; }
public string CompanyName { get; set; }
public string Status { get; set; }
}
public class EmployeeInfo
{
public int EmployeeInfoID { get; set; }
public string Forename { get; set; }
public string Surname { get; set; }
public string Title { get; set; }
public string Mobile { get; set; }
public string Telephone { get; set; }
public string Email { get; set; }
}
public class ContactInfo
{
public int ContactInfoID { get; set; }
public string Code { get; set; }
public string Address { get; set; }
public string Postcode { get; set; }
public string Telephone { get; set; }
}
I want to be able to add customer info e.g. EmployeeInfo
and ContactInfo
after creating a customer in AddCustomers
. However with there being multiple employees I need to have separate tables for the information and want these tables/models inside the AddCustomers
details view.