コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Entreprise_Address entreprise_Address = db.Addresses.Find(id);

            db.Addresses.Remove(entreprise_Address);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "AddressID,AddressLine1,AddressLine2,City,Province,Country,PostalCode,EntrepriseAddWeb,ModifiedDate,AddressTypeID,EntrepriseID")] Entreprise_Address entreprise_Address)
 {
     if (ModelState.IsValid)
     {
         entreprise_Address.ModifiedDate    = DateTime.Now;
         db.Entry(entreprise_Address).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AddressTypeID = new SelectList(db.AddressesTypes, "AddressTypeID", "AddressType", entreprise_Address.AddressTypeID);
     ViewBag.EntrepriseID  = new SelectList(db.Entreprises, "EntrepriseID", "EntrepriseName", entreprise_Address.EntrepriseID);
     return(View(entreprise_Address));
 }
コード例 #3
0
        // GET: Entreprise_Address/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Entreprise_Address entreprise_Address = db.Addresses.Find(id);

            if (entreprise_Address == null)
            {
                return(HttpNotFound());
            }
            return(View(entreprise_Address));
        }
コード例 #4
0
        // GET: Entreprise_Address/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Entreprise_Address entreprise_Address = db.Addresses.Find(id);

            if (entreprise_Address == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AddressTypeID = new SelectList(db.AddressesTypes, "AddressTypeID", "AddressType", entreprise_Address.AddressTypeID);
            ViewBag.EntrepriseID  = new SelectList(db.Entreprises, "EntrepriseID", "EntrepriseName", entreprise_Address.EntrepriseID);
            return(View(entreprise_Address));
        }