コード例 #1
0
        public ActionResult Edit([Bind(Include = "pk_roleId,tid,PersonName,fk_orgid")] Org_roles org_roles)
        {
            var userid = User.Identity.GetUserId();

            if (ModelState.IsValid)
            {
                db.Entry(org_roles).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }
            ViewBag.fk_orgid = new SelectList(db.Org_details.Where(r => r.fk_id == userid), "pk_orgid", "org_name", org_roles.fk_orgid);
            ViewBag.tid      = new SelectList(db.RoleTypes, "Id", "type", org_roles.tid);
            return(View(org_roles));
        }
コード例 #2
0
        // GET: OrgRoles/Edit/5
        public ActionResult Edit(int?id)
        {
            var userid = User.Identity.GetUserId();

            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Org_roles org_roles = db.Org_roles.Find(id);

            if (org_roles == null)
            {
                return(HttpNotFound());
            }
            ViewBag.fk_orgid = new SelectList(db.Org_details.Where(r => r.fk_id == userid), "pk_orgid", "org_name", org_roles.fk_orgid);
            ViewBag.tid      = new SelectList(db.RoleTypes, "Id", "type", org_roles.tid);
            return(View(org_roles));
        }