public ActionResult <ServiceResponse <Recipe> > GetByParent(long parentId, [FromQuery] Pagination paginate = null, string token = "") { try { paginate = (paginate == null || paginate.PageSize <= 0) ? new Pagination() : paginate; paginate.RowCount = PDKBusinessLogic.GetCount(); return(GenerateResponse(paginate, PDKBusinessLogic.GetByParentId(parentId, pageSize: paginate.PageSize, page: paginate.PageNumber))); } catch (Exception e) { return(GenerateExceptionResponse(e, "Exception!")); } }
public override ActionResult <ServiceResponse <SalePoint> > Get([FromQuery] Pagination paginate = null, string token = "") { try { paginate = (paginate == null || paginate.PageSize <= 0) ? new Pagination() : paginate; paginate.RowCount = PDKBusinessLogic.GetCount(); return(GenerateResponse(paginate, PDKBusinessLogic.Get(/*s => s.Name.Contains(paginate.SearchKey),*/ pageSize: paginate.PageSize, page: paginate.PageNumber))); } catch (Exception e) { return(GenerateExceptionResponse(e, "Exception!")); } }
public ActionResult <ServiceResponse <IncommingUser> > AddIncommingUser([FromBody] IEnumerable <IncommingUser> users) { try { IEnumerable <IncommingUser> exists = PDKBusinessLogic.Get(); if ((users == null) || (users?.Count() == 0)) { return(null); } return(GenerateResponse(null, PDKBusinessLogic.AddRange(users.ToList().Except(exists)))); } catch (Exception e) { return(GenerateExceptionResponse(e, "Exception!")); } }
public ActionResult <string> GetData() { var message = ""; var state = BusinessEntity.Models.Base.Enums.ObjectState.Active; try { (PDKBusinessLogic as DataImportLogic).GetData(); message = "Getting data has been completed."; } catch (Exception ex) { state = BusinessEntity.Models.Base.Enums.ObjectState.Passive; message = "Fail to Get Data!" + Environment.NewLine + ex.Message; } PDKBusinessLogic.Add(new DataImport { ImportTime = DateTime.Now, State = state }); return(message); }