示例#1
0
        public IHttpActionResult PutSystem_Project(long id, System_Project system_Project)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            if (id != system_Project.ID)
            {
                return(BadRequest());
            }

            db.Entry(system_Project).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException)
            {
                if (!System_ProjectExists(id))
                {
                    return(NotFound());
                }
                else
                {
                    throw;
                }
            }

            return(StatusCode(HttpStatusCode.NoContent));
        }
示例#2
0
        public ActionResult DeleteConfirmed(long id)
        {
            System_Project system_Project = db.System_Project.Find(id);

            db.System_Project.Remove(system_Project);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#3
0
        public IHttpActionResult GetSystem_Project(long id)
        {
            System_Project system_Project = db.System_Project.Find(id);

            if (system_Project == null)
            {
                return(NotFound());
            }

            return(Ok(system_Project));
        }
示例#4
0
 public ActionResult Edit([Bind(Include = "ID,CompanyID,ProjectName,ProjectShort,ProjectAddress,ProjectAgreement,ProjectNotes,ProjectStatus,StartDate,EndDate,OrderID,Status")] System_Project system_Project)
 {
     if (ModelState.IsValid)
     {
         db.Entry(system_Project).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CompanyID = new SelectList(db.System_Company, "ID", "CompanyName", system_Project.CompanyID);
     return(View(system_Project));
 }
示例#5
0
        public IHttpActionResult PostSystem_Project(System_Project system_Project)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.System_Project.Add(system_Project);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = system_Project.ID }, system_Project));
        }
示例#6
0
        public IHttpActionResult DeleteSystem_Project(long id)
        {
            System_Project system_Project = db.System_Project.Find(id);

            if (system_Project == null)
            {
                return(NotFound());
            }

            db.System_Project.Remove(system_Project);
            db.SaveChanges();

            return(Ok(system_Project));
        }
示例#7
0
        // GET: Project/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            System_Project system_Project = db.System_Project.Find(id);

            if (system_Project == null)
            {
                return(HttpNotFound());
            }
            return(View(system_Project));
        }
示例#8
0
        // GET: Project/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            System_Project system_Project = db.System_Project.Find(id);

            if (system_Project == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CompanyID = new SelectList(db.System_Company, "ID", "CompanyName", system_Project.CompanyID);
            return(View(system_Project));
        }