/// <summary> /// Delect recordes from allocation /// </summary> /// <param name="hdr"></param> /// <returns>Bool type</returns> private Boolean Delete(MAllocationHdr hdr) { // _m_trx.start(); Boolean success = false; String msg = null; // Std Period open? msg = DocumentEngine.IsPeriodOpen(hdr); if (msg != null) { msg = "@DeleteError@" + hdr.GetDocumentNo() + ": " + msg; log.Warning(msg); return(false); } if (hdr.Delete(true, _m_trx)) { log.Fine(hdr.ToString()); success = true; } if (success) { _m_trx.Commit(); } else { _m_trx.Rollback(); } return(success); }
///Manfacturing /// <summary> /// Process document. This replaces DocAction.processIt(). /// </summary> /// <param name="doc">Doc Action</param> /// <param name="processAction">processAction</param> /// <returns>true if performed</returns> /// <date>07-march-2011</date> /// <writer>raghu</writer> public static Boolean ProcessIt(DocAction doc, String processAction) { DateTime time = DateTime.Now.Date; Boolean success = false; VAdvantage.Utility.Ctx ctx = doc.GetCtx(); Boolean oldIsBatchMode = ctx.IsBatchMode(); ctx.SetBatchMode(true); DocumentEngine engine = new DocumentEngine(doc, doc.GetDocStatus()); success = engine.ProcessIt(processAction, doc.GetDocAction()); ctx.SetBatchMode(oldIsBatchMode); return(success); }