protected override void ProcessRecord() { warrantyLookupEngine lookupEngine = new warrantyLookupEngine(); AssetData machine = new AssetData(); lookupEngine.engineLookup(ref machine, ref this.ServiceTag); this.WriteObject(machine,true); }
public AssetData( AssetData otherAsset ) { this.machineName = otherAsset.machineName; this.serviceTag = otherAsset.serviceTag; this.systemID = otherAsset.systemID; this.buid = otherAsset.buid; this.region = otherAsset.region; this.systemType = otherAsset.systemType; this.systemModel = otherAsset.systemModel; this.systemShip = otherAsset.systemShip; this.machineWarrantyEnd = otherAsset.machineWarrantyEnd; }
public void engineLookup(ref AssetData machine, ref string machineSerial) { if (machineSerial.Length != 7) { throw new ArgumentNullException(); } Get_DellWarranty.DellServiceReference.AssetService engine = new Get_DellWarranty.DellServiceReference.AssetService(); Get_DellWarranty.DellServiceReference.Asset[] result = engine.GetAssetInformation(this.engineGuid, this.appName, machineSerial); DellServiceReference.EntitlementData[] Entitlements = result[0].Entitlements; DateTime WarrantyEndDate = Entitlements[0].EndDate; machine = new AssetData( "unknown", result[0].AssetHeaderData.ServiceTag, result[0].AssetHeaderData.SystemID, result[0].AssetHeaderData.Buid, result[0].AssetHeaderData.Region, result[0].AssetHeaderData.SystemType, result[0].AssetHeaderData.SystemModel, result[0].AssetHeaderData.SystemShipDate, WarrantyEndDate); }