Beispiel #1
0
        // GET: Project_Nodes_Allocation/Delete/5
        public async Task <ActionResult> Delete(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project_Nodes_Allocation project_Nodes_Allocation = await db.Project_Nodes_Allocation.FindAsync(id);

            if (project_Nodes_Allocation == null)
            {
                return(HttpNotFound());
            }
            return(View(project_Nodes_Allocation));
        }
Beispiel #2
0
        public async Task <ActionResult> Create([Bind(Include = "id,node_id,project_id")] Project_Nodes_Allocation project_Nodes_Allocation)
        {
            if (ModelState.IsValid)
            {
                project_Nodes_Allocation.id = Utilities.Utility.getUniqueKey();
                db.Project_Nodes_Allocation.Add(project_Nodes_Allocation);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.node_id    = new SelectList(db.Nodes, "id", "rack_id", project_Nodes_Allocation.node_id);
            ViewBag.project_id = new SelectList(db.Projects, "id", "name", project_Nodes_Allocation.project_id);
            return(View(project_Nodes_Allocation));
        }
Beispiel #3
0
        // GET: Project_Nodes_Allocation/Edit/5
        public async Task <ActionResult> Edit(string id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project_Nodes_Allocation project_Nodes_Allocation = await db.Project_Nodes_Allocation.FindAsync(id);

            if (project_Nodes_Allocation == null)
            {
                return(HttpNotFound());
            }
            ViewBag.node_id    = new SelectList(db.Nodes, "id", "rack_id", project_Nodes_Allocation.node_id);
            ViewBag.project_id = new SelectList(db.Projects, "id", "name", project_Nodes_Allocation.project_id);
            return(View(project_Nodes_Allocation));
        }