// GET: WeightedFiles/Edit/5 public ActionResult Edit(short?id, short?fid) { WeightedFile weightedFile = db.WeightedFile.Where(p => p.QueueID == id && p.FileTypeID == fid).First(); ViewBag.FileTypeName = weightedFile.FileType.TypeDescription; return(View(weightedFile)); }
public async Task <ActionResult> Edit([Bind(Include = "QueueID,FileTypeID,WeightedAmount")] WeightedFile weightedFile) { if (ModelState.IsValid) { db.Entry(weightedFile).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index", new { id = weightedFile.QueueID })); } ViewBag.FileTypeID = new SelectList(db.FileType, "FileTypeID", "TypeDescription", weightedFile.FileTypeID); ViewBag.QueueID = new SelectList(db.Queue, "QueueID", "QueueDescription", weightedFile.QueueID); return(View(weightedFile)); }