List<View_VisitorsForm> objvisitlist = (from v in db.View_VisitorsForm select v).ToList();
@model Sample_Customer.View_VisitorsForm
@*@model IEnumerable<Sample_Customer.>*@
@{
ViewBag.Title = "DailyVisitReport";
}
<div class="text-center">
<h2 style="color: #0000FF">Visit Report</h2>
</div>
<link href="~/Content/bootstrap.min.css" rel="stylesheet" />
<link href="~/Content/bootstrap.css" rel="stylesheet" />
<script src="~/Content/BootStrap/js/bootstrap.js"></script>
<script src="~/Content/BootStrap/js/bootstrap.min.js"></script>
<div class="col-xs-12">
<div class="container">
<div class="col-sm-4">
<div class="form-group">
@Html.LabelFor(model=>model.FromDate)
@Html.TextBoxFor(model=>model.FromDate,new { @class = "form-control", type = "text" })
</div>
</div>
<div class="col-sm-4">
<div class="form-group">
@Html.LabelFor(model => model.ToDate)
@Html.TextBoxFor(model => model.ToDate, new { @class = "form-control", type = "text"})
</div>
</div>
<div class="col-sm-5">
<div class="form-group">
<input id="Button1" type="button" value="Ok" />
</div>
</div>
</div>
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th style="color: #1a1ae9">Visiting Date</th>
<th style="color: #1a1ae9">Customer Name</th>
<th style="color: #1a1ae9">Employee</th>
<th style="color: #1a1ae9">Purpose of Visit</th>
<th style="color: #1a1ae9">Contact Person</th>
<th style="color: #1a1ae9">Description</th>
<th style="color: #1a1ae9">Next Appointment</th>
</tr>
</thead>
<tbody>
@foreach (var i in Model.??)( in this place i donno which object i have to call here)
{
<tr>
<td>
@Convert.ToString(string.Format("{0:MMM-dd-yyyy}", i.VisitingDate))
</td>
<td>
@i.CustomerName
</td>
<td>
@i.Employee
</td>
<td>
@i.POVisit
</td>
<td>
@i.ContactPerson
</td>
<td>
@i.Description
</td>
<td>
@Convert.ToString(string.Format("{0:MMM-dd-yyyy}", i.NextAppointment))
</td>
</tr>
}
</tbody>
</table>
My doubt is i call the one model (view_visitorsForm) in VisitorsViewmodel by
public ICollection<View_VisitorsForm> Visits { get; set; }
and i have to list all the data in view when i open the page .so in controller i wrote this code
List<View_VisitorsForm> objvisitlist = (from v in db.View_VisitorsForm select v).ToList();
Now i created the view by giving model name as VisitorsViewModel. Now my doubt is which object i have to call in the place of ??. so it will display all the data when i open the page..
i tried to explain my issue as per my level best please any one understand my issue and help me to solve this problem.
Advance thanks.