コード例 #1
0
        public ActionResult EditLoaiSP([Bind(Include = "MaLoai,TenLoai")] LoaiSP loai)
        {
            CategoryModel spm = new CategoryModel();

            if (ModelState.IsValid)
            {
                spm.EditLoaiSP(loai);
                return(RedirectToAction("Index"));
            }
            return(View(loai));
        }
コード例 #2
0
        public ActionResult EditLoaiSP([Bind(Include = "MaLoai,TenLoai")] LoaiSP loai)
        {
            CategoryModel spm = new CategoryModel();

            if (ModelState.IsValid && spm.KiemTraTen(loai.TenLoai))
            {
                TempData["EditSuccess"] = "Oke";
                spm.EditLoaiSP(loai);
                return(RedirectToAction("Index"));
            }
            TempData["ErrorEdit"] = "Lỗi";
            return(View(loai));
        }