Esempio n. 1
0
        /// <summary>
        /// 点击删除按钮
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void btnDelete1_Click(object sender, EventArgs e)
        {
            if (Grid1.SelectedRowIndexArray.Length == 0)
            {
                Alert.ShowInTop("请至少选择一条记录!");
                return;
            }

            Demo.BLL.tb_JC_Department bll = new Demo.BLL.tb_JC_Department();

            foreach (int n in Grid1.SelectedRowIndexArray)
            {
                object[] keys = Grid1.DataKeys[n];
                string   id   = keys[0].ToString();
                bll.Delete(id);
            }

            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
            Alert.ShowInTop("删除选中的 " + Grid1.SelectedRowIndexArray.Length + " 项纪录!");
        }
Esempio n. 2
0
        protected void btnDelete1_Click(object sender, EventArgs e)
        {
            if (Grid1.SelectedRowIndexArray.Length == 0)
            {
                Alert.ShowInTop("请至少选择一条记录!");
                return;
            }

            Demo.BLL.tb_JC_Department bll = new Demo.BLL.tb_JC_Department();

            foreach (int n in Grid1.SelectedRowIndexArray)
            {
                object[] keys = Grid1.DataKeys[n];
                string   id   = keys[0].ToString();
                bll.Delete(id);
            }

            BindGrid1();

            Alert.ShowInTop("删除成功");
        }