Exemple #1
0
        public ActionResult Create(Kasir kasir)
        {
            if (ModelState.IsValid)
            {
                db.Kasir.Add(kasir);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(kasir));
        }
Exemple #2
0
        public ActionResult Create(Barang barang)
        {
            if (ModelState.IsValid)
            {
                db.Barang.Add(barang);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.IDKasir = new SelectList(db.Kasir, "IDKasir", "NamaKasir", barang.IDKasir);
            return(View(barang));
        }