Exemplo n.º 1
0
        //呼叫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);
        }
Exemplo n.º 2
0
 public void TestName()
 {
     _position.SetName("testPosiName");
     Assert.AreEqual("testPosiName", _position.GetName());
 }