コード例 #1
0
        }       //	get

        /// <summary>
        /// Get Default Table Format.
        /// </summary>
        /// <param name="ctx">context</param>
        /// <returns>Default Table Format (need to set standard font)</returns>
        static public MPrintTableFormat GetDefault(Ctx ctx)
        {
            int AD_Client_ID = ctx.GetAD_Client_ID();

            MPrintTableFormat tf  = null;
            String            sql = "SELECT * FROM AD_PrintTableFormat "
                                    + "WHERE AD_Client_ID IN (0," + AD_Client_ID + ") AND IsActive='Y' "
                                    + "ORDER BY IsDefault DESC, AD_Client_ID DESC";

            try
            {
                DataSet ds = SqlExec.ExecuteQuery.ExecuteDataset(sql);
                foreach (DataRow dr in ds.Tables[0].Rows)
                {
                    tf = new MPrintTableFormat(ctx, dr, null);
                    break;  //in case there are multiple records, just select the first one
                }
            }
            catch
            {
                //log, if any
            }

            return(tf);
        }       //	GetDefault
コード例 #2
0
        }       //	createFromTable

        //private MPrintTableFormat _tFormat;

        ///// <summary>
        ///// Get Table Format
        ///// </summary>
        ///// <returns>Table Format</returns>
        public MPrintTableFormat GetTableFormat()
        {
            if (_tFormat == null)
            {
                _tFormat = MPrintTableFormat.Get(GetCtx(), GetAD_PrintTableFormat_ID(), GetAD_PrintFont_ID());
            }
            return(_tFormat);
        }       //	getTableFormat
コード例 #3
0
 public ParameterElement(Query query, Ctx ctx, MPrintTableFormat tFormat)
     : base(query.GetRestrictionCount(), 4)
 {
     SetData(0, 0, Msg.GetMsg(ctx, "Parameter") + ":", tFormat.GetPageHeader_Font(), tFormat.GetPageHeaderFG_Color());
     // html = "<div><span ></span>";
     for (int r = 0; r < query.GetRestrictionCount(); r++)
     {
         SetData(r, 1, query.GetInfoName(r), tFormat.GetParameter_Font(), tFormat.GetParameter_Color());
         SetData(r, 2, query.GetInfoOperator(r), tFormat.GetParameter_Font(), tFormat.GetParameter_Color());
         SetData(r, 3, query.GetInfoDisplayAll(r), tFormat.GetParameter_Font(), tFormat.GetParameter_Color());
     }
 }       //	ParameterElement
コード例 #4
0
        }       //	ParameterElement

        public ParameterElement(Query query, Ctx ctx, MPrintTableFormat tFormat, out string html)
            : base(query.GetRestrictionCount(), 4)
        {
            SetData(0, 0, Msg.GetMsg(ctx, "Parameter") + ":", tFormat.GetPageHeader_Font(), tFormat.GetPageHeaderFG_Color());
            StringBuilder sb = new StringBuilder("<div class='vis-report-content-head'><div>" + Msg.GetMsg(ctx, "Parameter") + ":" + " </div><div>");

            sb.Append("<table style='white-space: nowrap;'>");
            for (int r = 0; r < query.GetRestrictionCount(); r++)
            {
                sb.Append("<tr><td>" + query.GetInfoName(r) + "</td>");
                sb.Append("<td>" + query.GetInfoOperator(r) + "</td>");
                sb.Append("<td>" + query.GetInfoDisplayAll(r) + "</td></tr>");

                SetData(r, 1, query.GetInfoName(r), tFormat.GetParameter_Font(), tFormat.GetParameter_Color());
                SetData(r, 2, query.GetInfoOperator(r), tFormat.GetParameter_Font(), tFormat.GetParameter_Color());
                SetData(r, 3, query.GetInfoDisplayAll(r), tFormat.GetParameter_Font(), tFormat.GetParameter_Color());
            }
            sb.Append("</table></div></div>");
            html = sb.ToString();
            sb   = null;
        }
コード例 #5
0
        static public MPrintTableFormat Get(Ctx ctx, int AD_PrintTableFormat_ID, Font standard_font)
        {
            int ii = AD_PrintTableFormat_ID;
            //MPrintTableFormat tf = (MPrintTableFormat)_cache[ii];
            MPrintTableFormat tf = null;

            if (tf == null)
            {
                if (AD_PrintTableFormat_ID == 0)
                {
                    tf = GetDefault(ctx);
                }
                else
                {
                    tf = new MPrintTableFormat(ctx, AD_PrintTableFormat_ID, null);
                }
                _cache.Add(ii, tf);
            }
            tf.SetStandard_Font(standard_font);
            return(tf);
        }       //	get
コード例 #6
0
        }       //	setTranslationViewQuery

        /// <summary>
        /// Get Optional TableFormat
        /// </summary>
        /// <param name="AD_PrintTableFormat_ID">table format</param>
        new public void SetAD_PrintTableFormat_ID(int AD_PrintTableFormat_ID)
        {
            base.SetAD_PrintTableFormat_ID(AD_PrintTableFormat_ID);
            _tFormat = MPrintTableFormat.Get(GetCtx(), AD_PrintTableFormat_ID, GetAD_PrintFont_ID());
        }       //	getAD_PrintTableFormat_ID