using GMW_data;
using SteamWare;
using System;
using System.Drawing.Printing;

namespace GMW.WebUserControls
{
    public partial class mod_PostFusioni : GMW_data.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Postazione.messaggiText = "";
            Postazione.warningText = "";
        }
        public string testoLabel
        {
            get
            {
                return string.Format(memLayer.ML.confReadString("bcodeLabFormat"), DateTime.Now);
            }
        }
        public string bCodeLabel
        {
            get
            {
                return string.Format(memLayer.ML.confReadString("bcodeValFormat"), DateTime.Now);
            }
        }
        /// <summary>
        /// lancio stampa etichetta
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnStampaEtichetta_Click(object sender, EventArgs e)
        {
            // attenzione: page size deve essere uguale su printer e su richiesta!!! 62 x 29 mm = 2.44 x 1.14 pollici
            PaperSize pS = new PaperSize("label", memLayer.ML.confReadInt("bcodeLabelWidth"), memLayer.ML.confReadInt("bcodeLabelHeight"));
            // stampo il vero bcode su etichettatrice!!!
            bCodePrinter.man.Print(Postazione.printer, pS, testoLabel, bCodeLabel, memLayer.ML.confReadInt("bcodeFontBase"));
        }

    }
}