Example #1
0
        public IHttpActionResult PutProject_House(long id, Project_House project_House)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

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

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

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

            return(StatusCode(HttpStatusCode.NoContent));
        }
Example #2
0
        public ActionResult DeleteConfirmed(long id)
        {
            Project_House project_House = db.Project_House.Find(id);

            db.Project_House.Remove(project_House);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Example #3
0
        public IHttpActionResult GetProject_House(long id)
        {
            Project_House project_House = db.Project_House.Find(id);

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

            return(Ok(project_House));
        }
Example #4
0
 public ActionResult Edit([Bind(Include = "ID,BuildID,UnitName,UnitShort,FloorName,FloorShort,HouseName,HouseShort,HouseStatus,HouseIntro,HouseModel,HouseType,HouseClass,HouseCategory,HouseArea,HousePrice,HouseTotal,Remark,OrderID,Status")] Project_House project_House)
 {
     if (ModelState.IsValid)
     {
         db.Entry(project_House).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.BuildID = new SelectList(db.Project_Build, "ID", "BuildName", project_House.BuildID);
     return(View(project_House));
 }
Example #5
0
        public IHttpActionResult PostProject_House(Project_House project_House)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            db.Project_House.Add(project_House);
            db.SaveChanges();

            return(CreatedAtRoute("DefaultApi", new { id = project_House.ID }, project_House));
        }
Example #6
0
        public IHttpActionResult DeleteProject_House(long id)
        {
            Project_House project_House = db.Project_House.Find(id);

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

            db.Project_House.Remove(project_House);
            db.SaveChanges();

            return(Ok(project_House));
        }
Example #7
0
        // GET: House/Details/5
        public ActionResult Details(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project_House project_House = db.Project_House.Find(id);

            if (project_House == null)
            {
                return(HttpNotFound());
            }
            return(View(project_House));
        }
Example #8
0
        // GET: House/Edit/5
        public ActionResult Edit(long?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Project_House project_House = db.Project_House.Find(id);

            if (project_House == null)
            {
                return(HttpNotFound());
            }
            ViewBag.BuildID = new SelectList(db.Project_Build, "ID", "BuildName", project_House.BuildID);
            return(View(project_House));
        }