Ejemplo n.º 1
0
        private LoadOperation <ProductManager.Web.Model.questiontrace> LoadQuestionTraceEntities()
        {
            this.IsBusy = true;
            EntityQuery <ProductManager.Web.Model.questiontrace> lQuery = this.ProductDomainContext.GetQuestiontraceQuery();

            if (!String.IsNullOrEmpty(QuestionContext))
            {
                lQuery = lQuery.Where(c => c.question_descript.ToLower().Contains(QuestionContext.ToLower()));
            }

            if (QuestionRspDepartmentID.HasValue && QuestionRspDepartmentID.Value != 0)
            {
                lQuery = lQuery.Where(c => c.question_res_departmentid == QuestionRspDepartmentID.Value);
            }

            if (QuestionTraceDepartmentID.HasValue && QuestionTraceDepartmentID.Value != 0)
            {
                lQuery = lQuery.Where(c => c.question_trace_departmendid == QuestionTraceDepartmentID.Value);
            }

            if (QuestionStartTime.HasValue)
            {
                lQuery = lQuery.Where(c => c.question_starttime >= QuestionStartTime.Value);
            }

            if (QuestionEndTime.HasValue)
            {
                lQuery = lQuery.Where(c => c.question_starttime <= QuestionEndTime.Value);
            }

            if (AnswerStartTime.HasValue)
            {
                lQuery = lQuery.Where(c => c.question_lastanswertime >= AnswerStartTime.Value);
            }

            if (AnswerEndTime.HasValue)
            {
                lQuery = lQuery.Where(c => c.question_lastanswertime <= AnswerEndTime.Value);
            }

            return(this.ProductDomainContext.Load(lQuery.SortAndPageBy(this.questionTraceView)));
        }