private void AddEvent()
        {
            if (!Validation())
            {
                return;
            }

            try
            {
                List <TrainFBQuestion> items = new List <TrainFBQuestion>();
                for (int i = 0; i < _ITemplatePaperView.QuestionList.Count; i++)
                {
                    if (_ITemplatePaperView.QuestionList[i].FBQuestioniD != -1)
                    {
                        items.Add(_ITemplatePaperView.QuestionList[i]);
                    }
                }
                Model.FeedBackPaper _Paper = new Model.FeedBackPaper();
                _Paper.FeedBackPaperId   = -1;
                _Paper.FeedBackPaperName = _ITemplatePaperView.TemplatePaperName;
                _Paper.FBQuestions       = items;
                _IPaperFacade.AddAFeedBackPaper(_Paper);
                _ITemplatePaperView.ActionSuccess = true;
                ToAccountSetListPage();
            }
            catch (Exception ex)
            {
                _ITemplatePaperView.ResultMessage = "<span class='fontred'>" + ex.Message + "</span>";
            }
        }
Exemplo n.º 2
0
        public override void Initialize(bool isPostBack)
        {
            _ITemplatePaperView.ResultMessage     = string.Empty;
            _ITemplatePaperView.ValidatePaperName = string.Empty;
            _ITemplatePaperView.QuestionItems     = _ITrainFacade.GetFBQuestionByConditon(string.Empty, -1);

            _ITemplatePaperView.ActionButtonEvent += UpdateEvent;

            FeedBackQuestionEditor itemEditor = new FeedBackQuestionEditor(_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";

                Model.FeedBackPaper paper = _IPaperFacade.GetFeedBackPaperById(_PaperId);
                _ITemplatePaperView.TemplatePaperName = paper.FeedBackPaperName;
                paper.FBQuestions.Add(new TrainFBQuestion(-1, string.Empty, new TrainFBQuesType(-1, string.Empty), new List <TrainFBItem>()));
                _ITemplatePaperView.QuestionList = paper.FBQuestions;
            }

            _ITemplatePaperView.SetbtnPasteVisible = _ITemplatePaperView.SessionCopyPaper != null;
        }
Exemplo n.º 3
0
 /// <summary>
 /// 复制事件
 /// </summary>
 public void btnCopyEvent()
 {
     Model.FeedBackPaper paper = new Model.FeedBackPaper();
     paper.FeedBackPaperId   = 0;
     paper.FeedBackPaperName = _ITemplatePaperView.TemplatePaperName;
     paper.FBQuestions       = _ITemplatePaperView.QuestionList;
     _ITemplatePaperView.SessionCopyPaper = paper;
 }
Exemplo n.º 4
0
        public override void Initialize(bool isPostBack)
        {
            _ITemplatePaperView.ResultMessage     = string.Empty;
            _ITemplatePaperView.ValidatePaperName = string.Empty;
            _ITemplatePaperView.QuestionItems     = _ITrainFacade.GetFBQuestionByConditon(string.Empty, -1);

            _ITemplatePaperView.ActionButtonEvent += CancelEvent;
            _ITemplatePaperView.CancelButtonEvent += CancelEvent;

            FeedBackQuestionEditor itemEditor = new FeedBackQuestionEditor(_ITemplatePaperView);

            _ITemplatePaperView.btnCopyEvent += itemEditor.btnCopyEvent;

            if (!isPostBack)
            {
                _ITemplatePaperView.OperationInfo = "²é¿´·´À¡Îʾí";
                _ITemplatePaperView.OperationType = "Detail";

                Model.FeedBackPaper paper = _IPaperFacade.GetFeedBackPaperById(_PaperId);
                _ITemplatePaperView.TemplatePaperName = paper.FeedBackPaperName;
                _ITemplatePaperView.QuestionList      = paper.FBQuestions;
                _ITemplatePaperView.SetFormReadOnly   = true;
            }
        }