コード例 #1
0
        public ActionResult AddPerson()
        {
            //Переходи на страницу добавления работника
            DataAccessModel model = new DataAccessModel();

            ViewBag.Positions = new SelectList(model.DropDownPositions(), "Value", "Text");
            ViewBag.Companies = new SelectList(model.DropDowmCompanies(), "Value", "Text");
            return(View());
        }
コード例 #2
0
        public ActionResult EditPerson(int id)
        { // Получаем работника для редактирования
            DataAccessModel model = new DataAccessModel();

            ViewBag.Positions = new SelectList(model.DropDownPositions(), "Value", "Text");
            ViewBag.Companies = new SelectList(model.DropDowmCompanies(), "Value", "Text");

            return(View(model.SelectPerson(id)));
        }