Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SeedSelling seedSelling = db.SeedSellings.Find(id);

            db.SeedSellings.Remove(seedSelling);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "ID,CustomerID,CropVarietyID,NoofBags,Amount")] SeedSelling seedSelling)
 {
     if (ModelState.IsValid)
     {
         db.Entry(seedSelling).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.CropVarietyID = new SelectList(db.CropVarieties, "ID", "VarietyName", seedSelling.CropVarietyID);
     ViewBag.CustomerID    = new SelectList(db.Customers, "ID", "CustomerName", seedSelling.CustomerID);
     return(View(seedSelling));
 }
Exemplo n.º 3
0
        // GET: SeedSellings/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SeedSelling seedSelling = db.SeedSellings.Find(id);

            if (seedSelling == null)
            {
                return(HttpNotFound());
            }
            return(View(seedSelling));
        }
Exemplo n.º 4
0
        // GET: SeedSellings/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SeedSelling seedSelling = db.SeedSellings.Find(id);

            if (seedSelling == null)
            {
                return(HttpNotFound());
            }
            ViewBag.CropVarietyID = new SelectList(db.CropVarieties, "ID", "VarietyName", seedSelling.CropVarietyID);
            ViewBag.CustomerID    = new SelectList(db.Customers, "ID", "CustomerName", seedSelling.CustomerID);
            return(View(seedSelling));
        }