Example #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);
        }
Example #2
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);
        }