示例#1
0
        public static int Add(Procude pr)
        {
            DbContext db = new DbContext();

            db.ProductBase.Add(pr);
            return(db.SaveChanges());
        }
示例#2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Procude procude = db.ProductBase.Find(id);

            db.ProductBase.Remove(procude);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#3
0
 public ActionResult AddSave(Procude p)
 {
     if (ModelState.IsValid)
     {
         ProcudeDAL.Add(p);
     }
     return(RedirectToAction("Index"));
 }
示例#4
0
 public ActionResult Edit([Bind(Include = "Id,Name,Sex,Age")] Procude procude)
 {
     if (ModelState.IsValid)
     {
         db.Entry(procude).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(procude));
 }
示例#5
0
        public ActionResult Create([Bind(Include = "Id,Name,Sex,Age")] Procude procude)
        {
            if (ModelState.IsValid)
            {
                db.ProductBase.Add(procude);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(procude));
        }
示例#6
0
        // GET: Procudes/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Procude procude = db.ProductBase.Find(id);

            if (procude == null)
            {
                return(HttpNotFound());
            }
            return(View(procude));
        }
示例#7
0
 public int Add(Procude pr)
 {
     db.ProductBase.
 }