public void DeleteBin(InventoryBin bin) { NetSuiteService service = new NetSuiteService(); service.CookieContainer = new CookieContainer(); NetsuiteUser user = new NetsuiteUser("3451682", "*****@*****.**", "1026", "tridenT168"); Passport passport = user.prepare(user); Status status = service.login(passport).status; BinSearch binSearch = new BinSearch(); BinSearchBasic bSBasic = new BinSearchBasic(); SearchStringField binName = new SearchStringField(); binName.searchValue = bin.BinNumber; binName.@operator = SearchStringFieldOperator.@is; binName.operatorSpecified = true; bSBasic.binNumber = binName; binSearch.basic = bSBasic; SearchResult sr = new SearchResult(); sr = service.search(binSearch); if (sr.status.isSuccess != true) Console.WriteLine(sr.status.statusDetail[0].message); RecordRef binToDelete = new RecordRef(); binToDelete.type = RecordType.bin; binToDelete.typeSpecified = true; binToDelete.name = bin.BinNumber; binToDelete.internalId = ((Bin)sr.recordList[0]).internalId; WriteResponse writeResponse = service.delete(binToDelete); if (writeResponse.status.isSuccess == true) { Console.WriteLine("Bin: " + binToDelete.name + " has been deleted."); } if (writeResponse.status.isSuccess == false) { Console.WriteLine(writeResponse.status.statusDetail[0].message); } }
public string deleteFulfillment() { NetSuiteService service = new NetSuiteService(); service.CookieContainer = new CookieContainer(); NetsuiteUser user = new NetsuiteUser("3451682", "*****@*****.**", "1026", "tridenT168"); Passport passport = user.prepare(user); Status status = service.login(passport).status; RecordRef orderToBeDeleted = new RecordRef(); orderToBeDeleted.type = RecordType.itemFulfillment; orderToBeDeleted.typeSpecified = true; orderToBeDeleted.internalId = this.itemFulfillment.internalId; WriteResponse writeResponse = service.delete(orderToBeDeleted); if (writeResponse.status.isSuccess == true) { Console.WriteLine("Delete Item Fulfillment " + this.itemFulfillment.tranId + " success"); return "Delete Item Fulfillment " + this.itemFulfillment.tranId + " success"; } if (writeResponse.status.isSuccess == false) { Console.WriteLine(writeResponse.status.statusDetail[0].message); return writeResponse.status.statusDetail[0].message; } return string.Empty; }