Beispiel #1
0
        public ActionResult Update(Models.Item item)
        {
            Data.Item persistentItem = Mapper.Map <Models.Item, Data.Item>(item);
            Itemizing.Update(persistentItem);

            return(Content(JsonConvert.SerializeObject(Mapper.Map <Data.Item, Models.Item>(persistentItem))));
        }
Beispiel #2
0
        public void TestFilter()
        {
            //List<Data.Item> items;
            //string f = "tre";

            //using (Librarian.Data.LibraryDataContext ctx = new Data.LibraryDataContext())
            //    items = ctx.Items
            //        .Include(i => i.Authors)
            //        .Include(i => i.Editions.Select(ed => ed.Copies))
            //        .Include(i => i.ItemSubjects)
            //        .Include(i => i.Reserves)
            //        .Where(i => !i.Deleted).Where(i => i.Title.Contains(f))
            //        .OrderBy(i => i.Title)
            //        .Skip(0).Take(20)
            //        .ToList();

            //    int t;
            Itemizing.GetAllItems("chinuch", 20, 0);
        }
Beispiel #3
0
 public ActionResult Single(long id)
 {
     return(Content(JsonConvert.SerializeObject(Mapper.Map <Data.Item, Models.Item>(Itemizing.GetItem(id)))));
 }
Beispiel #4
0
 public ActionResult IndexData(int pageNum, int pageSize, string filter)
 {
     return(Content(JsonConvert.SerializeObject(new
     {
         items = Mapper.Map <IEnumerable <Data.Item>, IEnumerable <Models.Item> >(Itemizing.GetAllItems(filter, pageSize, pageNum)),
         pageNum = pageNum
     })));
 }