コード例 #1
0
        protected void deleteButton_Click(object sender, EventArgs e)
        {
            messageLabel.Text = "";
            messageLabel.CssClass = "alert alert-default";

            if (idHiddenField.Value == "")
            {
                messageLabel.CssClass = "alert alert-warning";
                messageLabel.Text = "First Find a Test Then Update";
            }
            else
            {
                var id = Convert.ToInt32(idHiddenField.Value);
                    var success = _testManager.Delete(id);
                    if (success > 0)
                    {
                        messageLabel.CssClass = "alert alert-success";
                        messageLabel.Text = "Delete Success";

                        RefressForm();
                    }
                    else
                    {
                        messageLabel.CssClass = "alert alert-danger";
                        messageLabel.Text = "Delete Fail";
                    }
                }
            }