Beispiel #1
0
        public ActionResult AddCategory(Category category)
        {
            dao = new CategoryDao();
            bool check = dao.AddCategory(category);

            if (check)
            {
                return(RedirectToAction("CategoryManager", "HomeAd"));
            }
            else
            {
                return(JavaScript("<script>alert('Thêm không thành công')</script>"));
            }
        }
Beispiel #2
0
 private void btnAdd_Click(object sender, EventArgs e)
 {
     if (txtName.Text == "")
     {
         MessageBox.Show("Please enter category name");
     }
     else
     {
         CategoryDao cd = new CategoryDao();
         if (cd.AddCategory(txtName.Text))
         {
             MessageBox.Show("Add successful");
         }
         load();
     }
 }