コード例 #1
0
        protected void DeleteSelected_Click(object sender, EventArgs e)
        {
            syncSelectedRowIndexArrayToHiddenField();
            string exception = "";
            string s         = hfSelectedIDS.Text.Trim().TrimStart('[').TrimEnd(']');

            if (s == "")
            {
                Alert.ShowInTop("请至少选择一项!", MessageBoxIcon.Information);
                return;
            }
            List <string> IDs = new List <string>();

            string[] tempIDs = s.Split(',');
            foreach (string item in tempIDs)
            {
                IDs.Add(item.Trim('"'));
            }
            if (EvaluatorManagementCtrl.Delete(IDs, ref exception))
            {
                Alert.ShowInTop("删除成功", MessageBoxIcon.Information);
            }
            else
            {
                Alert.ShowInTop("删除失败\n原因:" + exception, MessageBoxIcon.Error);
            }
            bindEvaluatorToGrid();
        }
コード例 #2
0
        protected void Grid1_RowCommand(object sender, FineUI.GridCommandEventArgs e)
        {
            string exception = "";

            if (e.CommandName == "Delete")
            {
                object[]      keys = Grid1.DataKeys[e.RowIndex];
                List <string> IDs  = new List <string>();
                IDs.Add((string)keys[0]);
                if (EvaluatorManagementCtrl.Delete(IDs, ref exception))
                {
                    Alert.ShowInTop("删除成功!", MessageBoxIcon.Information);
                    bindEvaluatorToGrid();
                }
                else
                {
                    Alert.ShowInTop("删除失败!\n原因:" + exception, MessageBoxIcon.Error);
                }
            }
        }