} // afterSave public static MRevenueRecognitionPlan[] GetRecognitionPlans(MRevenueRecognition revenueRecognition, int invoiceLine_ID) { List <MRevenueRecognitionPlan> list = new List <MRevenueRecognitionPlan>(); string sql = "Select * from C_RevenueRecognition_Plan pl"; if (invoiceLine_ID > 0) { sql += " inner join c_invoiceline invl on invl.c_invoiceline_id = pl.c_invoiceline_id Where pl.C_RevenueRecognition_ID=" + revenueRecognition.GetC_RevenueRecognition_ID() + "" + " and invl.c_invoiceLine_id=" + invoiceLine_ID; } else { sql += " Where pl.C_RevenueRecognition_ID=" + revenueRecognition.GetC_RevenueRecognition_ID(); } DataTable dt = null; IDataReader idr = null; try { idr = DB.ExecuteReader(sql, null, revenueRecognition.Get_Trx()); dt = new DataTable(); dt.Load(idr); idr.Close(); foreach (DataRow dr in dt.Rows) { list.Add(new MRevenueRecognitionPlan(revenueRecognition.GetCtx(), dr, revenueRecognition.Get_Trx())); } } catch (Exception e) { if (idr != null) { idr.Close(); } _log.Log(Level.SEVERE, sql, e); } finally { dt = null; } MRevenueRecognitionPlan[] retValue = new MRevenueRecognitionPlan[list.Count]; retValue = list.ToArray(); return(retValue); }
private static MINT15RevenueService[] GetServices(MRevenueRecognition MRevenueRecognition) { List <MINT15RevenueService> list = new List <MINT15RevenueService>(); String sql = "SELECT * FROM INT15_RevenueService WHERE C_RevenueRecognition_ID=" + MRevenueRecognition.GetC_RevenueRecognition_ID(); DataSet ds = new DataSet(); try { ds = DB.ExecuteDataset(sql, null, MRevenueRecognition.Get_TrxName()); foreach (DataRow dr in ds.Tables[0].Rows) { MINT15RevenueService il = new MINT15RevenueService(MRevenueRecognition.GetCtx(), dr, MRevenueRecognition.Get_TrxName()); list.Add(il); } ds = null; } catch (Exception e) { // log.Log(Level.SEVERE, "getServices", e); } MINT15RevenueService[] lines = new MINT15RevenueService[list.Count]; lines = list.ToArray(); return(lines); }