Beispiel #1
0
        protected void ButtonSave_Click(object sender, EventArgs e)
        {
            using (var context = new NoticeboardEntities())
            {
                var userId = this.Request.Params["userId"];

                try
                {
                    var user = context.AspNetUsers.Find(userId);
                    user.UserName = this.TextBoxUsername.Text;

                    var adminRole = context.AspNetRoles.FirstOrDefault(r => r.Name == "admin");
                    if (this.CheckBoxIsAdmin.Checked && user.AspNetRoles.FirstOrDefault(r => r.Name == "admin") == null)
                    {
                        user.AspNetRoles.Add(adminRole);
                    }
                    else if (!this.CheckBoxIsAdmin.Checked && user.AspNetRoles.FirstOrDefault(r => r.Name == "admin") != null)
                    {
                        user.AspNetRoles.Remove(adminRole);
                    }

                    context.SaveChanges();

                    ErrorSuccessNotifier.AddInfoMessage("User successfully edited.");
                    ErrorSuccessNotifier.ShowAfterRedirect = true;
                    this.Response.Redirect("Users.aspx", false);
                }
                catch (Exception ex)
                {
                    ErrorSuccessNotifier.AddErrorMessage(ex);
                }
            }
        }
Beispiel #2
0
        protected void LinkButtonUpdate_Command(object sender, CommandEventArgs e)
        {
            try
            {
                int channelId = Convert.ToInt32(e.CommandArgument);

                TwitterEntities context = new TwitterEntities();

                var channel = context.Channels.FirstOrDefault(x => x.ChannelId == channelId);
                var button  = sender as LinkButton;

                var tr = button.Parent.Parent;

                var textBox = tr.FindControl("TextBoxEditChannel") as TextBox;

                string newChannelName = textBox.Text;
                Verificator.ValidateChannel(newChannelName);
                channel.Name = newChannelName;
                context.SaveChanges();
                ErrorSuccessNotifier.AddInfoMessage("Channel name updated successfully.");
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
        protected void Page_PreRender(object sender, EventArgs e)
        {
            var id = Request.Params["id"];

            if (!String.IsNullOrEmpty(id))
            {
                int groupId = int.Parse(id);
                ApplicationDbContext context = new ApplicationDbContext();

                Group selectedGroup = null;
                try
                {
                    selectedGroup = context.Groups.FirstOrDefault(g => g.GroupId == groupId);
                }
                catch (Exception ex)
                {
                    ErrorSuccessNotifier.AddErrorMessage(ex);
                }

                if (selectedGroup.Creator == User.Identity.Name || User.IsInRole("Admin"))
                {
                    this.TextBoxUpdatedGroupTitle.Text = selectedGroup.Title;
                }
                else
                {
                    ErrorSuccessNotifier.AddInfoMessage("You have no success!");
                    Response.Redirect("~/Groups");
                }
            }
        }
Beispiel #4
0
        // The id parameter name should match the DataKeyNames value set on the control
        public void ListViewComments_DeleteItem(int?CommentId)
        {
            var db = new StichtiteForumEntities();

            if (!this.User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/Account/Login.aspx");
            }
            else if (!(this.User.Identity.Name == db.Comments.Find(CommentId).AspNetUser.UserName))
            {
                ErrorSuccessNotifier.AddInfoMessage("You don't have permission to delete this comment");
                Response.Redirect("Post.aspx?id=" + this.postId);
            }

            try
            {
                var comment = db.Comments.Find(CommentId);
                db.Comments.Remove(comment);
                db.SaveChanges();
                ErrorSuccessNotifier.AddSuccessMessage("Comment succesfully deleted");
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex.Message);
            }
        }
Beispiel #5
0
        public void FormViewPost_DeleteItem(int?PostId)
        {
            try
            {
                var db = new StichtiteForumEntities();
                if (!this.User.Identity.IsAuthenticated)
                {
                    Response.Redirect("~/Account/Login.aspx");
                }
                else if (!(this.User.Identity.Name == db.Posts.Find(this.postId).AspNetUser.UserName))
                {
                    ErrorSuccessNotifier.AddInfoMessage("You don't have permission to delete this post");
                    //Response.Redirect("Post.aspx?id=" + this.postId);
                    return;
                }
                var post = db.Posts.Find(this.postId);
                db.Comments.RemoveRange(post.Comments);
                db.Posts.Remove(post);
                db.SaveChanges();
                ErrorSuccessNotifier.AddSuccessMessage("Post successfully deleted");
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }

            Response.Redirect("Default.aspx");
        }
Beispiel #6
0
        protected void MainContent_LinkButtonEditSave_Click(object sender, EventArgs e)
        {
            try
            {
                ApplicationDbContext context = new ApplicationDbContext();
                int id           = int.Parse(this.TextBoxBookEditId.Text);
                var selectedItem = context.Books.Find(id);
                selectedItem.Title   = this.TextBoxBookEditTitle.Text;
                selectedItem.Content = this.TextBoxBookEditContent.Text;
                selectedItem.ISBN    = this.TextBoxBookEditISBN.Text;
                selectedItem.Author  = this.TextBoxBookEditAuthor.Text;
                selectedItem.Website = this.TextBoxBookEditWebsite.Text;
                int selectedCategoryId = int.Parse(this.DropDownListBooksEdit.SelectedValue);
                var selectedCategory   = context.Categories.Find(selectedCategoryId);
                selectedItem.Category = selectedCategory;
                context.SaveChanges();

                this.GridViewBooks.DataBind();

                ErrorSuccessNotifier.AddInfoMessage("You have successfully edited book to " + TextBoxBookEditTitle.Text);

                this.MainContent_PanelEdit.Visible = false;
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
Beispiel #7
0
        protected void MainContent_LinkButtonCreate_Click(object sender, EventArgs e)
        {
            try
            {
                ApplicationDbContext context = new ApplicationDbContext();
                var selectedCategroyId       = int.Parse(this.DropDownListCategories.SelectedValue);
                var selectedCategory         = context.Categories.Find(selectedCategroyId);

                var newBook = new Book()
                {
                    Title    = this.MainContent_TextBoxBookTitleCreate.Text,
                    Author   = this.MainContent_TextBoxBookAuthor.Text,
                    Content  = this.MainContent_TextBoxBookContent.Text,
                    Website  = this.MainContent_TextBoxBookWebsite.Text,
                    ISBN     = this.MainContent_TextBoxBookISBN.Text,
                    Category = selectedCategory
                };

                context.Books.Add(newBook);
                context.SaveChanges();

                this.GridViewBooks.DataBind();

                this.MainContent_PanelCreate.Visible = false;

                ErrorSuccessNotifier.AddInfoMessage("You have successfully created book with title: " + newBook.Title);
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
        // The id parameter name should match the DataKeyNames value set on the control
        public void ListViewAllUsers_UpdateItem(string Id)
        {
            TwitterEntities context = new TwitterEntities();

            Twitter.Models.AspNetUser item = null;
            // Load the item here, e.g. item = MyDataLayer.Find(id);
            item = context.AspNetUsers.Find(Id);
            if (item == null)
            {
                // The item wasn't found
                ModelState.AddModelError("", String.Format("Item with id {0} was not found", Id));
                return;
            }
            TryUpdateModel(item);
            if (ModelState.IsValid)
            {
                try
                {
                    context.SaveChanges();
                    ErrorSuccessNotifier.AddInfoMessage("User has been successfully edited");
                }
                catch (Exception ex)
                {
                    ErrorSuccessNotifier.AddErrorMessage(ex.Message);
                }

                // Save changes here, e.g. MyDataLayer.SaveChanges();
            }
        }
Beispiel #9
0
        public void GridViewUsers_DeleteCategory(int categoryId)
        {
            using (var context = new StichtiteForumEntities())
            {
                try
                {
                    var category = context.Categories.Find(categoryId);

                    foreach (var post in category.Posts)
                    {
                        context.Comments.RemoveRange(post.Comments);
                    }

                    context.Posts.RemoveRange(category.Posts);
                    context.Categories.Remove(category);

                    context.SaveChanges();

                    this.GridViewCategories.PageIndex = 0;
                    ErrorSuccessNotifier.AddInfoMessage("Category successfully deleted.");
                }
                catch (Exception ex)
                {
                    ErrorSuccessNotifier.AddErrorMessage(ex);
                }
            }
        }
Beispiel #10
0
        public void GridViewLectures_DeleteItem(int id)
        {
            var context = new AcademyDbContext();

            Forum.Models.Lecture item = context.Lectures.Find(id);
            if (item == null)
            {
                ModelState.AddModelError("", String.Format("Item with id {0} was not found", id));
                ErrorSuccessNotifier.AddErrorMessage("The lecture was not found.");
                return;
            }

            try
            {
                context.Lectures.Remove(item);
                context.SaveChanges();

                this.GridViewLectures.SelectMethod = "GridViewLectures_GetData";
                this.GridViewLectures.DataBind();
                ErrorSuccessNotifier.AddInfoMessage("Lecture deleted successfully.");
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex.Message);
            }
        }
Beispiel #11
0
        // The id parameter name should match the DataKeyNames value set on the control
        public void GridViewMyChannels_DeleteItem(int ChannelId)
        {
            try
            {
                int channelId = ChannelId;

                TwitterEntities context = new TwitterEntities();

                var channel = context.Channels.Include("Messages").FirstOrDefault(x => x.ChannelId == channelId);

                string currentUsername = User.Identity.Name;
                if (channel.AspNetUser.UserName != currentUsername)
                {
                    throw new Exception("Different owner of the channel.");
                }

                var messages = channel.Messages;

                context.Messages.RemoveRange(messages);
                context.Channels.Remove(channel);
                context.SaveChanges();
                ErrorSuccessNotifier.AddInfoMessage("Channel successfully removed.");
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
            //Response.Redirect(Request.RawUrl);
        }
Beispiel #12
0
        // The id parameter name should match the DataKeyNames value set on the control
        public void GridViewMyChannels_UpdateItem(int ChannelId)
        {
            TwitterEntities context = new TwitterEntities();

            Twitter.Models.Channel item = null;
            // Load the item here, e.g. item = MyDataLayer.Find(id);
            item = context.Channels.Find(ChannelId);
            if (item == null)
            {
                // The item wasn't found
                ModelState.AddModelError("", String.Format("Item with id {0} was not found", ChannelId));
                return;
            }
            TryUpdateModel(item);
            if (ModelState.IsValid)
            {
                try
                {
                    Verificator.ValidateChannel(item.Name);
                    context.SaveChanges();
                    ErrorSuccessNotifier.AddInfoMessage("Channel updated successfully");
                }
                catch (Exception ex)
                {
                    ErrorSuccessNotifier.AddErrorMessage(ex.Message);
                }
                // Save changes here, e.g. MyDataLayer.SaveChanges();
            }
        }
Beispiel #13
0
        public void FormViewPost_DeleteItem(int?PostId)
        {
            try
            {
                var db = new NoticeboardEntities();
                if (!this.User.Identity.IsAuthenticated)
                {
                    this.Response.Redirect("~/Account/Login.aspx");
                }
                else if (this.User.IsInRole("admin"))
                {
                    var post = db.Posts.Find(this.postId);
                    db.Comments.RemoveRange(post.Comments);
                    db.Posts.Remove(post);
                    db.SaveChanges();
                    ErrorSuccessNotifier.AddSuccessMessage("Post successfully deleted");
                }
                else
                {
                    ErrorSuccessNotifier.AddInfoMessage("You don't have permission to delete this post");
                    return;
                }
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }

            this.Response.Redirect("Default.aspx");
        }
Beispiel #14
0
        protected void ButtonEditPost_Command(object sender, CommandEventArgs e)
        {
            var db = new StichtiteForumEntities();

            if (!this.User.Identity.IsAuthenticated)
            {
                Response.Redirect("~/Account/Login.aspx");
            }
            else if (!(this.User.Identity.Name == db.Posts.Find(this.postId).AspNetUser.UserName))
            {
                ErrorSuccessNotifier.AddInfoMessage("You don't have permission to edit this post");
                Response.Redirect("Post.aspx?id=" + this.postId);
            }
            Response.Redirect("EditPost.aspx?id=" + this.postId);
        }
Beispiel #15
0
        protected void ButtonEditComment_Command(object sender, CommandEventArgs e)
        {
            var db        = new NoticeboardEntities();
            var commentId = Convert.ToInt32(e.CommandArgument);

            if (!this.User.Identity.IsAuthenticated)
            {
                this.Response.Redirect("~/Account/Login.aspx");
            }
            else if (this.User.Identity.Name != db.Comments.Find(commentId).AspNetUser.UserName)
            {
                ErrorSuccessNotifier.AddInfoMessage("You don't have permission to edit this comment");
                this.Response.Redirect("Post.aspx?id=" + this.postId);
            }
        }
Beispiel #16
0
        // The id parameter name should match the DataKeyNames value set on the control
        public void GridViewMyMessages_DeleteItem(int MessageId)
        {
            try
            {
                TwitterEntities context = new TwitterEntities();

                var message = context.Messages.FirstOrDefault(x => x.MessageId == MessageId);
                context.Messages.Remove(message);
                context.SaveChanges();
                ErrorSuccessNotifier.AddInfoMessage("Message has been deleted successfully");
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
Beispiel #17
0
        // The id parameter name should match the DataKeyNames value set on the control
        public void GridViewCategories_DeleteItem(int id)
        {
            BookLibraryEntities db = new BookLibraryEntities();
            Book book = db.Books.FirstOrDefault(c => c.Id == id);

            try
            {
                db.Books.Remove(book);
                db.SaveChanges();
                this.GridViewBooks.PageIndex = 0;
                ErrorSuccessNotifier.AddInfoMessage("Book successfully deleted!");
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
 public void GridViewComments_DeleteComment(int commentId)
 {
     using (var context = new StichtiteForumEntities())
     {
         try
         {
             var comment = context.Comments.Find(commentId);
             context.Comments.Remove(comment);
             context.SaveChanges();
             this.GridViewComments.PageIndex = 0;
             ErrorSuccessNotifier.AddInfoMessage("Comment successfully deleted.");
         }
         catch (Exception ex)
         {
             ErrorSuccessNotifier.AddErrorMessage(ex);
         }
     }
 }
Beispiel #19
0
        protected void LinkButtonCreateOrEdit_Click(object sender, EventArgs e)
        {
            Book book;
            int  bookId            = 0;
            BookLibraryEntities db = new BookLibraryEntities();

            if (!String.IsNullOrEmpty(this.LabelBookId.Text))
            {
                bookId = Convert.ToInt32(this.LabelBookId.Text);
                book   = db.Books.FirstOrDefault(c => c.Id == bookId);
            }
            else
            {
                book = new Book();
                db.Books.Add(book);
            }

            try
            {
                if (String.IsNullOrEmpty(this.TextBoxTitle.Text))
                {
                    throw new ArgumentException("Title must be filled!");
                }
                if (String.IsNullOrEmpty(this.TextBoxAuthors.Text))
                {
                    throw new ArgumentException("Author must be filled!");
                }

                book.Title       = this.TextBoxTitle.Text;
                book.Author      = this.TextBoxAuthors.Text;
                book.ISBN        = this.TextBoxISBN.Text;
                book.Website     = this.TextBoxWebsite.Text;
                book.Description = this.TextBoxDescription.Text;
                book.CategoryId  = Convert.ToInt32(this.DropDownListCategories.SelectedItem.Value);
                db.SaveChanges();
                ErrorSuccessNotifier.AddInfoMessage("Book successfully " + (bookId == 0 ? "created!" : "edited!"));
                ErrorSuccessNotifier.ShowAfterRedirect = true;
                Response.Redirect("EditBooks.aspx", false);
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
        // The id parameter name should match the DataKeyNames value set on the control
        public void GridViewQuestions_DeleteItem(int questionId)
        {
            var      context  = new PollSystemEntities();
            Question question = context.Questions.Include("Answers")
                                .FirstOrDefault(q => q.QuestionId == questionId);

            try
            {
                context.Answers.RemoveRange(question.Answers);
                context.Questions.Remove(question);
                context.SaveChanges();
                this.GridViewQuestions.PageIndex = 0;
                ErrorSuccessNotifier.AddInfoMessage("Question deleted.");
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
Beispiel #21
0
        public void GridViewUsers_BanUser(string userId)
        {
            using (var context = new NoticeboardEntities())
            {
                try
                {
                    var user = context.AspNetUsers.Find(userId);
                    //user.Banned = true;
                    context.SaveChanges();

                    this.GridViewUsers.PageIndex = 0;
                    ErrorSuccessNotifier.AddInfoMessage("User successfully deleted.");
                }
                catch (Exception ex)
                {
                    ErrorSuccessNotifier.AddErrorMessage(ex);
                }
            }
        }
Beispiel #22
0
        protected void OnBtnVote_Command(object sender, CommandEventArgs e)
        {
            var dbContext = new PollSystemEntities();
            int answerId  = Convert.ToInt32(e.CommandArgument);

            var answer = dbContext.Answers.Find(answerId);

            if (answer != null)
            {
                answer.Votes++;
                dbContext.SaveChanges();

                ErrorSuccessNotifier.AddInfoMessage("You voted for " + answer.Text);
                Response.Redirect("~/VotingResults.aspx?questionId=" + answer.QuestionId);
            }
            else
            {
                ErrorSuccessNotifier.AddErrorMessage("This answer does not exist anymore");
            }
        }
Beispiel #23
0
        protected void MainContent_LinkButtonConfirmDelete_Click(object sender, EventArgs e)
        {
            try
            {
                int selectedBookId           = int.Parse(this.TextBoxDeleteBookId.Text);
                ApplicationDbContext context = new ApplicationDbContext();
                var selectedBook             = context.Books.Find(selectedBookId);
                context.Books.Remove(selectedBook);
                context.SaveChanges();
                this.GridViewBooks.DataBind();

                this.MainContent_PanelDelete.Visible = false;

                ErrorSuccessNotifier.AddInfoMessage("You have successfully deleted book with title: " + selectedBook.Title);
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
Beispiel #24
0
        protected void MainContent_LinkButtonEditSave_Click(object sender, EventArgs e)
        {
            try
            {
                ApplicationDbContext context = new ApplicationDbContext();
                int id           = int.Parse(this.TextBoxCategoryEditId.Text);
                var selectedItem = context.Categories.Find(id);
                selectedItem.Name = this.TextBoxCategoryEdit.Text;
                context.SaveChanges();
                this.GridViewCategories.DataBind();

                ErrorSuccessNotifier.AddInfoMessage("You have successfully edited category to: " + TextBoxCategoryEdit.Text);

                this.TextBoxCategoryEditId.Text    = "";
                this.TextBoxCategoryEdit.Text      = "";
                this.MainContent_PanelEdit.Visible = false;
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }
Beispiel #25
0
        protected void ButtonSave_Click(object sender, EventArgs e)
        {
            using (var context = new StichtiteForumEntities())
            {
                var commentId = Convert.ToInt32(this.Request.Params["commentId"]);

                try
                {
                    var comment = context.Comments.Find(commentId);
                    comment.Content = this.TextBoxCommentContent.Text;
                    context.SaveChanges();

                    ErrorSuccessNotifier.AddInfoMessage("Comment successfully edited.");
                    ErrorSuccessNotifier.ShowAfterRedirect = true;
                    this.Response.Redirect("Comments.aspx?postId=" + comment.PostId, false);
                }
                catch (Exception ex)
                {
                    ErrorSuccessNotifier.AddErrorMessage(ex);
                }
            }
        }
        protected void ButtonSave_Click(object sender, EventArgs e)
        {
            using (var context = new NoticeboardEntities())
            {
                var categoryId = Convert.ToInt32(this.Request.Params["categoryId"]);

                try
                {
                    var category = context.Categories.Find(categoryId);
                    category.Title = this.TextBoxCategoryTitle.Text;
                    context.SaveChanges();

                    ErrorSuccessNotifier.AddInfoMessage("Category successfully edited.");
                    ErrorSuccessNotifier.ShowAfterRedirect = true;
                    this.Response.Redirect("Categories.aspx", false);
                }
                catch (Exception ex)
                {
                    ErrorSuccessNotifier.AddErrorMessage(ex);
                }
            }
        }
Beispiel #27
0
        public void GridViewLectures_UpdateItem(int id)
        {
            var context = new AcademyDbContext();

            Forum.Models.Lecture item = context.Lectures.Find(id);
            if (item == null)
            {
                ModelState.AddModelError("", String.Format("Item with id {0} was not found", id));
                return;
            }

            TryUpdateModel(item);
            if (ModelState.IsValid)
            {
                context.SaveChanges();
                ErrorSuccessNotifier.AddInfoMessage("Lecture updated successfully.");
            }
            else
            {
                ErrorSuccessNotifier.AddErrorMessage("There was an error updating the lecture. Please try again.");
            }
        }
Beispiel #28
0
        protected void GridViewCourses_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            int id             = (int)e.Keys["Id"];
            var context        = new AcademyDbContext();
            var existingCourse = context.Courses.FirstOrDefault(c => c.Id == id);
            var lectures       = existingCourse.Lectures.ToList();

            foreach (var lecture in lectures)
            {
                context.Homeworks.RemoveRange(lecture.Homeworks);
                context.Lectures.Remove(lecture);
            }

            context.SaveChanges();

            context.Courses.Remove(existingCourse);
            context.SaveChanges();

            e.Cancel = true;
            (sender as GridView).DataBind();

            ErrorSuccessNotifier.AddInfoMessage("Course successfully deleted.");
        }
Beispiel #29
0
        protected void ButtonBAN_Click(object sender, EventArgs e)
        {
            var context = new ApplicationDbContext();
            var user    = context.Users.Find(userId);
            var manager = new AuthenticationIdentityManager(new IdentityStore(new ApplicationDbContext()));

            if (user.Roles.Count == 0 || user.Roles.First().Role.Name == "Admin")
            {
                var roleId = "2";
                manager.Roles.AddUserToRoleAsync(userId, roleId);
                ErrorSuccessNotifier.AddInfoMessage("The User has been banned!");
                this.ButtonBAN.Text          = "Unban User";
                this.ButtonBAN.OnClientClick = "return confirm('Do you want to Unban user ?');";
            }
            else
            {
                var roleId = user.Roles.First().RoleId;
                manager.Roles.RemoveUserFromRoleAsync(userId, roleId);
                ErrorSuccessNotifier.AddInfoMessage("The User has been unbanned!");
                this.ButtonBAN.Text          = "Ban User";
                this.ButtonBAN.OnClientClick = "return confirm('Do you want to Ban user ?');";
            }
        }
Beispiel #30
0
        protected void MainContent_LinkButtonConfirmDelete_Click(object sender, EventArgs e)
        {
            try
            {
                int selectedCategoryId       = int.Parse(this.TextBoxDeleteItemid.Text);
                ApplicationDbContext context = new ApplicationDbContext();
                var selectedCaregory         = context.Categories.Find(selectedCategoryId);
                context.Books.RemoveRange(selectedCaregory.Books);
                context.Categories.Remove(selectedCaregory);
                context.SaveChanges();
                this.GridViewCategories.DataBind();

                this.MainContent_PanelDelete.Visible = false;
                this.TextBoxItemDelete.Text          = "";
                this.TextBoxDeleteItemid.Text        = "";

                ErrorSuccessNotifier.AddInfoMessage("You have successfully deleted category with name: " + selectedCaregory.Name);
            }
            catch (Exception ex)
            {
                ErrorSuccessNotifier.AddErrorMessage(ex);
            }
        }