Exemplo n.º 1
0
 public ActionResult Edit([Bind(Include = "instrumentID,instrumentDesc,instrumentType,instrumentPrice,clientID")] Instruments instruments)
 {
     if (ModelState.IsValid)
     {
         db.Entry(instruments).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(instruments));
 }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "clientID,clientFirstName,clientLastName,clientAddress,clientCity,clientState,clientZip,clientEmail,clientPhone")] Clients clients)
 {
     if (ModelState.IsValid)
     {
         db.Entry(clients).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(clients));
 }
Exemplo n.º 3
0
        public ActionResult Create([Bind(Include = "clientID,clientFirstName,clientLastName,clientAddress,clientCity,clientState,clientZip,clientEmail,clientPhone")] Clients clients, int ID)
        {
            if (ModelState.IsValid)
            {
                db.Clients.Add(clients);
                db.SaveChanges();
                // lookup instrument
                Instruments instruments = db.Instruments.Find(ID);
                //update instrument
                instruments.clientID        = clients.clientID;
                db.Entry(instruments).State = EntityState.Modified;
                // save changes
                db.SaveChanges();

                return(RedirectToAction("Summary", new { ClientID = clients.clientID, InstrumentID = instruments.instrumentID }));
            }

            return(View(clients));
        }