Esempio n. 1
0
 /// <summary>
 /// strip delete item click event
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void DeleteArticleToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (SelectedArticle != null)
     {
         Response Response = ArticleController.DeleteArticle(SelectedArticle.Text);
         if (Response.State1)
         {
             listView_ShowBD_DataBinding();
             this.ToolStripStatusLabel.Text = "You have deleted an article!";
         }
     }
 }
Esempio n. 2
0
        public async Task Should_Accept_Valid_Delete_Request()
        {
            // Arrange
            _articleServices.Setup(x => x.RemoveArticle(It.IsAny <int>()))
            .ReturnsAsync(true);

            //Act
            var result = await _sut.DeleteArticle(2) as AcceptedResult;

            //Assert
            _articleServices.Verify(x => x.RemoveArticle(It.IsAny <int>()), Times.Once);
            Assert.IsNotNull(result);
            result.Should().BeOfType <AcceptedResult>().Which.StatusCode.Should().Be(202);
        }
 protected void lnkDelete_Click(object sender, EventArgs e)
 {
     if (IsEditable)
     {
         ArticleController.DeleteArticle(ArticleId);
         Response.Redirect(Globals.NavigateURL());
     }
 }
Esempio n. 4
0
        public void RptArticleListOnItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Delete")
            {
                ArticleController.DeleteArticle(Convert.ToInt32(e.CommandArgument));
            }
            if (e.CommandName == "Edit")
            {
                Response.Redirect(EditUrl(string.Empty, string.Empty, "Edit", "aid=" + e.CommandArgument));
            }

            Response.Redirect(Globals.NavigateURL());
        }