Example #1
0
        protected override void ShowData(int ScheduleQuestionId)
        {
            base.ShowData(ScheduleQuestionId);

            oDetailButtonPanel.SetId = SetId;

            Clear();

            var dataQuery = new ScheduleQuestionDataModel();

            dataQuery.ScheduleQuestionId = ScheduleQuestionId;

            var entityList = ScheduleQuestionDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile);

            if (entityList.Count == 1)
            {
                foreach (var entityItem in entityList)
                {
                    lblScheduleQuestionId.Text = entityItem.ScheduleQuestionId.ToString();
                    lblScheduleId.Text         = entityItem.ScheduleId.ToString();
                    lblQuestionId.Text         = entityItem.QuestionId.ToString();
                    lblAnswer.Text             = entityItem.Answer.ToString();

                    oUpdateInfo.LoadText(entityItem.UpdatedDate, entityItem.UpdatedBy, entityItem.LastAction);

                    oHistoryList.Setup(PrimaryEntity, ScheduleQuestionId, "ScheduleQuestion");
                }
            }
        }
Example #2
0
        public void LoadData(int scheduleQuestionId, bool showId)
        {
            // clear UI

            Clear();

            var dataQuery = new ScheduleQuestionDataModel();

            dataQuery.ScheduleQuestionId = scheduleQuestionId;

            var items = ScheduleQuestionDataManager.GetEntityDetails(dataQuery, SessionVariables.RequestProfile);

            if (items.Count != 1)
            {
                return;
            }

            var item = items[0];

            ScheduleQuestionId = item.ScheduleQuestionId;
            ScheduleId         = item.ScheduleId;
            QuestionId         = item.QuestionId;
            Answer             = item.Answer;

            if (!showId)
            {
                txtScheduleQuestionId.Text = item.ScheduleQuestionId.ToString();

                // only show Audit History in case of Update page, not for Clone.
                oHistoryList.Setup((int)Framework.Components.DataAccess.SystemEntity.ScheduleQuestion, scheduleQuestionId, "ScheduleQuestion");
            }
            else
            {
                txtScheduleQuestionId.Text = String.Empty;
            }

            oUpdateInfo.LoadText(item.UpdatedDate, item.UpdatedBy, item.LastAction);
        }