예제 #1
0
        }       //	getItem

        /// <summary>
        /// Get active Items
        /// </summary>
        /// <returns>items</returns>
        private MPrintFormatItem[] GetItems()
        {
            List <MPrintFormatItem> list = new List <MPrintFormatItem>();
            String sql = "SELECT * FROM AD_PrintFormatItem pfi "
                         + "WHERE pfi.AD_PrintFormat_ID=@AD_PrintFormat_ID AND pfi.IsActive='Y'"
                         //	Display restrictions - Passwords, etc.
                         + " AND NOT EXISTS (SELECT * FROM AD_Field f "
                         + "WHERE pfi.AD_Column_ID=f.AD_Column_ID"
                         + " AND (f.IsEncrypted='Y' OR f.ObscureType IS NOT NULL))"
                         + "ORDER BY SeqNo";
            MRole role = MRole.GetDefault(GetCtx(), false);

            try
            {
                SqlParameter[] param = new SqlParameter[1];
                param[0] = new SqlParameter("@AD_PrintFormat_ID", Get_ID());
                DataSet ds = SqlExec.ExecuteQuery.ExecuteDataset(sql, param);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    MPrintFormatItem pfi = new MPrintFormatItem(Env.GetContext(), dr, Get_TrxName());
                    if (role.IsColumnAccess(GetAD_Table_ID(), pfi.GetAD_Column_ID(), true))
                    {
                        list.Add(pfi);
                    }
                }
            }
            catch (Exception e)
            {
                log.Severe(e.ToString());
                //log entry, if any
            }
            //
            MPrintFormatItem[] retValue = new MPrintFormatItem[list.Count];
            retValue = list.ToArray();
            return(retValue);
        }       //	getItems