Пример #1
0
        protected void deleteLinkButton_Click(object sender, EventArgs e)
        {
            try
            {
                LinkButton lnkBtn = (LinkButton)sender;
                GridViewRow row = (GridViewRow)lnkBtn.NamingContainer;

                AppMenuBLL appMenu = new AppMenuBLL();
                string status = appMenu.DeleteMenuById(menuListGridView.Rows[row.RowIndex].Cells[0].Text.ToString(), "False");

                if (status == "Deleted")
                {
                    MyAlertBox("alert(\"Menu Deleted Successfully.\"); window.location=\"/UI/AppMenu/MenuList.aspx\"");
                }
                else
                {
                    MyAlertBox("alert(\"This Menu used as Sub-Parent Menu which contains " + status + " child(s). You can't delete this Sub-Parent Menu. You must move the child(s) first to another menu.\");");
                }
            }
            catch (Exception ex)
            {
                msgbox.Visible = true; msgTitleLabel.Text = "Exception!!!"; msgDetailLabel.Text = ex.Message;
            }
        }