Exemplo n.º 1
0
        /// <summary>
        /// Get Paper
        /// </summary>
        /// <param name="ctx">context</param>
        /// <param name="AD_PrintPaper_ID"AD_PrintPaper_ID></param>
        /// <returns>Paper</returns>
        static public MPrintPaper Get(int AD_PrintPaper_ID)
        {
            int         key = AD_PrintPaper_ID;
            MPrintPaper pp  = null;

            if (s_papers.ContainsKey(key))
            {
                pp = s_papers[key];
            }
            if (pp == null)
            {
                pp = new MPrintPaper(Env.GetContext(), AD_PrintPaper_ID, null);
                if (s_papers.ContainsKey(key))
                {
                    s_papers[key] = pp;
                }
                else
                {
                    s_papers.Add(key, pp);
                }
            }
            else
            {
                s_log.Config("AD_PrintPaper_ID=" + AD_PrintPaper_ID);
            }
            return(pp);
        }       //	get
Exemplo n.º 2
0
        /// <summary>
        /// Create Paper and save
        /// </summary>
        /// <param name="name">name</param>
        /// <param name="landscape">landscape</param>
        /// <returns>Paper</returns>
        static MPrintPaper Create(String name, bool landscape)
        {
            MPrintPaper pp = new MPrintPaper(Env.GetContext(), 0, null);

            pp.SetName(name);
            pp.SetIsLandscape(landscape);
            pp.Save();
            return(pp);
        }       //	create