public static void UpdateLession(VLession moBO) { VLession.Update(moBO); }
public static void DeleteLession(VLession moBO) { VLession.Delete(moBO.LessionID); }
public static void InsertLession(VLession Lession) { VLession.Add(Lession); }
/// <summary> /// /// </summary> /// <param name="currMemberID">Less than 0: unlimit, More than 0: Limit by this memberID</param> /// <param name="lession"></param> /// <param name="authorName"></param> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> public static List<VLession> GetLessionBySearch(int currMemberID, VLession lession, string authorName, int start, int end) { return GetItemsFromTo(GetIQueryableLessionBySearch(currMemberID, lession, authorName), start, end); }
/// <summary> /// /// </summary> /// <param name="currMemberID">Less than 0: unlimit, More than 0: Limit by this memberID</param> /// <param name="lession"></param> /// <param name="authorName"></param> /// <param name="start"></param> /// <param name="end"></param> /// <returns></returns> public static int CountSearchResult(int currMemberID, VLession lession, string authorName) { return GetIQueryableLessionBySearch(currMemberID, lession, authorName).Count(); }
// Search protected static IQueryable<VLession> GetIQueryableLessionBySearch(int currMemberID, VLession lession, string authorName) { IQueryable<VLession> table; IQueryable<VLession> fromTable; if (currMemberID < 0) //unlimit fromTable = All(); else fromTable = GetLessionsByAuthorID(currMemberID); if (lession.LessionPriority > 0 && lession.GroupID > 0) table = (from l in fromTable where l.LessionName.ToUpper().Contains(lession.LessionName.ToUpper()) == true && l.GroupID == lession.GroupID && l.LessionPriority == lession.LessionPriority select l); else if (lession.LessionPriority < 0 && lession.GroupID > 0) table = (from l in fromTable where l.LessionName.ToUpper().Contains(lession.LessionName.ToUpper()) == true && l.GroupID == lession.GroupID select l); else if (lession.LessionPriority > 0 && lession.GroupID < 0) table = (from l in fromTable where l.LessionName.ToUpper().Contains(lession.LessionName.ToUpper()) == true && l.LessionPriority == lession.LessionPriority select l); else table = (from l in fromTable where l.LessionName.ToUpper().Contains(lession.LessionName.ToUpper()) == true select l); return table; }