protected void LinkButton1_Click(object sender, EventArgs e) { tblPdfAssets pdfs = new tblPdfAssets(); pdfs.LoadByPrimaryKey(_pdfid); pdfs.MarkAsDeleted(); pdfs.Save(); Response.Redirect(Request.RawUrl); }
protected void LinkButton1_Click(object sender, EventArgs e) { #region remove value stores tblItemFieldsXValue vals = new tblItemFieldsXValue(); vals.Where.ItemId.Value = _itemId; vals.Query.Load(); if (vals.RowCount > 0) { vals.Rewind(); do { if (vals.s_ItemFieldStringId != "") { tblItemFieldStringValues val = new tblItemFieldStringValues(); val.LoadByPrimaryKey(vals.ItemFieldStringId); val.MarkAsDeleted(); val.Save(); } if (vals.s_ItemFieldTextId != "") { tblItemFieldTextValues val = new tblItemFieldTextValues(); val.LoadByPrimaryKey(vals.ItemFieldTextId); val.MarkAsDeleted(); val.Save(); } if (vals.s_ItemFieldStringId != "") { tblItemFieldStringValues val = new tblItemFieldStringValues(); val.LoadByPrimaryKey(vals.ItemFieldStringId); val.MarkAsDeleted(); val.Save(); } if (vals.s_ItemFieldPdfAssetId != "") { tblPdfAssets val = new tblPdfAssets(); val.LoadByPrimaryKey(vals.ItemFieldPdfAssetId); val.MarkAsDeleted(); val.Save(); } } while (vals.MoveNext()); } #endregion tblItems item = new tblItems(); item.LoadByPrimaryKey(_itemId); item.MarkAsDeleted(); item.Save(); Response.Redirect(Request.RawUrl); }