Ejemplo n.º 1
0
        public LabelTemplate Item(string labelType, string printerType)
        {
            //Return an existing template object from the label templates collection
            LabelTemplate label = null;

            try {
                //Merge from collection (dataset)
                if (labelType != "" && printerType != "")
                {
                    DataRow[] rows = this.mLabels.LabelDetailTable.Select("LABEL_TYPE='" + labelType + "' AND PrinterType='" + printerType + "'");
                    if (rows.Length == 0)
                    {
                        throw new Exception("Label template for label type " + labelType + ", printer type " + printerType + " does not exist in this store!\n");
                    }
                    LabelDataset.LabelDetailTableRow row = (LabelDataset.LabelDetailTableRow)rows[0];
                    label = NewLabelTemplate(row);                      //, this.mMediator);
                    label.TemplateChanged += new EventHandler(OnTemplateChanged);
                }
                else
                {
                    label = Item();
                }
            }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while getting existing label.", ex); }
            return(label);
        }
Ejemplo n.º 2
0
 public TerminalLabelTemplate(LabelDataset.LabelDetailTableRow labelTemplate, Mediator mediator)
     : base(labelTemplate)
 {
     //Constructor
     try {
         this.mMediator = mediator;
     }
     catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new Terminal Label Template instance.", ex); }
 }
Ejemplo n.º 3
0
 /// <summary>Constructor: creates a label template initialized from parameter labelTemplate.</summary>
 public LabelTemplate(LabelDataset.LabelDetailTableRow labelTemplate)
 {
     //Constructor
     try {
         if (labelTemplate != null)
         {
             this.mLabelType   = labelTemplate.LABEL_TYPE;
             this.mPrinterType = !labelTemplate.IsPrinterTypeNull() ? labelTemplate.PrinterType : "";
             this.mLabelString = !labelTemplate.IsLABEL_STRINGNull() ? labelTemplate.LABEL_STRING : "";
         }
     }
     catch (Exception ex) { throw new ApplicationException("Unexpected error while creating new Label Template instance.", ex); }
 }
Ejemplo n.º 4
0
        /// <summary>Returns the label template as an xml object.</summary>
        public DataSet ToDataSet()
        {
            //Return a dataset containing values for this object
            LabelDataset ds = null;

            try {
                ds = new LabelDataset();
                LabelDataset.LabelDetailTableRow labelTemplate = ds.LabelDetailTable.NewLabelDetailTableRow();
                labelTemplate.LABEL_TYPE   = this.mLabelType;
                labelTemplate.PrinterType  = this.mPrinterType;
                labelTemplate.LABEL_STRING = this.mLabelString;
                ds.LabelDetailTable.AddLabelDetailTableRow(labelTemplate);
            }
            catch (Exception) { }
            return(ds);
        }
Ejemplo n.º 5
0
 public override LabelTemplate NewLabelTemplate(LabelDataset.LabelDetailTableRow row)
 {
     return(new FileLabelTemplate(row));
 }
Ejemplo n.º 6
0
 public override LabelTemplate NewLabelTemplate(LabelDataset.LabelDetailTableRow row)
 {
     return(new TerminalLabelTemplate(row, this.mMediator));
 }
Ejemplo n.º 7
0
 //Members
 //Constants
 //Events
 //Interface
 public DirectoryLabelTemplate(LabelDataset.LabelDetailTableRow labelTemplate) : base(labelTemplate)
 {
 }
Ejemplo n.º 8
0
 //Members
 //Constants
 //Events
 //Interface
 public FileLabelTemplate(LabelDataset.LabelDetailTableRow labelTemplate) : base(labelTemplate)
 {
 }
Ejemplo n.º 9
0
 public abstract LabelTemplate NewLabelTemplate(LabelDataset.LabelDetailTableRow row);