public string AddCategory(Cog.MLIAD.BusinessLogic.Associate.Category category) { try { MLIADService.SetNoCache(); return(repository.AddCategory(category)); } catch (Exception ex) { throw ex; } }
public string DeleteCategory(Cog.MLIAD.BusinessLogic.Associate.Category category) { try { MLIADService.SetNoCache(); string retval = "failure"; retval = repository.DeleteCategory(category.id); return(retval); } catch (Exception ex) { throw ex; } }
public Pager <Cog.MLIAD.BusinessLogic.Associate.Category> SearchCategory(Cog.MLIAD.BusinessLogic.Associate.Category search, string page, string row, string totalcount) { try { int?count = 0; int pageIndex = Convert.ToInt32(page); int pageSize = Convert.ToInt32(row); Pager <Cog.MLIAD.BusinessLogic.Associate.Category> pager = new Pager <Cog.MLIAD.BusinessLogic.Associate.Category>(); MLIADService.SetNoCache(); List <Cog.MLIAD.BusinessLogic.Associate.Category> categories = repository.SearchCategory(search, (pageIndex - 1), pageSize, ref count); pager.Items = categories; pager.Page = pageIndex; pager.ItemCount = (count == null) ? 0 : Convert.ToInt32(count); pager.PageTotal = ((pager.ItemCount + pageSize - 1) / pageSize); pager.PageSize = pageSize; return(pager); } catch (Exception ex) { throw ex; } }