using System.Linq; using System.Web.Mvc; using Scheduling.Domain.Abstact; using Scheduling.Domain.Entities; using Scheduling.WebUI.Models; namespace Scheduling.WebUI.Controllers { public class EmployeesController : Controller { private IAccountingService service; public int pageSize = 10; public EmployeesController(IAccountingService srvc) { service = srvc; } public ViewResult List(int page = 1) { ViewBag.Counter = (page - 1) * pageSize + 1; EmployeeListViewModel model = new EmployeeListViewModel() { Employees = service.SelectEmployees(1, 3) .OrderBy(e => e.Id) .Skip((page - 1) * pageSize) .Take(pageSize), PagingInfo = new PagingInfo { CurrentPage = page, ItemsPerPage = pageSize, TotalItems = service.EmployeesCount(1, 3) } }; return View(model); } public ViewResult Edit(int id) { Employee emp = service.GetEmployee(id); return View(emp); } [HttpPost] public ActionResult Edit(Employee emp) { if (ModelState.IsValid) { service.SaveEmployee(emp); return RedirectToAction("List"); } return View(emp); } [HttpPost] public RedirectToRouteResult Delete(int id) { service.DeleteEmployee(id); return RedirectToAction("List"); } public ViewResult Create() { return View("Edit", new Employee()); } } }
Standard input is empty
prog.cs(2,18): error CS0234: The type or namespace name `Mvc' does not exist in the namespace `System.Web'. Are you missing an assembly reference? prog.cs(3,18): error CS0234: The type or namespace name `Domain' does not exist in the namespace `Scheduling'. Are you missing an assembly reference? prog.cs(4,18): error CS0234: The type or namespace name `Domain' does not exist in the namespace `Scheduling'. Are you missing an assembly reference? prog.cs(5,24): error CS0234: The type or namespace name `Models' does not exist in the namespace `Scheduling.WebUI'. Are you missing an assembly reference? prog.cs(9,40): error CS0246: The type or namespace name `Controller' could not be found. Are you missing an assembly reference? prog.cs(11,17): error CS0246: The type or namespace name `IAccountingService' could not be found. Are you missing an assembly reference? prog.cs(14,36): error CS0246: The type or namespace name `IAccountingService' could not be found. Are you missing an assembly reference? prog.cs(19,16): error CS0246: The type or namespace name `ViewResult' could not be found. Are you missing an assembly reference? prog.cs(41,16): error CS0246: The type or namespace name `ViewResult' could not be found. Are you missing an assembly reference? prog.cs(49,16): error CS0246: The type or namespace name `ActionResult' could not be found. Are you missing an assembly reference? prog.cs(61,16): error CS0246: The type or namespace name `RedirectToRouteResult' could not be found. Are you missing an assembly reference? prog.cs(68,16): error CS0246: The type or namespace name `ViewResult' could not be found. Are you missing an assembly reference? Compilation failed: 12 error(s), 0 warnings
Standard output is empty