Exemple #1
0
        /// <summary>
        /// 点击确定按钮后引发的事件
        /// </summary>
        public void BtnActionEvent()
        {
            //验证信息是否填写完全及格式是否正确
            bool vaild = true;

            foreach (IAddEmployeePresenter aPresenter in _ThePresenters)
            {
                if (!aPresenter.Vaildate())
                {
                    _ItsView.Message       = "员工信息填写不完整或填写格式有误!";
                    _ItsView.ActionSuccess = false;
                    vaild = false;
                }
            }
            if (!vaild)
            {
                return;
            }
            //将填写的信息赋值给aNewObject对象
            Employee aNewObject = new Employee();

            foreach (IAddEmployeePresenter aPresenter in _ThePresenters)
            {
                aPresenter.CompleteTheObject(aNewObject);
            }
            try
            {
                _IEmployeeFacade.AddEmployeeProxy(aNewObject, _OperatorAccount);
                _ItsView.Message       = "操作成功";
                _ItsView.ActionSuccess = true;
            }
            catch (ApplicationException ae)
            {
                _ItsView.Message       = ae.Message;
                _ItsView.ActionSuccess = false;
            }
        }