Exemplo n.º 1
0
        private void ExportJson(string slideshowid)
        {
            ClientSlideShowClient slideshowclient = new ClientSlideShowClient();
            ClientSlideShow       show            = slideshowclient.GetByRowKey(slideshowid);

            ClientSlideShowSlideClient slides = new ClientSlideShowSlideClient();

            List <object> arrayofslides = new List <object>();

            foreach (ClientSlideShowSlide slide in slides.GetAllByPartition(slideshowid).OrderByDescending(x => x.Priority))
            {
                arrayofslides.Add(new
                {
                    id      = slide.RowKey,
                    caption = slide.Caption.ToJSONSafeString()
                });
            }

            string json = (new { id = slideshowid, slides = arrayofslides.ToArray() }).ToJSON();

            BlobJsonResourceManager.Instance.SaveJsonResource("slideshow", "clientslideshows", show.ClientType, show.ClientId.Replace(" ", ""), json);
        }
Exemplo n.º 2
0
        public ActionResult Delete(string id, FormCollection collection)
        {
            try
            {
                ClientSlideShowClient dscc = new ClientSlideShowClient();
                ClientSlideShow       show = dscc.GetByRowKey(id);

                ClientSlideShowSlideClient slides = new ClientSlideShowSlideClient();
                foreach (ClientSlideShowSlide slide in slides.GetAllByPartition(show.RowKey))
                {
                    PictureManager.Instance.DeletePicture(slide.RowKey, "slideshows", show.RowKey);
                    slides.Delete(slide);
                }

                dscc.Delete(show);

                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }
Exemplo n.º 3
0
        //
        // GET: /DirectSchoolClients/Edit/5

        public ActionResult Edit(string id)
        {
            ClientSlideShowClient dscc = new ClientSlideShowClient();

            return(View(dscc.GetByRowKey(id)));
        }