// GET: Employee public ActionResult MainPage(Guid?id, DateTime?startDate = null, DateTime?endDate = null) { var model = new EmployeeMainPageViewModel(); if (id != null) { using (UnitOfWorkManager.NewUnitOfWork()) { var user = _employeeBaseInfoService.GetById(new Guid(id.ToString())); if (user != null) { model.EmployeeBaseInfo = user; model.KeyWord = user.IDCard; var attachementViewModel = new EmployeeAttachementViewModel(); attachementViewModel.IDCard = model.EmployeeBaseInfo.IDCard; attachementViewModel.MinSearchTime = startDate; attachementViewModel.MaxSearchTime = endDate; GenerateAttachementOrders(attachementViewModel); model.AttachementViewModel = attachementViewModel; } } } return(View(model)); }