Exemple #1
0
 public static void UpdateLession(VLession moBO)
 {
     VLession.Update(moBO);
 }
Exemple #2
0
 public static void DeleteLession(VLession moBO)
 {
     VLession.Delete(moBO.LessionID);
 }
Exemple #3
0
 public static void InsertLession(VLession Lession)
 {
     VLession.Add(Lession);
 }
Exemple #4
0
 /// <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);
 }
Exemple #5
0
 /// <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();
 }
Exemple #6
0
        // 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;
        }