private void 注销ToolStripMenuItem_Click(object sender, EventArgs e) { if (MessageBox.Show("确定注销系统吗?", "提示", MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation) == DialogResult.OK) { OperationQuery.Event_Record(Limit, "注销系统");//事件录入(用户级别,自定义字符串操作) this.Hide(); frmLogin F_Login = new frmLogin(); F_Login.Show(); } }
private void ConnectButton_Click(object sender, EventArgs e) { Connect(); ConnectButton.Enabled = false; DisableConnectButton.Enabled = true; OperationQuery.Event_Record(sock.Limit, "网关连接成功");//事件录入(用户级别,自定义字符串操作) frmEquipmentState EquipmentState = new frmEquipmentState(this); //EquipmentState.WindowState = FormWindowState.Maximized; EquipmentState.Show(); this.Hide(); }
private void button1_Click(object sender, EventArgs e) //确认登录 { try { if (txtUserName.Text == "" || txtUserPwd.Text == "") //判断用户名和密码是否为空 { MessageBox.Show("用户名或密码不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //弹出消息对话框 return; //退出事件 } else { name = txtUserName.Text.Trim(); //移除用户名前部和后部的空格 string pwd = txtUserPwd.Text.Trim(); //移除密码前部和后部的空格 string authority = OperationQuery.author_identification(name, pwd); //获取响应名字的权限名字UserLimit Main.Limit = authority; OperationQuery.Event_Record(authority, "登录系统"); //事件录入(用户级别,自定义字符串操作) OperationQuery.Login_time_Record(name, DateTime.Now.ToString()); //AlarmRecording.alarm_recording("type test", "alarm test"); if (authority == "") { txtUserName.Text = ""; //清空用户名 txtUserPwd.Text = ""; //清空密码 MessageBox.Show("用户名或密码错误!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); //弹出消息对话框 } else { this.Hide(); //隐藏窗体 Main.User = name; Main.Logintime = DateTime.Now.ToString(); Main.WindowState = FormWindowState.Maximized; Main.Show(); } //frmEquipmentState EquipmentStatelogin = new frmEquipmentState(SetIP); //EquipmentStatelogin.MdiParent = Main; //设置窗体对象的父窗体 //EquipmentStatelogin.WindowState = FormWindowState.Maximized; //EquipmentStatelogin.Show(); } } catch (Exception ex) //捕获异常 { MessageBox.Show(ex.Message); //弹出消息对话框 } }
private void button1_Click(object sender, EventArgs e) { if (txtOldPwd.Text.Trim() == "" || txtNewPwd.Text.Trim() == "" || txtNewPwdOK.Text.Trim() == "") { MessageBox.Show("密码设置不能为空!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { if (txtNewPwd.Text.Trim().Length < 6) { MessageBox.Show("密码设置不能低于六位!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); txtOldPwd.Text = ""; txtNewPwd.Text = ""; txtNewPwdOK.Text = ""; } else { string str = "select count(*) from tb_User where UserName='******'and UserPwd='" + this.txtOldPwd.Text.Trim() + "'"; Int32 i = OperationQuery.HumanNum(str); if (i > 0) { if (txtNewPwd.Text.Trim() != txtNewPwdOK.Text.Trim()) { MessageBox.Show("两次密码不一致", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } else { string updatestr = "update tb_User set UserPwd='" + txtNewPwdOK.Text.Trim() + "'where UserName='******'"; OperationQuery.OperateData(updatestr); MessageBox.Show("密码修改成功", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); OperationQuery.Event_Record(username.Limit, "密码修改成功");//事件录入(用户级别,自定义字符串操作) this.Close(); } } else { MessageBox.Show("旧密码错误", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } } } }
private void ChangeUserbutton_Click(object sender, EventArgs e) { if (NewUserbox.Text.Trim() != "" && quanxian != "") { //string updatestr = "update tb_User set UserName='******'where UserLimit='" + quanxian + "'"; //userdb.OperateData(updatestr); Object[] mf4 = new Object[] { }; string updatestr = "update tb_User set UserName='******'where UserLimit='" + quanxian + "'"; OleDbConnection oldbcon = OleDbHelper.GetOleDbConnection(); OleDbHelper.ExecuteNonQuery(updatestr, mf4); oldbcon.Close(); MessageBox.Show("用户名修改成功,系统需要注销或重启后生效!", "警告", MessageBoxButtons.OK, MessageBoxIcon.Warning); OperationQuery.Event_Record(userpwd.Limit, "用户名修改成功");//事件录入(用户级别,自定义字符串操作) this.Close(); } else { MessageBox.Show("用户名修改失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information); } }
private void button1_Click(object sender, EventArgs e) { RecordingUsing.AlarmShow(listView1, dateTimePicker1, dateTimePicker2); OperationQuery.Event_Record(historyalarm.Limit, "查询历史告警");//事件录入(用户级别,自定义字符串操作) }
private void button1_Click(object sender, EventArgs e) { RecordingUsing.OperationShow(listView1, dateTimePicker1, dateTimePicker2); OperationQuery.Event_Record(syslog.Limit, "查询系统操作记录");//事件录入(用户级别,自定义字符串操作) }