//呼叫service 利用authoID查詢autho資料
        public AuthorizationPresentationModel SearchDataByAuthoID()
        {
            AuthorizationPresentationModel authoPresentModel = new AuthorizationPresentationModel();

            if (this._authoModel.GetAuthoID() == null || this._authoModel.GetAuthoID() == "")
            {
                MessageBox.Show("請輸入權限ID");
            }
            else
            {
                //MessageBox.Show("yes");
                _authoService = new AuthorizationService(this._authoModel);
                _authoModel   = _authoService.searchByAuthoID();

                authoPresentModel.SetAuthoID(_authoModel.GetAuthoID());
                authoPresentModel.SetAuthoName(_authoModel.GetAuthoName());
                authoPresentModel.SetAuthoValue(_authoModel.GetAuthoValue());

                if (_authoModel.GetAuthoName() == null || _authoModel.GetAuthoName() == "")
                {
                    MessageBox.Show("此權限ID不存在!");
                    //MessageBox.Show(_authoModel.GetAuthoID());
                    authoPresentModel.SetAuthoID(null);
                }
            }
            return(authoPresentModel);
        }
Esempio n. 2
0
 public void TestAuthoID()
 {
     _autho.SetAuthoID("testID");
     Assert.AreEqual("testID", _autho.GetAuthoID());
 }