Exemplo n.º 1
0
        public void AddEvent()
        {
            //数据验证过程
            if (!new DepartmentVaildater(_ItsView).Vaildate())
            {
                return;
            }
            //数据收集过程
            _ANewObject = new Department(0, "");
            new DepartmentDataCollector(_ItsView).CompleteTheObject(_ANewObject);
            try
            {
                using (TransactionScope ts = new TransactionScope(TransactionScopeOption.Required))
                {
                    _DepartmentBll.CreateDept(Convert.ToInt32(_ItsView.ParentID), _ANewObject, _LoginUser);
                    if (CompanyConfig.HasHrmisSystem)
                    {
                        IDepartmentHistoryFacade hrmisDepartmentHistoryFacade =
                            new DepartmentHistoryFacade();
                        hrmisDepartmentHistoryFacade.AddDepartmentHistory(_LoginUser);
                    }
                    ts.Complete();
                }

                _ItsView.ActionSuccess = true;
            }
            catch (ApplicationException ae)
            {
                _ItsView.Message = ae.Message;
            }
            catch (Exception e)
            {
                _ItsView.Message = e.Message;
            }
        }