Exemple #1
0
        public ActionResult DeleteConfirmed(long id)
        {
            machinedetail machinedetail = db.machinedetails.Find(id);

            db.machinedetails.Remove(machinedetail);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemple #2
0
 public ActionResult Edit([Bind(Include = "id,fk_Company,Fk_Machine,Spindles,Description")] machinedetail machinedetail)
 {
     if (ModelState.IsValid)
     {
         db.Entry(machinedetail).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.fk_Company = new SelectList(db.Accounts, "Account_ID", "Account_Name", machinedetail.fk_Company);
     ViewBag.Fk_Machine = new SelectList(db.Machines, "Type_id", "Model", machinedetail.Fk_Machine);
     return(View(machinedetail));
 }
Exemple #3
0
        // GET: CRM/machinedetails/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            machinedetail machinedetail = db.machinedetails.Find(id);

            if (machinedetail == null)
            {
                return(HttpNotFound());
            }
            return(View(machinedetail));
        }
Exemple #4
0
        // GET: CRM/machinedetails/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            machinedetail machinedetail = db.machinedetails.Find(id);

            if (machinedetail == null)
            {
                return(HttpNotFound());
            }
            ViewBag.fk_Company = new SelectList(db.Accounts, "Account_ID", "Account_Name", machinedetail.fk_Company);
            ViewBag.Fk_Machine = new SelectList(db.Machines, "Type_id", "Model", machinedetail.Fk_Machine);
            return(View(machinedetail));
        }