예제 #1
0
        // GET: EmployeeSurveyResponse/Details/5
        public async Task <ActionResult> Details(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EmployeeSurveyResponse employeeSurveyResponse = await EmployeeSurveyResponseLib.GetEmployeeSurveyResponse(id);

            //EmployeeSurveyResponse employeeSurveyResponse = await db.EmployeeSurveyResponses.FindAsync(id);
            if (employeeSurveyResponse == null)
            {
                return(HttpNotFound());
            }
            return(View(employeeSurveyResponse));
        }
예제 #2
0
        // GET: EmployeeSurveyResponse/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EmployeeSurveyResponse employeeSurveyResponse = await EmployeeSurveyResponseLib.GetEmployeeSurveyResponse(id);

            //EmployeeSurveyResponse employeeSurveyResponse = await db.EmployeeSurveyResponses.FindAsync(id);
            if (employeeSurveyResponse == null)
            {
                return(HttpNotFound());
            }
            var employees = await EmployeerLib.GetAllEmployees();

            var surveyQuestions = await SurveyQuestionLib.GetAllSurveyQuestions();

            ViewBag.EmployeeId       = new SelectList(employees, "Id", "FullName", employeeSurveyResponse.EmployeeId);
            ViewBag.SurveyQuestionId = new SelectList(surveyQuestions, "Id", "Text", employeeSurveyResponse.SurveyQuestionId);

            //ViewBag.EmployeeId = new SelectList(db.Employees, "Id", "FirstName", employeeSurveyResponse.EmployeeId);
            //ViewBag.SurveyQuestionId = new SelectList(db.SurveyQuestions, "Id", "Text", employeeSurveyResponse.SurveyQuestionId);
            return(View(employeeSurveyResponse));
        }