コード例 #1
0
 protected void btnDelete_Click(object sender, EventArgs e)
 {
     try
     {
         int             CateID = Globals.GetIntFromQueryString("CateID");
         ArticleCategory obj    = new ArticleCategory();
         Article         objA   = new Article();
         int             kq     = -1;
         DataSet         ds     = objA.GetArticleByCateID("Article", CateID, ddlLanguage.SelectedValue, t);
         for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
         {
             Globals.DeleteFile(Convert.ToString(ds.Tables[0].Rows[i]["ImageURL"]), "ImageFiles/Articles");
             objA.DeleteArticle(Convert.ToInt32(Convert.ToString(ds.Tables[0].Rows[i]["ArticleID"])), Globals.AgentCatID, t);
         }
         kq = obj.DeleteCategory(CateID);
         ddlLanguage2.SelectedValue = ddlLanguage.SelectedValue;
         LoadTreeViewCategory(TreeViewCategory, ddlLanguage2.SelectedValue);
         ShowMessage(kq, "xóa");
     }
     catch { }
 }