Exemplo n.º 1
0
        public IPaperFormat AddFormat(string name, int width, int height)
        {
            CheckRights();
            IPaperFormat paperFormat = TryFindPaperFormat(name);
            if (paperFormat != null)
            {
                AppliactionContext.Log.Error(this, String.Format(Resources.PaperFormatAlreadyExist, paperFormat.Name));
                throw new TvException(String.Format(Resources.PaperFormatAlreadyExist, paperFormat.Name));
            }

            PaperFormat newPaperFormat = new PaperFormat();
            newPaperFormat.Name = name;
            newPaperFormat.Size = new Size(width, height);

            newPaperFormat.Save();
            _paperFormats.Add(newPaperFormat);

            return newPaperFormat;
        }
Exemplo n.º 2
0
        public IPaperFormat AddFormat(string name, int width, int height)
        {
            CheckRights();
            IPaperFormat paperFormat = TryFindPaperFormat(name);

            if (paperFormat != null)
            {
                AppliactionContext.Log.Error(this, String.Format(Resources.PaperFormatAlreadyExist, paperFormat.Name));
                throw new TvException(String.Format(Resources.PaperFormatAlreadyExist, paperFormat.Name));
            }

            PaperFormat newPaperFormat = new PaperFormat();

            newPaperFormat.Name = name;
            newPaperFormat.Size = new Size(width, height);

            newPaperFormat.Save();
            _paperFormats.Add(newPaperFormat);

            return(newPaperFormat);
        }