private void Delete() { try { if (UIHelper.ConfirmDelete()) { docDB.DocumentRow dr = AtMng.GetTemplate().GetTemplateDoc(CurrentRow()); CurrentRow().Delete(); if (dr != null) { dr.Delete(); } this.templateBindingSource.EndEdit(); atLogic.BusinessProcess bp = AtMng.GetBP(); bp.AddForUpdate(AtMng.GetTemplate()); bp.AddForUpdate(myDM.GetDocContent()); bp.AddForUpdate(myDM.GetDocument()); bp.Update(); } } catch (Exception x) { throw new Exception("Transaction Rolled Back", x); } }
//public override DataRow[] GetParentRow() //{ // return myA.GetDocument().GetCurrentRow(); //} public void Delete(docDB.AttachmentRow attchrow) { docDB.DocumentRow docrow = attchrow.DocumentRowByDocument_Attachment1; //delete doc if just added if (docrow.RowState == DataRowState.Added) { if (docrow.DocContentRow != null) { docrow.DocContentRow.Delete(); } docrow.Delete(); } else { myA.GetDocument().Delete(docrow.DocId, null, attchrow); } //delete attachment attchrow.Delete(); }