Example #1
0
        private void RePwdListModel(int iRowIndex)
        {
            if (iRowIndex < 0 || iRowIndex >= dgvList.Rows.Count) return;

            string strErr = string.Empty;
            UserInfo user = new UserInfo();
            user.ID = lstMain[iRowIndex].ID;

            if (!Basic_Func.GetUserByID(ref user, ref strErr))
            {
                MessageBox.Show(strErr, "重置失败");
                GetListQueryData();
                return;
            }

            //user.Password = Basic_Func.JiaMi(Common_Var.DefaultPwd);
            user.Password = Common_Var.DefaultPwd;

            if (!Basic_Func.SaveUser(ref user, ref strErr))
            {
                MessageBox.Show(strErr, "重置失败");
                GetListQueryData();
                return;
            }
            else
            {
                MessageBox.Show("重置密码为【" + Common_Var.DefaultPwd + "】成功", "重置成功");
            }

            GetListQueryData();

        }
Example #2
0
        private UserInfo GetListRowModel(int iRowIndex)
        {
            string strErr = string.Empty;
            UserInfo user = new UserInfo();
            user.ID = lstMain[iRowIndex].ID;

            if (!Basic_Func.GetUserByID(ref user, ref strErr))
            {
                MessageBox.Show(strErr, "读取失败");
                GetListQueryData();
                return null;
            }

            return user;
        }
Example #3
0
        private void EditListModel(int iRowIndex, int iColIndex)
        {
            if (dgvList[iColIndex, iRowIndex].FormattedValue.ToString() == "编辑")
            {
                string strErr = string.Empty;
                UserInfo user = new UserInfo();
                user.ID = lstMain[iRowIndex].ID;

                if (!Basic_Func.GetUserByID(ref user, ref strErr))
                {
                    MessageBox.Show(strErr, "编辑失败");
                    GetListQueryData();
                    return;
                }

                ShowFileForm(user);
            }
        }