コード例 #1
0
        // GET: PropertyFloorTypes/Delete/5
        public ActionResult Delete(int?id)
        {
            PropertyFloorType propertyFloorType = db.PropertyFloorTypes.Find(id);

            propertyFloorType.IsDeleted = true;
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Create([Bind(Include = "FloorTypeTitle,IsActive")] PropertyFloorType propertyFloorType)
 {
     if (ModelState.IsValid)
     {
         propertyFloorType.IsDeleted = false;
         propertyFloorType.EntryDate = DateTime.Now;
         propertyFloorType.ByUserID  = 1;
         db.PropertyFloorTypes.Add(propertyFloorType);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     InitPage("Create");
     return(View("PropertyFloorType", propertyFloorType));
 }
コード例 #3
0
        // GET: PropertyFloorTypes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PropertyFloorType propertyFloorType = db.PropertyFloorTypes.Find(id);

            if (propertyFloorType == null)
            {
                return(HttpNotFound());
            }
            InitPage("Edit");
            return(View("PropertyFloorType", propertyFloorType));
        }
コード例 #4
0
        public ActionResult Edit([Bind(Include = "PropertyFloorTypeID,FloorTypeTitle,IsActive")] PropertyFloorType propertyFloorType)
        {
            if (ModelState.IsValid)
            {
                var row = db.PropertyFloorTypes.Find(propertyFloorType.PropertyFloorTypeID);
                if (row != null)
                {
                    row.FloorTypeTitle = propertyFloorType.FloorTypeTitle;
                    row.IsActive       = propertyFloorType.IsActive;
                    db.SaveChanges();
                    return(RedirectToAction("Index"));
                }
            }

            InitPage("Edit");
            return(View("PropertyFloorType", propertyFloorType));
        }