public async Task <ActionResult> FullCreate([Bind(Include = "AssemblyID,Items,Structures,Processes,Properties,Variables")] AssemblyProfile assemblyProfile) { string partId = Session["PartID"].ToString(); assemblyProfile.Structures = await db.PartStructures.Where(p => p.PartID == partId).FirstOrDefaultAsync(); assemblyProfile.Processes = await db.PartProcesses.Where(p => p.PartID == partId).FirstOrDefaultAsync(); assemblyProfile.Properties = await db.PartProperties.Where(p => p.PartID == partId).ToListAsync(); assemblyProfile.Items = await db.Inventory.Where(p => p.PartID == partId).FirstOrDefaultAsync(); assemblyProfile.Variables = await db.ConfigurableAssemblyVariables.Where(v => v.PartID == partId).ToListAsync(); if (ModelState.IsValid) { AutoCreate(partId); db.AssemblyProfiles.Add(assemblyProfile); await db.SaveChangesAsync(); return(RedirectToAction("Index", "Home")); } return(RedirectToAction("Index", "Home")); }
public ActionResult Start([Bind(Include = "AssemblyID,Items")] AssemblyProfile assemblyProfile) { Session["PartId"] = assemblyProfile.Items.PartID; return(RedirectToAction("AddAnother", "ConfigurableAssemblyVariables")); }
// GET: AssemblyProfiles/Start public ActionResult FullCreate() { AssemblyProfile assemblyProfile = new AssemblyProfile(); string partId = Session["PartID"].ToString(); assemblyProfile = db.AssemblyProfiles.Where(a => a.Items.PartID == partId).FirstOrDefault(); return(View(assemblyProfile)); }
public async Task <ActionResult> DeleteConfirmed(int id) { AssemblyProfile assemblyProfile = await db.AssemblyProfiles.FindAsync(id); db.AssemblyProfiles.Remove(assemblyProfile); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "AssemblyID")] AssemblyProfile assemblyProfile) { if (ModelState.IsValid) { db.Entry(assemblyProfile).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(assemblyProfile)); }
// GET: AssemblyProfiles/Details/5 public async Task <ActionResult> Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } AssemblyProfile assemblyProfile = await db.AssemblyProfiles.FindAsync(id); if (assemblyProfile == null) { return(HttpNotFound()); } return(View(assemblyProfile)); }
public ActionResult Create([Bind(Include = "AssemblyID,Items")] AssemblyProfile assemblyProfile) { return(View("AddVariables", assemblyProfile)); }
//GET: ConfigurableAssemblyVariables public ActionResult AddVariables(AssemblyProfile assemblyProfile) { return(View(assemblyProfile)); }