public TapmacViewModel(UserInformation user, string costCentCode) { // UserInformation user = (UserInformation)App.Current.Properties["userinfo"]; userinformation = user; costCenterCode = costCentCode; tapmac = new Tapmachine(userinformation); DDTAPPING_MAC ddtap = tapmac.getTapmachines(costCenterCode); if (ddtap == null) { ddtappingmac = new DDTAPPING_MAC(); ddtappingmac.COST_CENT_CODE = costCenterCode; ddtappingmac.MAX_TAP_SIZE = 0; ddtappingmac.MIN_TAP_SIZE = 0; ddtappingmac.MOTOR_POWER = 0; ddtappingmac.NO_OF_SPINDLES = 0; ddtappingmac.PUSH_STORKE_SHAFT_SPEED = 0; } else { ddtappingmac = new DDTAPPING_MAC(); ddtappingmac.COST_CENT_CODE = ddtap.COST_CENT_CODE; ddtappingmac.MAX_TAP_SIZE = ddtap.MAX_TAP_SIZE; ddtappingmac.MIN_TAP_SIZE = ddtap.MIN_TAP_SIZE; ddtappingmac.MOTOR_POWER = ddtap.MOTOR_POWER; ddtappingmac.NO_OF_SPINDLES = ddtap.NO_OF_SPINDLES; ddtappingmac.PUSH_STORKE_SHAFT_SPEED = ddtap.PUSH_STORKE_SHAFT_SPEED; } this.cancelTapmacCommand = new DelegateCommand(this.CancelTapmac); this.saveTapmacCommand = new DelegateCommand(this.SaveTapmac); this.unloadCommand = new DelegateCommand(this.UnloadTapmac); }
public TapmacViewModel() { UserInformation user = (UserInformation)App.Current.Properties["userinfo"]; userinformation = user; tapmac = new Tapmachine(); this.cancelTapmacCommand = new DelegateCommand(this.CancelTapmac); this.saveTapmacCommand = new DelegateCommand(this.SaveTapmac); }