public ViewResult Cubicle(int?numEmployees) { TemplateModelCubicle templateModel = new TemplateModelCubicle(); while (numEmployees > 0) { PersonCubicle p = new PersonCubicle(); templateModel.AddEmployeeCubicle(p); numEmployees -= 1; } return(View("Cubicle", templateModel)); }
public ViewResult SavePersonCubicle(TemplateModelCubicle templateModel) { if (ModelState.IsValid) { SignUtilities util = new SignUtilities(host); try { string fileName = util.CreateSignCubicle(templateModel.EmployeesCubicle); TempData["GeneratedFile"] = fileName; } catch { } return(View("Results")); } else { ModelState.AddModelError("", "Please correct the highlighted error below."); return(View("Cubicle", templateModel)); } }