Exemple #1
0
        /// <summary>
        /// 作者:Primo
        /// 时间:2015.05.25
        /// 描述:获取符合条件的一课一练的学员
        /// </summary>
        /// <param name="branchId"></param>
        /// <param name="userId"></param>
        /// <param name="isMyStudent"></param>
        /// <param name="isAllStudent"></param>
        /// <param name="productId"></param>
        /// <param name="currentLevel"></param>
        /// <param name="searchKey"></param>
        /// <param name="searchKeyword"></param>
        /// <returns></returns>
        public static List<GetEWordBookStudent_Result> GetEwordBookStudent(int? branchId, int? userId, bool? isMyStudent, bool? isAllStudent, int? productId, int? currentLevel, int? searchKey, string searchKeyword)
        {
            var Db = new EmeEntities(dbRead);

            var cc = "";
            var sa = "";
            var userName = "";
            var account = "";

            if (searchKey.HasValue)
            {
                //登录帐号
                if (ConvertEnum.SearchStudentKeyForAccount == searchKey.Value)
                {
                    account = searchKeyword;
                }

                //用户名称
                if (ConvertEnum.SearchStudentKeyForUserName == searchKey.Value)
                {
                    userName = searchKeyword;
                }

                //CC
                if (ConvertEnum.SearchStudentKeyForCC == searchKey.Value)
                {
                    cc = searchKeyword;
                }

                //SA
                if (ConvertEnum.SearchStudentKeyForSA == searchKey.Value)
                {
                    sa = searchKeyword;
                }
            }

            if (isMyStudent.HasValue)
            {
                if (!isMyStudent.Value)
                {
                    userId = 0;
                }
            }

            if (isAllStudent.HasValue)
            {
                if (isAllStudent.Value)
                {
                    userId = 0;
                }
            }

            var modelList = Db.GetEWordBookStudent(branchId, productId, currentLevel, cc, sa, userName, account, userId).ToList();

            return modelList;
        }