Exemplo n.º 1
0
        public override DataSet ToDataSet()
        {
            //Return a dataset containing values for this workstation
            WorkstationDS ds = null;

            try {
                ds = new WorkstationDS();
                WorkstationDS.WorkstationDetailTableRow workstation = ds.WorkstationDetailTable.NewWorkstationDetailTableRow();
                workstation.WorkStationID = base.mWorkStationID;
                workstation.Name          = base.mName;
                workstation.TerminalID    = base.mTerminalID;
                workstation.Number        = base.mNumber;
                workstation.Description   = base.mDescription;
                if (this.mScale != null)
                {
                    workstation.ScaleType = this.mScale.Type;
                    workstation.ScalePort = this.mScale.Settings.PortName;
                }
                if (this.mLabelPrinter != null)
                {
                    workstation.PrinterType = this.mLabelPrinter.Type;
                    workstation.PrinterPort = this.mLabelPrinter.Settings.PortName;
                }
                workstation.Trace    = base.mTrace;
                workstation.IsActive = base.mIsActive;
                ds.WorkstationDetailTable.AddWorkstationDetailTableRow(workstation);
                ds.AcceptChanges();
            }
            catch (Exception) { }
            return(ds);
        }
Exemplo n.º 2
0
        public static Workstation CreateWorkstation(string machineName)
        {
            //Create a workstation that has an ILabelPrinter printer and IScale scale
            Workstation station = null;

            try {
                if (machineName.Length > 0)
                {
                    DataSet ds = Mediator.FillDataset(USP_STATION_CONFIG, TBL_STATION_CONFIG, new object[] { machineName });
                    if (ds.Tables[TBL_STATION_CONFIG].Rows.Count == 0)
                    {
                        throw new ApplicationException("Station for  " + machineName + " not found.");
                    }
                    else
                    {
                        WorkstationDS stationDS = new WorkstationDS();
                        stationDS.Merge(ds);
                        station = new Workstation(stationDS.WorkstationDetailTable[0]);
                    }
                }
                else
                {
                    station = new Workstation(null);
                }
            }
            catch (ApplicationException ex) { throw ex; }
            catch (Exception ex) { throw new ApplicationException("Unexpected error while creating workstation.", ex); }
            return(station);
        }
Exemplo n.º 3
0
        public override DataSet Clone()
        {
            WorkstationDS cln = ((WorkstationDS)(base.Clone()));

            cln.InitVars();
            return(cln);
        }
Exemplo n.º 4
0
        public DataSet ToDataSet()
        {
            //Return a dataset containing values for this workstation
            WorkstationDS ds = null;

            try {
                ds = new WorkstationDS();
                WorkstationDS.WorkstationDetailTableRow workstation = ds.WorkstationDetailTable.NewWorkstationDetailTableRow();
                workstation.WorkStationID = this.mWorkStationID;
                if (this.mName.Length > 0)
                {
                    workstation.Name = this.mName;
                }
                workstation.TerminalID = this.mTerminalID;
                workstation.Number     = this.mNumber;
                if (this.mDescription.Length > 0)
                {
                    workstation.Description = this.mDescription;
                }
                if (this.mScaleType.Length > 0)
                {
                    workstation.ScaleType = this.mScaleType;
                }
                if (this.mScalePort.Length > 0)
                {
                    workstation.ScalePort = this.mScalePort;
                }
                if (this.mPrinterType.Length > 0)
                {
                    workstation.PrinterType = this.mPrinterType;
                }
                if (this.mPrinterPort.Length > 0)
                {
                    workstation.PrinterPort = this.mPrinterPort;
                }
                workstation.Trace    = this.mTrace;
                workstation.IsActive = this.mIsActive;
                ds.WorkstationDetailTable.AddWorkstationDetailTableRow(workstation);
                ds.AcceptChanges();
            }
            catch (Exception) { }
            return(ds);
        }