示例#1
0
        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"));
        }
示例#2
0
        public ActionResult Start([Bind(Include = "AssemblyID,Items")] AssemblyProfile assemblyProfile)
        {
            Session["PartId"] = assemblyProfile.Items.PartID;


            return(RedirectToAction("AddAnother", "ConfigurableAssemblyVariables"));
        }
示例#3
0
        // 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));
        }
示例#4
0
        public async Task <ActionResult> DeleteConfirmed(int id)
        {
            AssemblyProfile assemblyProfile = await db.AssemblyProfiles.FindAsync(id);

            db.AssemblyProfiles.Remove(assemblyProfile);
            await db.SaveChangesAsync();

            return(RedirectToAction("Index"));
        }
示例#5
0
        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));
        }
示例#6
0
        // 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));
        }
示例#7
0
 public ActionResult Create([Bind(Include = "AssemblyID,Items")] AssemblyProfile assemblyProfile)
 {
     return(View("AddVariables", assemblyProfile));
 }
示例#8
0
 //GET: ConfigurableAssemblyVariables
 public ActionResult AddVariables(AssemblyProfile assemblyProfile)
 {
     return(View(assemblyProfile));
 }