Esempio n. 1
0
        public ContentResult Search(SearchFilter SearchKey)
        {
            SearchKey.OrderBy = string.IsNullOrEmpty(SearchKey.OrderBy) ? "Id" : SearchKey.OrderBy;
            QueuedEmailCollection collection = QueuedEmailManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(collection), "application/json"));
        }
Esempio n. 2
0
        /// <summary>
        /// use for scrolling page
        /// </summary>
        /// <returns></returns>
        public ContentResult GetPg(int page, int pagesize)
        {
            string                condition = "";
            SearchFilter          SearchKey = SearchFilter.SearchPG(CurrentUser.CompanyID, page, pagesize, "Id", "Id", "Desc", condition);
            QueuedEmailCollection objItem   = QueuedEmailManager.Search(SearchKey);

            return(Content(JsonConvert.SerializeObject(objItem), "application/json"));
        }
Esempio n. 3
0
        public JsonResult GetGata([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel)
        {
            SearchFilter          SearchKey  = SearchFilter.SearchData(CurrentUser.CompanyID, requestModel, "Id", "Id");
            QueuedEmailCollection collection = QueuedEmailManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            //QueuedEmailCollection data = QueuedEmailManager.GetAll(CurrentUser.CompanyID);
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
Esempio n. 4
0
        public JsonResult GetSearchData([ModelBinder(typeof(DataTablesBinder))] IDataTablesRequest requestModel, string searchprm)
        {
            SearchFilter SearchKey = BindSearch(searchprm);

            SearchKey = SearchFilter.SearchData(SearchKey, requestModel);
            QueuedEmailCollection collection = QueuedEmailManager.Search(SearchKey);
            int TotalRecord = 0;

            if (collection.Count > 0)
            {
                TotalRecord = collection[0].TotalRecord;
            }
            return(Json(new DataTablesResponse(requestModel.Draw, collection, TotalRecord, TotalRecord), JsonRequestBehavior.AllowGet));
        }
Esempio n. 5
0
 // GET api/<controller>
 /// <summary>
 /// Gets this instance.
 /// </summary>
 /// <returns></returns>
 public QueuedEmailCollection Post(string method, [FromBody] SearchFilter value)
 {
     return(QueuedEmailManager.Search(value));
 }