Exemplo n.º 1
0
    public void DeleteGroup(string groupid)
    {
        DbTask    db  = new DbTask();
        string    Sql = "SELECT id FROM " + TableName + " WHERE groupid LIKE '" + groupid + "%'";
        DataTable dt  = db.GetData(Sql);

        if (dt != null && dt.Rows.Count > 0)
        {
            string id = string.Empty;
            foreach (DataRow dr in dt.Rows)
            {
                id = dr["id"].ToString();
                //Xoa log
                Logfile logfile = new Logfile();
                logfile.DeleteLog(id);
                //Xoa file
                Delete(id);
            }
        }
    }
Exemplo n.º 2
0
    protected void BtDelete_Click(object sender, EventArgs e)
    {
        News   news = new News();
        string id   = string.Empty;

        foreach (RepeaterItem items in rptNews.Items)
        {
            CheckBox checkboxID = (CheckBox)items.FindControl("checkboxID");
            if (checkboxID.Checked)
            {
                Literal ltlIDNews = (Literal)items.FindControl("ltlIDNews");
                id = ltlIDNews.Text.Trim();
                //Xoa
                news.Delete(id);
                //Xoa log
                Logfile log = new Logfile();
                log.DeleteLog(id);
            }
        }
        Response.Redirect(Globals.UrlRoot + "temp.aspx?url=" + Request.Url);
    }