예제 #1
0
        public ActionResult Destroy(long id)
        {
            var item = GetSession.Get <Job>(id);

            GetSession.Delete(item);
            return(RedirectToAction("Index"));
        }
        public ActionResult Destroy(Guid id)
        {
            var item = GetSession.Get <Gallery>(id);

            GetSession.Delete(item);
            return(RedirectToAction("Index"));
        }
예제 #3
0
        public ActionResult DestroyMessage(long id, long categoryId)
        {
            var item = GetSession.Get <Forum>(id);

            GetSession.Delete(item);
            return(RedirectToAction("List", new { categoryId }));
        }
예제 #4
0
        public ActionResult Destroy(long id)
        {
            var item = GetSession.Get <PollItem>(id);

            GetSession.Delete(item);

            return(RedirectToAction("Edit", "Polls", new { id = item.Poll.Id }));
        }
        public ActionResult Destroy(long id)
        {
            var item = GetSession.Get <FlashBanner>(id);

            GetSession.Delete(item);

            DeleteFile("flashBanners", item.Banner);

            return(RedirectToAction("Index"));
        }
예제 #6
0
        public ActionResult DeletePhoto(long id)
        {
            var item = GetSession.Get <EmployeePhoto>(id);

            if (item != null && item.Employee.Id == GetEmployeeId)
            {
                GetSession.Delete(item);
            }

            return(RedirectToAction("Card", new { Id = GetEmployeeId }));
        }
예제 #7
0
        public ContentResult DeleteMessage(long id)
        {
            var item = GetSession.Get <EmployeeMessage>(id);

            if (item.CreatedBy == new Employee {
                Id = GetEmployeeId
            })
            {
                GetSession.Delete(item);
                return(Content("ok"));
            }

            return(Content("not owner"));
        }
예제 #8
0
        public ActionResult Destroy(long id)
        {
            var item = GetSession.Get <Page>(id);

            if (item == null)
            {
                return(Content(string.Format("tried to delete page: {0} but it does not exists", id)));
            }

            long?parentId = (item.Parent == null ? (long?)null : item.Parent.Id);

            GetSession.Delete(item);
            return(RedirectToAction("Index", new { parentId, item.SectionId }));
        }
예제 #9
0
        public ActionResult Delete(long id)
        {
            var item = GetSession.Get <ForumItem>(id);

            GetSession.Delete(item);


            var forumPosts = GetSession.QueryOver <Forum>().Where(x => x.CategoryId == id).List();

            foreach (var post in forumPosts)
            {
                GetSession.Delete(post);
            }


            return(RedirectToActionPermanent("Index"));
        }
예제 #10
0
        public ContentResult Destory(long id)
        {
            var item  = GetSession.Get <Forum>(id);
            var forum = GetSession.Get <ForumItem>(Convert.ToInt64(item.CategoryId));

            string currentUser_email = Request.Cookies["user"].Value.ToString();


            if (forum.Admin.Email == currentUser_email)
            {
                GetSession.Delete(item);
                string js = @"alert('ההודעה נמחקה בהצלחה!')";
                return(Content("111"));
            }
            else
            {
                string js = @"alert('אין הרשאות לבציע את הפעולה,פנה למנהל הפורום')";
                return(Content("2222"));
            }
        }