Пример #1
0
 public Workstation(WorkstationDS.WorkstationDetailTableRow workstation)
 {
     //Constructor
     try {
         //Configure this station from the station configuration information
         if (workstation != null)
         {
             if (!workstation.IsWorkStationIDNull())
             {
                 this.mWorkStationID = workstation.WorkStationID;
             }
             if (!workstation.IsNameNull())
             {
                 this.mName = workstation.Name;
             }
             if (!workstation.IsTerminalIDNull())
             {
                 this.mTerminalID = workstation.TerminalID;
             }
             if (!workstation.IsNumberNull())
             {
                 this.mNumber = workstation.Number;
             }
             if (!workstation.IsDescriptionNull())
             {
                 this.mDescription = workstation.Description;
             }
             if (!workstation.IsScaleTypeNull())
             {
                 this.mScaleType = workstation.ScaleType;
             }
             if (!workstation.IsScalePortNull())
             {
                 this.mScalePort = workstation.ScalePort;
             }
             if (!workstation.IsPrinterTypeNull())
             {
                 this.mPrinterType = workstation.PrinterType;
             }
             if (!workstation.IsPrinterPortNull())
             {
                 this.mPrinterPort = workstation.PrinterPort;
             }
             if (!workstation.IsTraceNull())
             {
                 this.mTrace = workstation.Trace;
             }
             if (!workstation.IsIsActiveNull())
             {
                 this.mIsActive = workstation.IsActive;
             }
         }
     }
     catch (Exception ex) { throw new ApplicationException("Could not create a new workstation.", ex); }
 }
Пример #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();
                if (this.mWorkStationID != "")
                {
                    workstation.WorkStationID = this.mWorkStationID;
                }
                if (this.mName != "")
                {
                    workstation.Name = this.mName;
                }
                if (this.mTerminalID > 0)
                {
                    workstation.TerminalID = this.mTerminalID;
                }
                if (this.mNumber != "")
                {
                    workstation.Number = this.mNumber;
                }
                if (this.mDescription != "")
                {
                    workstation.Description = this.mDescription;
                }
                if (this.mScaleType != "")
                {
                    workstation.ScaleType = this.mScaleType;
                }
                if (this.mScalePort != "")
                {
                    workstation.ScalePort = this.mScalePort;
                }
                if (this.mPrinterType != "")
                {
                    workstation.PrinterType = this.mPrinterType;
                }
                if (this.mPrinterPort != "")
                {
                    workstation.PrinterPort = this.mPrinterPort;
                }
                workstation.Trace    = this.mTrace;
                workstation.IsActive = this.mIsActive;
                ds.WorkstationDetailTable.AddWorkstationDetailTableRow(workstation);
            }
            catch (Exception) { }
            return(ds);
        }