Beispiel #1
0
        public BaseRequestModel(string keyword, string orderBy = "Modified", string isAscending = "False")
        {
            if (string.IsNullOrEmpty(keyword))
            {
                keyword = "";
            }
            Page    = 1;
            Keyword = keyword.ToLower();
            if (!string.IsNullOrWhiteSpace(orderBy))
            {
                OrderBy = orderBy;
            }
            if (!string.IsNullOrWhiteSpace(isAscending))
            {
                IsAscending = isAscending;
            }


            if (string.IsNullOrWhiteSpace(OrderBy))
            {
                OrderBy     = "Modified";
                isAscending = "False";
            }

            Request = new OrderByRequest
            {
                PropertyName = string.IsNullOrWhiteSpace(OrderBy) ? "Modified" : OrderBy,
                IsAscending  = string.IsNullOrWhiteSpace(isAscending) ? false : bool.Parse(isAscending)
            };
        }
Beispiel #2
0
 protected RequestModel(string keyword, string orderBy, string isAscending)
 {
     if (string.IsNullOrEmpty(keyword))
     {
         keyword = "";
     }
     Page         = 1;
     PerPageCount = 10;
     Keyword      = keyword.ToLower();
     _request     = new OrderByRequest
     {
         PropertyName = string.IsNullOrWhiteSpace(orderBy) ? "Modified" : orderBy,
         IsAscending  = isAscending == "True"
     };
 }
Beispiel #3
0
 protected RequestModel(string keyword, string orderBy, string isAscending)
 {
     if (string.IsNullOrEmpty(keyword))
     {
         keyword = "";
     }
     Page    = 1;
     Keyword = keyword.ToLower();
     if (!string.IsNullOrWhiteSpace(orderBy))
     {
         OrderBy = orderBy;
     }
     if (!string.IsNullOrWhiteSpace(isAscending))
     {
         IsAscending = isAscending;
     }
     Request = new OrderByRequest
     {
         PropertyName = string.IsNullOrWhiteSpace(OrderBy) ? "Modified" : OrderBy,
         IsAscending  = IsAscending == "True"
     };
 }