public NewPart_ViewModel(SQLConnectionLib.Parts changablePart, bool changable) { modifiable = changable; modifiablePart = changablePart; partName = changablePart.partName; partManufacturer = changablePart.partManufacturer; partIDNumber = changablePart.partIDNumber; partPrice = changablePart.partPrice; partQuantity = changablePart.partQuantity; mustOrder = changablePart.mustOrder; requestModify = true; }
void addPartExecute() { SQLConnectionLib.Parts p = new SQLConnectionLib.Parts(); p.partName = partName; p.partQuantity = partQuantity; p.partPrice = partPrice; p.partManufacturer = partManufacturer; p.partIDNumber = partIDNumber; p.mustOrder = mustOrder; if (requestModify) { p.partID = modifiablePart.partID; AppMessages.PartModified.Send(p); } else { AppMessages.PartAdded.Send(p); } }