Esempio n. 1
0
        private DataSet QueryDataResultForExp(HttpContext context)
        {
            var corName = context.Request["name"].Trim();
            var teaName = context.Request["teaName"].Trim();
            var teaplace = context.Request["teaplace"].Trim();
            var teaTime = context.Request["teaTime"].Trim();
            var ds = new DataSet();
            var courBll = new BLL.Course();
            var strWhere = "";
            if (!string.IsNullOrEmpty(corName))
            {
                strWhere = string.Format(" CourseName like '%" + corName + "%' ");
            }
            if (!string.IsNullOrEmpty(teaName))
            {
                if (!string.IsNullOrEmpty(strWhere))
                {
                    strWhere += string.Format(" and  TeacherName  like '%" + teaName + "%' ");
                }
                else
                {
                    strWhere = string.Format(" TeacherName like '%" + teaName + "%' ");
                }
            }
            if (!string.IsNullOrEmpty(teaplace))
            {
                if (!string.IsNullOrEmpty(strWhere))
                {
                    strWhere += string.Format(" and  TeachPlace  like '%" + teaplace + "%' ");
                }
                else
                {
                    strWhere = string.Format(" TeachPlace like '%" + teaplace + "%' ");
                }
            }
            if (!string.IsNullOrEmpty(teaTime))
            {
                if (!string.IsNullOrEmpty(strWhere))
                {
                    strWhere += string.Format(" and  TeachTime  like '%" + teaTime + "%' ");
                }
                else
                {
                    strWhere = string.Format(" TeachTime like '%" + teaTime + "%' ");
                }
            }

            ds = courBll.GetDataForExport(strWhere);
            return ds;
        }