public object Get(DataSourceLoadOptions loadOptions) { try { var uvoznici = UvoznikDAO.GetAllImporters(); return(DataSourceLoader.Load(uvoznici, loadOptions)); } catch (Exception) { return(DataSourceLoader.Load(new List <UvoznikModel>(), loadOptions)); } }
public object GetImporters(DataSourceLoadOptions loadOptions) { var uvoznici = new List <UvoznikModel>(); try { uvoznici = UvoznikDAO.GetAllImporters(); var item = uvoznici.SingleOrDefault(x => x.AutoID == HttpContext.Session.GetObjectFromJson <KorisnikModel>("LogovaniKorisnik").Uvoznik.AutoID); if (item != null) { uvoznici.Remove(item); } } catch (Exception) { } return(DataSourceLoader.Load(uvoznici, loadOptions)); }