コード例 #1
0
        public async Task <ActionResult> Create([Bind(Include = "Masach,Tensach,MaLoaiSach,Mota,Hinhminhhoa,MaCD,MaNXB,Ngaycapnhat")] SACH sACH)
        {
            if (ModelState.IsValid)
            {
                db.SACHes.Add(sACH);
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            ViewBag.MaCD = new SelectList(db.CHUDEs, "MaCD", "TenCD", sACH.MaCD);

            return(View(sACH));
        }