예제 #1
0
        public ActionResult GetTeacher(DtoSchoolTeacherSearch search)
        {
            var list  = schoolTeacherBll.GetSchoolTeacherList(search);
            var table = AbhsTableFactory.Create(list, search.Pagination.TotalCount);

            return(Json(table, JsonRequestBehavior.AllowGet));
        }
예제 #2
0
        public List <DtoSchoolTeacher> GetSchoolTeacherList(DtoSchoolTeacherSearch search)
        {
            if (search == null)
            {
                return(null);
            }
            var strWhere   = new StringBuilder();
            var fields     = "st.*,sc.Bsl_SchoolName";
            var orderBy    = "st.Yoh_Id DESC ";
            var parameters = new DynamicParameters();

            strWhere.Append($@"dbo.Yw_SchoolTeacher st JOIN dbo.Bas_School sc ON st.Yoh_SchoolId=sc.Bsl_Id  WHERE 1=1 AND Yoh_Status <>${(int)StatusEnum.删除} AND Yoh_IsSchoolMaster = 0 ");

            if (search.SchoolId > 0)
            {
                strWhere.Append(" AND Yoh_SchoolId=@Yoh_SchoolId ");
                parameters.Add("Yoh_SchoolId", search.SchoolId);
            }
            if (search.TeacherId > 0)
            {
                strWhere.Append(" AND Yoh_Id=@Yoh_Id");
                parameters.Add("Yoh_Id", search.TeacherId);
            }
            else
            {
                if (search.Status > 0)
                {
                    strWhere.Append(" AND Yoh_Status=@Yoh_Status");
                    parameters.Add("Yoh_Status", search.Status);
                }

                if (search.Grade > 0)
                {
                    strWhere.Append(" AND Yoh_Grade & @Yoh_Grade=@Yoh_Grade");
                    parameters.Add("Yoh_Grade", search.Grade);
                }
                if (search.SearchStr.HasValue())
                {
                    strWhere.Append(" AND (Yoh_Name LIKE @Yoh_Name OR Yoh_Phone LIKE @Yoh_Phone ) ");
                    parameters.Add("Yoh_Name", $"%{search.SearchStr}%");
                    parameters.Add("Yoh_Phone", $"%{search.SearchStr}%");
                }
            }

            return(base.QueryPaging <DtoSchoolTeacher>(fields, strWhere._ToString(), orderBy, search.Pagination, parameters).ToList());
        }
예제 #3
0
        public void GetRegionTest()
        {
            DtoSchoolTeacherSearch search = new DtoSchoolTeacherSearch(10000);

            search.Grade = 4;

            var list = schoolTeacherBll.GetSchoolTeacherList(search);

            BaseAssertList(list);


            //bll.IncrementStudentCount(10000, 5, 1);

            DateTime dt = new DateTime(2019, 10, 1, 5, 20, 30);

            var s = dt.ToString("yyyy-MM-dd hh:mm:ss");

            Assert.IsNotNull(s);
        }
예제 #4
0
        // GET: Teacher
        public ActionResult Index()
        {
            DtoSchoolTeacherSearch search = new DtoSchoolTeacherSearch(CurrentUser.Teacher.Yoh_SchoolId);

            return(View(search));
        }
예제 #5
0
 /// <summary>
 /// 学校教师列表
 /// </summary>
 /// <param name="search"></param>
 /// <returns></returns>
 public List <DtoSchoolTeacher> GetSchoolTeacherList(DtoSchoolTeacherSearch search)
 {
     return(SchoolTeacherRepository.GetSchoolTeacherList(search));
 }