Franken_.App_Code.GlyphImage.Delete C# (CSharp) Method

Delete() public method

public Delete ( bool DeleteFile ) : void
DeleteFile bool
return void
        public void Delete(bool DeleteFile)
        {
            if (this.ID != "")
            {
                db.ExecuteCommand("delete from images where img_id = " + this.ID);

                if (DeleteFile)
                {
                    try
                    {
                        if (System.IO.File.Exists(db.DataDirectory + this.Path))
                        {
                            System.IO.File.Delete(db.DataDirectory + this.Path);
                        }
                    }

                    catch (Exception E) { }
                }
            }
        }