//呼叫service 利用positionID查詢position資料 public PositionPresentationModel SearchDataByPositionID() { PositionPresentationModel positionPresentationModel = new PositionPresentationModel(); if (this._positionModel.GetId() == null || this._positionModel.GetId() == "") { MessageBox.Show("請輸入職位ID"); } else { //MessageBox.Show("yes"); _positionService = new PositionService(this._positionModel); _positionModel = _positionService.searchByPositionID(); positionPresentationModel.SetPositionID(_positionModel.GetId()); positionPresentationModel.SetPositionName(_positionModel.GetName()); positionPresentationModel.SetPositionBasicSalary(_positionModel.GetBasicSalary()); positionPresentationModel.SetPositionAuthoID(_positionModel.GetAuthoId()); if (positionPresentationModel.GetPositionName() == null || positionPresentationModel.GetPositionName() == "") { MessageBox.Show("此職位ID不存在!"); //MessageBox.Show(_authoModel.GetAuthoID()); positionPresentationModel.SetPositionID(null); } } return(positionPresentationModel); }
public void TestBasicSalary() { _position.SetBasicSalary(81000.00F); Assert.AreEqual(81000.00F, _position.GetBasicSalary()); }