Beispiel #1
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;
                workstation.Name          = this.mName;
                workstation.TerminalID    = this.mTerminalID;
                workstation.Number        = this.mNumber;
                workstation.Description   = this.mDescription;
                workstation.ScaleType     = this.mScaleType;
                workstation.ScalePort     = this.mScalePort;
                workstation.PrinterType   = this.mPrinterType;
                workstation.PrinterPort   = this.mPrinterPort;
                workstation.Trace         = this.mTrace;
                workstation.IsActive      = this.mIsActive;
                ds.WorkstationDetailTable.AddWorkstationDetailTableRow(workstation);
                ds.AcceptChanges();
            }
            catch (Exception) { }
            return(ds);
        }
Beispiel #2
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("Unexpected error creating new Workstation instance.", ex); }
 }