public NewTool_ViewModel() { if (!this.IsInDesignMode) { newTool = new ToolRepresentation() { ValidationRules = new ToolValidationRules() }; newTool.toolStatus = new ToolStatusRepresentation() { id = 1 }; newTool.fromDate = DateTime.Today; newTool.defaultDeposit = 0; } }
public static ToolRepresentation convertTool(Tools tool) { ToolRepresentation convertedTool = new ToolRepresentation() { id = tool.toolID, defaultDeposit = tool.defaultDeposit, fromDate = tool.fromDate, IDNumber = tool.IDNumber, isDeleted = tool.isDeleted, rentCounter = tool.rentCounter, rentPrice = tool.rentPrice, serialNumber = tool.serialNumber, toolManufacturer = tool.toolManufacturer, toolName = tool.toolName, toolStatus = RepresentationConverter.convertToolStatus(tool.ToolStatuses) }; return convertedTool; }
public static void Send(ToolRepresentation t) { Messenger.Default.Send(t, MessageTypes.toolModified); }
public static Tools convertTool(ToolRepresentation tool) { Tools convertedTool = new Tools() { toolID = tool.id, defaultDeposit = tool.defaultDeposit, fromDate = tool.fromDate, IDNumber = tool.IDNumber, isDeleted = tool.isDeleted, rentCounter = tool.rentCounter, rentPrice = tool.rentPrice, serialNumber = tool.serialNumber, toolManufacturer = tool.toolManufacturer, toolName = tool.toolName, toolStatusID = tool.toolStatus.id }; return convertedTool; }