Esempio n. 1
0
 public void deltype()
 {
     if (this.ViewState["FilesType"].ToString() != "1")
     {
         upfileui.WNdelfile("~" + this.ViewState["Files"].ToString());
     }
 }
    /// <summary>
    /// 真实删除
    /// </summary>
    public void deletes(string strID)
    {
        HXD.Common.FilesManage files = new HXD.Common.FilesManage();
        DataSet ds = HXD.DBUtility.SQLHelper.ExecuteDataset("select id,Files,FileType from tb_U_Advertisement where id in(" + strID + ")");

        if (ds.Tables[0].Rows.Count == 1)
        {
            for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
            {
                if (ds.Tables[0].Rows[0]["FileType"].ToString() != "1")
                {
                    files.WNdelfile("~" + ds.Tables[0].Rows[0]["Files"].ToString());               //删除文件
                }
                files.WNdelfile(Web.Model.PublicModel.ADJsFile + ds.Tables[0].Rows[i][0] + ".js"); //删除脚本
            }
        }
        ds.Tables[0].Dispose();
        ds.Tables[0].Clear();
        HXD.DBUtility.SQLHelper.ExecuteNonQuery("delete from tb_U_Advertisement where id in(" + strID + ")");
    }