예제 #1
0
        public static List<BusinessLogicLayer.Entities.Conference.ConferenceRegistrationItems> RetrieveUserAnswers(Panel ResultsArea)
        {
            List<BusinessLogicLayer.Entities.Conference.ConferenceRegistrationItems> SurveyUserAnswers = new List<BusinessLogicLayer.Entities.Conference.ConferenceRegistrationItems>();
            string result = "";
            List<Panel> Panels = new List<Panel>();
            foreach (Control c in ResultsArea.Controls)
            {
                try
                {
                    Panel p = (Panel)c;
                    Panels.Add(p);
                }
                catch
                {

                }
            }

            foreach (Panel p in Panels)
            {
                BusinessLogicLayer.Entities.Conference.ConferenceRegistrationType q = new BusinessLogicLayer.Components.Conference.ConferenceRegistrationTypeLogic().GetByID(int.Parse(p.ID.Replace("Panel", "")));
                if (string.IsNullOrEmpty(q.GroupName))
                {
                    CollectCheckAnswer(ref SurveyUserAnswers, p, q);
                }
                else
                {
                    CollectChoiceAnswer(ref SurveyUserAnswers, p, q);
                }

            }
            return SurveyUserAnswers;
        }
예제 #2
0
        public static void LoadControlValues(Panel ResultsArea, List<BusinessLogicLayer.Entities.Conference.ConferenceRegistrationItems> items)
        {
            List<Panel> Panels = new List<Panel>();
            foreach (Control c in ResultsArea.Controls)
            {
                try
                {
                    Panel p = (Panel)c;
                    Panels.Add(p);
                }
                catch
                {

                }
            }

            foreach (Panel p in Panels)
            {
                BusinessLogicLayer.Entities.Conference.ConferenceRegistrationType q = new BusinessLogicLayer.Components.Conference.ConferenceRegistrationTypeLogic().GetByID(int.Parse(p.ID.Replace("Panel", "")));
                var item = (from x in items where x.ConferenceRegistrationTypeID == q.ConferenceRegistrationTypeId select x).FirstOrDefault();
                if (item != null)
                {
                    if (string.IsNullOrEmpty(q.GroupName))
                    {
                        SetCheckAnswerValue(p, q);
                    }
                    else
                    {
                        SetChoiceAnswerValue(p, q);
                    }
                }
            }
        }