Exemple #1
0
        //更新当前操作员帐号的密码
        private void MenuItem2_Click(System.Object sender, System.EventArgs e)
        {
            frmEditPsw frmeditpassword = new frmEditPsw();

            frmeditpassword.ShowDialog();
            if (frmeditpassword.DialogResult == DialogResult.OK)
            {
                //更新当前操作员帐号的密码
                System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
                conn.ConnectionString = rms_var.ConnStr;
                try
                {
                    SqlCommand selectCMD = new SqlCommand();
                    selectCMD.Connection     = conn;
                    selectCMD.CommandText    = "update Operator set " + "password='******' " + "where operatorid='" + rms_var.opinfo.OpID + "'";
                    selectCMD.CommandTimeout = 30;
                    conn.Open();
                    selectCMD.ExecuteNonQuery();
                    MessageBox.Show("密码修改成功!");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    conn.Close();
                }
            }
        }
Exemple #2
0
        //更新当前操作员帐号的密码
        private void MenuItem2_Click(System.Object sender, System.EventArgs e)
        {
            frmEditPsw frmeditpassword = new frmEditPsw();
            frmeditpassword.ShowDialog();
            if (frmeditpassword.DialogResult == DialogResult.OK)
            {
                //更新当前操作员帐号的密码
                System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection();
                conn.ConnectionString = rms_var.ConnStr;
                try
                {

                    SqlCommand selectCMD = new SqlCommand();
                    selectCMD.Connection = conn;
                    selectCMD.CommandText = "update Operator set " + "password='******' " + "where operatorid='" + rms_var.opinfo.OpID + "'";
                    selectCMD.CommandTimeout = 30;
                    conn.Open();
                    selectCMD.ExecuteNonQuery();
                    MessageBox.Show("密码修改成功!");
                }
                catch (Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
                finally
                {
                    conn.Close();
                }
            }
        }