예제 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            tableQLCT tableQLCT = db.tableQLCTs.Find(id);

            db.tableQLCTs.Remove(tableQLCT);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
예제 #2
0
 public ActionResult Edit([Bind(Include = "id,name,date1,money1,ghichu")] tableQLCT tableQLCT)
 {
     if (ModelState.IsValid)
     {
         db.Entry(tableQLCT).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(tableQLCT));
 }
예제 #3
0
        // GET: tableQLCTs/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            tableQLCT tableQLCT = db.tableQLCTs.Find(id);

            if (tableQLCT == null)
            {
                return(HttpNotFound());
            }
            return(View(tableQLCT));
        }
예제 #4
0
        public ActionResult Create([Bind(Include = "id,name,date1,money1,ghichu")] tableQLCT tableQLCT)
        {
            if (tableQLCT.money1 < 0)
            {
                return(View("Create"));
            }
            if (ModelState.IsValid)
            {
                tableQLCT.date1 = DateTime.Today;
                db.tableQLCTs.Add(tableQLCT);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(tableQLCT));
        }