コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            var           menuRole      = _menuRoleService.GetById(id);
            MenuRoleDetay menuRoleDetay = _menuRoleService.GetMenuRoleDetaylar().Where(s => s.Id == menuRole.Id).SingleOrDefault();

            _menuRoleService.Delete(id);
            return(RedirectToAction("Index"));
        }
コード例 #2
0
        // GET: EczaneNobet/MenuRole/Delete/5
        public ActionResult Delete(int id)
        {
            if (id < 1)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var           menuRole      = _menuRoleService.GetById(id);
            MenuRoleDetay menuRoleDetay = _menuRoleService.GetMenuRoleDetaylar().Where(s => s.Id == menuRole.Id).SingleOrDefault();

            if (menuRole == null)
            {
                return(HttpNotFound());
            }
            return(View(menuRole));
        }
コード例 #3
0
        // GET: EczaneNobet/MenuRole/Edit/5
        public ActionResult Edit(int id)
        {
            if (id < 1)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            var           menuRole      = _menuRoleService.GetById(id);
            MenuRoleDetay menuRoleDetay = _menuRoleService.GetMenuRoleDetaylar().Where(s => s.Id == menuRole.Id).SingleOrDefault();

            if (menuRole == null)
            {
                return(HttpNotFound());
            }
            ViewBag.MenuId = new SelectList(_menuService.GetList(), "Id", "LinkText", menuRole.MenuId);
            ViewBag.RoleId = new SelectList(_roleService.GetList(), "Id", "Name", menuRole.RoleId);
            return(View(menuRole));
        }