public ActionResult DeleteConfirmed(int id)
        {
            AddSeed addSeed = db.AddSeeds.Find(id);

            db.AddSeeds.Remove(addSeed);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
        public ActionResult AddSeed(AddSeed seedModel)
        {
            AgricultureEntities1 dbseed = new AgricultureEntities1();

            dbseed.AddSeeds.Add(seedModel);
            dbseed.SaveChanges();
            TempData["result"] = "Data added Successfully";
            return(RedirectToAction("AddSeed", "Admin"));
        }
 public ActionResult Edit([Bind(Include = "Seed_id,SeedName,Season,Yield,Description,Price")] AddSeed addSeed)
 {
     if (ModelState.IsValid)
     {
         db.Entry(addSeed).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(addSeed));
 }
        public ActionResult Create([Bind(Include = "Seed_id,SeedName,Season,Yield,Description,Price")] AddSeed addSeed)
        {
            if (ModelState.IsValid)
            {
                db.AddSeeds.Add(addSeed);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(addSeed));
        }
        // GET: AdminSeed/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            AddSeed addSeed = db.AddSeeds.Find(id);

            if (addSeed == null)
            {
                return(HttpNotFound());
            }
            return(View(addSeed));
        }
        private void ExecuteBuild()
        {
            _buildRunning.Value++;

            string hostName     = HostName.Value;
            string seedHostName = SeedHostName.Value;

            UICall(TerminalLines.Clear);

            var builder = new SetupBuilder(hostName, AddSeed.Value ? seedHostName : null, _config, s => UICall(() => TerminalLines.Add(s)), Context.System, _deploymentApi, _repositoryApi, ActionInvoker);
            var id      = Guid.NewGuid().ToString().Substring(0, 5);

            _server.AddPendingInstallations(id, builder, AddShortcut);

            AddShortcut.Set(false);
            AddSeed.Set(false);
            HostName.Set(string.Empty);
            SeedHostName.Set(string.Empty);

            _buildRunning.Value--;
        }
        public ActionResult AddSeed()
        {
            AddSeed seedModel = new AddSeed();

            return(View(seedModel));
        }