示例#1
0
        public ActionResult ProductTypeDeleting(int typeID)
        {
            try
            {
                ProductTypeModel ptModel = new ProductTypeModel();
                ptModel.PRO_TYP_ID = typeID;

                Database       db    = new Database();
                ProductTypeDAO ptDAO = new ProductTypeDAO(db);
                ptDAO.Delete(ptModel);
                db.Close();

                return(Redirect("~/Product/ProductTypeManagement"));
            }
            catch
            {
                return(RedirectToAction("alert", "Product", new { link = "ProductTypeManagement", massage = "มีรายการที่อ้างถึงข้อมูลนี้อยู่ ไม่สามารถลบได้" }));
            }
        }