public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; string table = context.Request.Form["table"]; string ips = context.Request.Form["ips"]; int tableId = int.Parse(context.Request.Form["tableId"]); string key = context.Request["key"]; BrandsMktgBooksEntities db = new BrandsMktgBooksEntities(); string success = ""; switch (table) { case "cms_user": cms_user user = db.cms_user.Where(x => x.id == tableId).SingleOrDefault(); db.cms_user.Remove(user); success = "success"; break; case "cms_groups": cms_groups group = db.cms_groups.Where(x => x.id == tableId).SingleOrDefault(); db.cms_groups.Remove(group); success = "success"; break; case "Slides": BookSlide slide = db.BookSlides.Where(x => x.id == tableId).SingleOrDefault(); db.BookSlides.Remove(slide); success = "success"; try { File.Delete(context.Server.MapPath("~/Media/" + slide.img)); } catch { } break; case "BookUnites": BookUnite bunite = db.BookUnites.Where(x => x.id == tableId).SingleOrDefault(); db.BookUnites.Remove(bunite); success = "success"; break; case "BookUniteFiles": BookUniteFile unitefile = db.BookUniteFiles.Where(x => x.id == tableId).SingleOrDefault(); db.BookUniteFiles.Remove(unitefile); success = "success"; break; case "Books": Book b = db.Books.Where(x => x.id == tableId).SingleOrDefault(); db.Books.Remove(b); success = "success"; try { File.Delete(context.Server.MapPath("~/Media/" + b.thumb)); File.Delete(context.Server.MapPath("~/Media/" + b.pdf)); } catch { } break; case "Levels": BooksLevel level = db.BooksLevels.Where(x => x.id == tableId).SingleOrDefault(); db.BooksLevels.Remove(level); success = "success"; break; case "BooksCategories": Category cat = db.Categories.Where(x => x.id == tableId).SingleOrDefault(); db.Categories.Remove(cat); success = "success"; break; case "Schools": School school = db.Schools.Where(x => x.id == tableId).SingleOrDefault(); db.Schools.Remove(school); success = "success"; try { File.Delete(context.Server.MapPath("~/Media/" + school.thumb)); } catch { } break; case "Posters": BookPoster game = db.BookPosters.Where(x => x.id == tableId).SingleOrDefault(); db.BookPosters.Remove(game); try { Directory.Delete(context.Server.MapPath("~/Media/Games/" + game.bookId + "/" + game.InteractiveFile)); File.Delete(context.Server.MapPath("~/Media/" + game.thumb)); } catch { } success = "success"; break; case "Stories": BookStory story = db.BookStories.Where(x => x.id == tableId).SingleOrDefault(); db.BookStories.Remove(story); try { Directory.Delete(context.Server.MapPath("~/Media/Games/" + story.bookId + "/" + story.InteractiveFile)); File.Delete(context.Server.MapPath("~/Media/" + story.thumb)); File.Delete(context.Server.MapPath("~/Media/" + story.pdf)); } catch { } success = "success"; break; case "IPs": AllowIP(ips); break; case "Sessions": SessionUser.Remove(key); break; } db.SaveChanges(); context.Response.Write(success); }
void asyncUpdate() { BookSlide activeSlide = GameObject.Find(GameObject.Find("Init").GetComponent <LoadBooks>().activeSlide.name).GetComponent <BookSlide>(); LoadBooks library = GameObject.Find("Init").GetComponent <LoadBooks>(); if (frameListener.twoFingerSwipe) { if (frameListener.indexTipVelocityX < -500) { gestureCooldown = 1.5f; Debug.Log("TwoFingerSwipe"); if (activeSlide.activeBook.GetComponent <Book>().detailView) { activeSlide.hideDetails(); GetComponent <UIControl>().hideUI(); GetComponent <UIControl>().sceneControl.GetComponent <SceneControl>().defaultLightSetup(); } activeSlide.instantNextBook(); audioSourceA.GetComponent <AudioSource>().Play(); } else if (frameListener.indexTipVelocityX > 500) { gestureCooldown = 1.5f; if (activeSlide.activeBook.GetComponent <Book>().detailView) { activeSlide.hideDetails(); GetComponent <UIControl>().hideUI(); GetComponent <UIControl>().sceneControl.GetComponent <SceneControl>().defaultLightSetup(); } activeSlide.instantPrevBook(); audioSourceA.GetComponent <AudioSource>().Play(); } else if (frameListener.indexTipVelocityZ > 500) { if (activeSlide.activeBook.GetComponent <Book>().detailView) { activeSlide.hideDetails(); GetComponent <UIControl>().hideUI(); GetComponent <UIControl>().sceneControl.GetComponent <SceneControl>().defaultLightSetup(); } gestureCooldown = 1.5f; library.nextSlide(); audioSourceB.GetComponent <AudioSource>().Play(); } else if (frameListener.indexTipVelocityZ < -500 && frameListener.indexTipVelocityX < 300 && frameListener.indexTipVelocityX > -300) { if (activeSlide.activeBook.GetComponent <Book>().detailView) { activeSlide.hideDetails(); GetComponent <UIControl>().hideUI(); GetComponent <UIControl>().sceneControl.GetComponent <SceneControl>().defaultLightSetup(); } gestureCooldown = 1.5f; library.prevSlide(); audioSourceB.GetComponent <AudioSource>().Play(); } } else if (frameListener.LRotation) { if (!activeSlide.activeBook.GetComponent <Book>().detailView) { GetComponent <UIControl>().showUI(); GetComponent <UIControl>().sceneControl.GetComponent <SceneControl>().detailViewLightSetup(); GameObject.Find(GameObject.Find("Init").GetComponent <LoadBooks>().activeSlide.name).GetComponent <BookSlide>().showDetails(); audioSourceC.GetComponent <AudioSource>().Play(); } } }