예제 #1
0
        public ActionResult indel(int id)
        {
            tbl_in tbin = db.tbl_in.SingleOrDefault(p => p.id == id);

            db.tbl_in.Remove(tbin);
            db.SaveChanges();
            Response.Redirect("inrecord");
            return(View());
        }
예제 #2
0
 public ActionResult productin(tbl_in tblin)
 {
     try
     {
         tblin.itemid = Convert.ToInt32(TempData["itemid"].ToString());
         db.tbl_in.Add(tblin);
         db.SaveChanges();
         tbl_products tblprod = db.tbl_products.SingleOrDefault(p => p.productid == tblin.itemid);
         tblprod.quantity += tblin.quantity;
         db.SaveChanges();
         ViewBag.msg = "Operation Successfull";
     }
     catch (Exception e)
     {
         ViewBag.msg = "something went wrong" + e;
     }
     return(View());
 }