Пример #1
0
        private void DelListModel(int iRowIndex)
        {
            UserInfo user = GetListRowModel(iRowIndex);
            if (user == null) return;

            if (MessageBox.Show(string.Format("是否确认删除用户【{0}】?", user.UserName), "确认删除", MessageBoxButtons.YesNo, MessageBoxIcon.Asterisk) == DialogResult.No) return;

            try
            {
                if (user.IsDel != 2)
                {
                    string strErr = string.Empty;
                    if (!Basic_Func.DeleteUserByID(user, ref strErr))
                    {
                        Common.Common_Func.ErrorMessage(strErr, "删除失败");
                        return;
                    }
                }

                Common.Common_Func.ErrorMessage("删除用户成功", "删除成功");
            }
            catch (Exception ex)
            {
                Common.Common_Func.ErrorMessage(ex.Message);
            }
            finally
            {
                GetListQueryData();
            }

        }