Beispiel #1
0
        public ActionResult DeleteConfirmed(int processId, int capitalId)
        {
            ProcessCapital processCapital = db.ProcessCapitals.SingleOrDefault(x => x.ProcessId == processId &&
                                                                               x.CapitalId == capitalId);

            db.ProcessCapitals.Remove(processCapital);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Beispiel #2
0
 public ActionResult Edit([Bind(Include = "ProcessId,CapitalId,Amount,Tag")] ProcessCapital processCapital)
 {
     if (ModelState.IsValid)
     {
         db.Entry(processCapital).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CapitalId = new SelectList(db.Products, "Id", "Name", processCapital.CapitalId);
     ViewBag.ProcessId = new SelectList(db.Processes, "Id", "Name", processCapital.ProcessId);
     return(View(processCapital));
 }
Beispiel #3
0
        // GET: ProcessCapitals/Details/5
        public ActionResult Details(int?processId, int?capitalId)
        {
            if (processId == null || capitalId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProcessCapital processCapital = db.ProcessCapitals.SingleOrDefault(x => x.ProcessId == processId &&
                                                                               x.CapitalId == capitalId);

            if (processCapital == null)
            {
                return(HttpNotFound());
            }
            return(View(processCapital));
        }
Beispiel #4
0
        // GET: ProcessCapitals/Edit/5
        public ActionResult Edit(int?processId, int?capitalId)
        {
            if (processId == null || capitalId == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            ProcessCapital processCapital = db.ProcessCapitals.SingleOrDefault(x => x.ProcessId == processId &&
                                                                               x.CapitalId == capitalId);

            if (processCapital == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CapitalId = new SelectList(db.Products, "Id", "Name", processCapital.CapitalId);
            ViewBag.ProcessId = new SelectList(db.Processes, "Id", "Name", processCapital.ProcessId);
            return(View(processCapital));
        }