本文整理汇总了C#中Eme.Model.Eme.EmeEntities.GetStudentServiceUser方法的典型用法代码示例。如果您正苦于以下问题:C# EmeEntities.GetStudentServiceUser方法的具体用法?C# EmeEntities.GetStudentServiceUser怎么用?C# EmeEntities.GetStudentServiceUser使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Eme.Model.Eme.EmeEntities
的用法示例。
在下文中一共展示了EmeEntities.GetStudentServiceUser方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetStudentList
/// <summary>
/// 作者:Primo
/// 时间:2014.07.09
/// 描述:获取学员列表
/// </summary>
/// <param name="userId"></param>
/// <param name="branchId"></param>
/// <param name="productLevelId"></param>
/// <param name="searchKeyWord"></param>
/// <returns></returns>
public static List<GetStudentServiceUser_Result> GetStudentList(int? userId, int? branchId, int? productLevelId, int? searchKey, string searchKeyWord)
{
var Db = new EmeEntities(dbRead);
var query = Db.GetStudentServiceUser(branchId, productLevelId).ToList();
if (userId.HasValue && userId.Value != 0)
{
query = query.Where(a => a.SaId == userId).ToList();
}
if (searchKey.HasValue && !string.IsNullOrEmpty(searchKeyWord))
{
if (searchKey.Value == ConvertEnum.SearchStudentKeyForKeyWord)
{
query = query.Where(a => a.CName.Contains(searchKeyWord)
|| a.EName.Contains(searchKeyWord)
|| a.Email.Contains(searchKeyWord)
|| a.Mobile.Contains(searchKeyWord)
|| a.UserName.Equals(searchKeyWord, StringComparison.CurrentCultureIgnoreCase)).ToList();
}
else if (searchKey.Value == ConvertEnum.SearchStudentKeyForUserName)
{
query = query.Where(a => a.CName.Contains(searchKeyWord) || a.EName.Contains(searchKeyWord)).ToList();
}
else if (searchKey.Value == ConvertEnum.SearchStudentKeyForSA)
{
query = query.Where(a => a.SaId.HasValue && a.SaName.Contains(searchKeyWord)).ToList();
}
else if (searchKey.Value == ConvertEnum.SearchStudentKeyForCC)
{
query = query.Where(a => a.CcId.HasValue && a.CcName.Contains(searchKeyWord)).ToList();
}
else if (searchKey.Value == ConvertEnum.SearchStudentKeyForAccount)
{
query = query.Where(a => a.UserName.Equals(searchKeyWord, StringComparison.CurrentCultureIgnoreCase)).ToList();
}
}
return query.Distinct().ToList();
}