Beispiel #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            AccessRemote accessRemote = db.AccessRemote.Find(id);

            db.AccessRemote.Remove(accessRemote);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
        public ActionResult Create([Bind(Include = "Id,TypeAccess,Domain,Acesso,User,Password,DirSystem,ConnectionString,TypeBase,DataBaseName,UserSsa,PasswordSsa,ApplicationUserId, CompanyId, PhysicalAddress, Ambiente")] AccessRemote accessRemote)
        {
            if (ModelState.IsValid)
            {
                db.AccessRemote.Add(accessRemote);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CompanyId = new SelectList(db.Company, "Id", "CompanyName", accessRemote.CompanyId);
            return(View(accessRemote));
        }
Beispiel #3
0
        // GET: AccessRemotes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AccessRemote accessRemote = db.AccessRemote.Find(id);

            if (accessRemote == null)
            {
                return(HttpNotFound());
            }
            return(View(accessRemote));
        }
Beispiel #4
0
        public ActionResult Edit([Bind(Include = "Id,TypeAccess,Domain,Acesso,User,Password,DirSystem,ConnectionString,TypeBase,DataBaseName,UserSsa,PasswordSsa,ApplicationUserId, CompanyId, PhysicalAddress, Ambiente")] AccessRemote accessRemote)
        {
            var userId = HttpContext.User.Identity.GetUserId();

            accessRemote.ApplicationUserId = userId;

            if (ModelState.IsValid)
            {
                db.Entry(accessRemote).State = EntityState.Modified;
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.CompanyId = new SelectList(db.Company, "Id", "CompanyName", accessRemote.CompanyId);
            return(View(accessRemote));
        }
Beispiel #5
0
        // GET: AccessRemotes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AccessRemote accessRemote = db.AccessRemote.Find(id);

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

            ViewBag.CompanyId = new SelectList(db.Company, "Id", "CompanyName", accessRemote.CompanyId);
            return(View(accessRemote));
        }