Пример #1
0
        // GET: Team/Edit/5
        public ActionResult Edit(long?id)
        {
            #region "BTSS"
            string role;
            string user_name;
            try
            {
                role      = Session["role"].ToString();
                user_name = Session["logon_user"].ToString();
                string grp_id = Session["grp_id"].ToString();
                ViewBag.CanEdit = af.CanEdit(grp_id, "Team");
                if (!ViewBag.CanEdit)
                {
                    return(HttpNotFound());
                }
            }
            catch (Exception exception)
            {
                string result = exception.Message.ToString();
                return(HttpNotFound());
            }
            #endregion "BTSS"
            #region "Method"
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OSC_Team oSC_Team = db.Teams.Find(id);
            if (oSC_Team == null)
            {
                return(HttpNotFound());
            }
            oSC_Team.GroupIds = af.GetGroupIds(id);
            #endregion "Method"
            #region "ViewBagDepartments"
            ViewBag.Departments = new SelectList(db.Departments, "DepartmentId", "DepartmentName");
            #endregion "ViewBagDepartments"
            #region "Return"
            return(View(oSC_Team));

            #endregion "Return"
        }