コード例 #1
0
ファイル: SurveysList.aspx.cs プロジェクト: ugt-software/LMIS
        private void FillDataGrid()
        {
            var entities = (from n in DataContext.LP_Surveys
                            where n.DateDeleted == null
                            orderby n.OrderIndex, n.DateCreated
                            select n).ToList();

            var converter = new SurveyEntityModelConverter(DataContext);

            var models = (from n in entities
                          let m = converter.Convert(n)
                                  select m).ToList();

            var model = new SurveysModel();

            model.List = models;

            surveysControl.Model = model;
        }
コード例 #2
0
ファイル: Surveys.aspx.cs プロジェクト: ugt-software/LMIS
        private void FillSurveys()
        {
            var parentID = DataConverter.ToNullableGuid(Request["ID"]);

            var currentLanguage = LanguageUtil.GetLanguage();

            var query = from n in DataContext.LP_Surveys
                        where n.DateDeleted == null && (n.Language == currentLanguage || n.Language == null || n.Language == "")
                        select n;

            if (parentID == null)
            {
                query = from n in query
                        where n.ParentID == null
                        select n;
            }
            else
            {
                query = from n in query
                        where n.ParentID == parentID
                        select n;
            }

            query = from n in query
                    orderby n.OrderIndex, n.DateCreated
            select n;

            var entities = query.ToList();

            var converter = new SurveyEntityModelConverter(DataContext);

            var models = (from n in entities
                          let m = converter.Convert(n)
                                  select m).ToList();

            var model = new SurveysModel();

            model.List = models;

            surveysControl.Model = model;
        }