public void EditComponent(int id, string name)
        {
            MAIN_COMPONENTS sl_com = db.MAIN_COMPONENTS.Find(id);

            sl_com.NAME = name;
            db.SaveChanges();
        }
        public ActionResult DeleteConfirmed(int id)
        {
            MAIN_COMPONENTS mAIN_COMPONENTS = db.MAIN_COMPONENTS.Find(id);

            db.MAIN_COMPONENTS.Remove(mAIN_COMPONENTS);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "OBJECTID,NAME")] MAIN_COMPONENTS mAIN_COMPONENTS)
 {
     if (ModelState.IsValid)
     {
         db.Entry(mAIN_COMPONENTS).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(mAIN_COMPONENTS));
 }
        public void AddComponent(string name)
        {
            MAIN_COMPONENTS new_com = new MAIN_COMPONENTS
            {
                NAME = name
            };

            db.MAIN_COMPONENTS.Add(new_com);
            db.SaveChanges();
        }
        public ActionResult Create([Bind(Include = "OBJECTID,NAME")] MAIN_COMPONENTS mAIN_COMPONENTS)
        {
            if (ModelState.IsValid)
            {
                db.MAIN_COMPONENTS.Add(mAIN_COMPONENTS);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(mAIN_COMPONENTS));
        }
        // GET: AgroPark/MAIN_COMPONENTS/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            MAIN_COMPONENTS mAIN_COMPONENTS = db.MAIN_COMPONENTS.Find(id);

            if (mAIN_COMPONENTS == null)
            {
                return(HttpNotFound());
            }
            return(View(mAIN_COMPONENTS));
        }