Ejemplo n.º 1
0
        public override void Initialize(bool isPostBack)
        {
            _ITemplatePaperView.ResultMessage = string.Empty;
            _ITemplatePaperView.ValidatePaperName = string.Empty;
            _ITemplatePaperView.AssessItems = _IAssessManagementFacade.GetAllTemplateItems();

            _ITemplatePaperView.ActionButtonEvent += AddEvent;

            TemplageItemEditor itemEditor = new TemplageItemEditor(_ITemplatePaperView);
            _ITemplatePaperView.btnCopyEvent += itemEditor.btnCopyEvent;
            _ITemplatePaperView.btnPasteEvent += itemEditor.btnPasteEvent;
            _ITemplatePaperView.CancelButtonEvent += CancelEvent;
            _ITemplatePaperView.ddlAssessItemChangedForAddEvent += itemEditor.ddlChangedForAddEvent;
            _ITemplatePaperView.ddlAssessItemChangedForUpdateEvent += itemEditor.ddlChangedForUpdateEvent;
            _ITemplatePaperView.ddlAssessItemChangedForDeleteEvent += itemEditor.ddlChangedForDeleteEvent;
            _ITemplatePaperView.ddlAssessItemChangedForAddAtEvent += itemEditor.ddlAssessItemChangedForAddAtEvent;
            _ITemplatePaperView.ddlAssessItemChangedForUpEvent += itemEditor.ddlAssessItemChangedForUpEvent;
            _ITemplatePaperView.ddlAssessItemChangedForDownEvent += itemEditor.ddlAssessItemChangedForDownEvent;

            if (!isPostBack)
            {
                _ITemplatePaperView.OperationInfo = "新增绩效考核表";
                _ITemplatePaperView.OperationType = "Add";
                _ITemplatePaperView.TemplatePaperName = string.Empty;

                List<AssessTemplateItem> items = new List<AssessTemplateItem>();
                AssessTemplateItem empty = new AssessTemplateItem(-1, "", OperateType.NotHR);
                empty.Weight = 0;
                items.Add(empty);
                _ITemplatePaperView.AssessItemList = items;
            }
            _ITemplatePaperView.SetbtnPasteVisible = _ITemplatePaperView.SessionCopyPaper != null;
        }
        public override void Initialize(bool isPostBack)
        {
            _ITemplatePaperView.ResultMessage     = string.Empty;
            _ITemplatePaperView.ValidatePaperName = string.Empty;
            _ITemplatePaperView.AssessItems       = _IAssessManagementFacade.GetAllTemplateItems();

            _ITemplatePaperView.ActionButtonEvent += UpdateEvent;

            TemplageItemEditor itemEditor = new TemplageItemEditor(_ITemplatePaperView);

            _ITemplatePaperView.btnCopyEvent      += itemEditor.btnCopyEvent;
            _ITemplatePaperView.btnPasteEvent     += itemEditor.btnPasteEvent;
            _ITemplatePaperView.CancelButtonEvent += CancelEvent;
            _ITemplatePaperView.ddlAssessItemChangedForAddEvent    += itemEditor.ddlChangedForAddEvent;
            _ITemplatePaperView.ddlAssessItemChangedForUpdateEvent += itemEditor.ddlChangedForUpdateEvent;
            _ITemplatePaperView.ddlAssessItemChangedForDeleteEvent += itemEditor.ddlChangedForDeleteEvent;
            _ITemplatePaperView.ddlAssessItemChangedForAddAtEvent  += itemEditor.ddlAssessItemChangedForAddAtEvent;
            _ITemplatePaperView.ddlAssessItemChangedForUpEvent     += itemEditor.ddlAssessItemChangedForUpEvent;
            _ITemplatePaperView.ddlAssessItemChangedForDownEvent   += itemEditor.ddlAssessItemChangedForDownEvent;

            if (!isPostBack)
            {
                _ITemplatePaperView.OperationInfo = "修改绩效考核表";
                _ITemplatePaperView.OperationType = "Update";

                AssessTemplatePaper paper = _IAssessManagementFacade.GetTempletPaperAndItemById(_TemplatePaperId);
                _ITemplatePaperView.PositionList      = paper.PositionList;
                _ITemplatePaperView.TemplatePaperName = paper.PaperName;
                paper.ItsAssessTemplateItems.Add(new AssessTemplateItem(-1, "", OperateType.NotHR));
                _ITemplatePaperView.AssessItemList = paper.ItsAssessTemplateItems;
            }

            _ITemplatePaperView.SetbtnPasteVisible = _ITemplatePaperView.SessionCopyPaper != null;
        }