Пример #1
0
        // GET: Users_Courts/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Users_Courts users_Courts = db.Users_Courts.Find(id);

            if (users_Courts == null)
            {
                return(HttpNotFound());
            }

            Users_CourtsDto users_courts = new Users_CourtsDto();

            users_courts.ID           = users_Courts.ID;
            users_courts.CourtsOffice = users_Courts.CourtsOffice;
            users_courts.Role         = users_Courts.Role;
            users_courts.SubRole      = users_Courts.SubRole;
            users_courts.User         = users_Courts.User;
            users_courts.User1        = users_Courts.User1;
            users_courts.User2        = users_Courts.User2;
            users_courts.isActive     = users_Courts.isActive;

            return(View(users_courts));
        }
Пример #2
0
        // GET: Users_Courts/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Users_Courts users_Courts = db.Users_Courts.Find(id);

            if (users_Courts == null)
            {
                return(HttpNotFound());
            }

            ViewBag.CorutID       = new SelectList(db.Courts, "CourtID", "CourtName", users_Courts.CourtsOffice.CourtId);
            ViewBag.CorutOfficeID = new SelectList(db.CourtsOffices, "Id", "OfficeName", users_Courts.CorutOfficeID);
            ViewBag.RoleID        = new SelectList(db.Roles, "ID", "Name", users_Courts.RoleID);
            ViewBag.SupRoleID     = new SelectList(db.SubRoles, "ID", "Name", users_Courts.SupRoleID);
            ViewBag.UserID        = new SelectList(db.Users, "ID", "UserName", users_Courts.UserID);
            ViewBag.CreateAdminID = new SelectList(db.Users, "ID", "UserName", users_Courts.CreateAdminID);
            ViewBag.UpdateAdminID = new SelectList(db.Users, "ID", "UserName", users_Courts.UpdateAdminID);

            Users_CourtsDto users_courts = new Users_CourtsDto();

            users_courts.ID           = users_Courts.ID;
            users_courts.CourtsOffice = users_Courts.CourtsOffice;
            users_courts.Role         = users_Courts.Role;
            users_courts.SubRole      = users_Courts.SubRole;
            users_courts.User         = users_Courts.User;
            users_courts.User1        = users_Courts.User1;
            users_courts.User2        = users_Courts.User2;
            users_courts.isActive     = users_Courts.isActive;

            return(View(users_courts));
        }