示例#1
0
        private void ClearListModel(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 (!string.IsNullOrEmpty(user.LoginIP))
                {
                    string strErr = string.Empty;
                    user.UserType = 2;
                    if (!Basic_Func.ClearLoginTime(user, ref strErr))
                    {
                        Common.Common_Func.ErrorMessage(strErr, "清除失败");
                        return;
                    }
                }

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