Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            EntityMaster entityMaster = db.EntityMasters.Find(id);

            db.EntityMasters.Remove(entityMaster);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "EntityID,EntityShort,EntityLegalName,Corporation,Location,Country,Comment,UserID,DateModified,DateAdded")] EntityMaster entityMaster)
 {
     if (ModelState.IsValid)
     {
         db.Entry(entityMaster).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Corporation = new SelectList(db.CorporateMasters, "Corporate_ID", "CorporateShort", entityMaster.Corporation);
     ViewBag.Country     = new SelectList(db.CountryLists, "CountryID", "Country", entityMaster.Country);
     return(View(entityMaster));
 }
Пример #3
0
        // GET: EntityMasters/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EntityMaster entityMaster = db.EntityMasters.Find(id);

            if (entityMaster == null)
            {
                return(HttpNotFound());
            }
            return(View(entityMaster));
        }
Пример #4
0
        // GET: EntityMasters/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            EntityMaster entityMaster = db.EntityMasters.Find(id);

            if (entityMaster == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Corporation = new SelectList(db.CorporateMasters, "Corporate_ID", "CorporateShort", entityMaster.Corporation);
            ViewBag.Country     = new SelectList(db.CountryLists, "CountryID", "Country", entityMaster.Country);
            return(View(entityMaster));
        }