private void btnSave_Click(object sender, EventArgs e) { if (tbOld.Text == "") { MessageBox.Show("旧密码不能为空!"); return; } if (tbNew.Text == "") { MessageBox.Show("新密码不能为空!"); return; } if (tbNew2.Text == "") { MessageBox.Show("确认新密码不能为空!"); return; } if (tbNew.Text != tbNew2.Text) { MessageBox.Show("两次输入的密码不一致!"); return; } if (tbNew.Text.Length < 6) { MessageBox.Show("密码最小长度为6!"); return; } String oldpwd = EDncryptHelper.MD5Encrypt16(tbOld.Text); String newpwd = EDncryptHelper.MD5Encrypt16(tbNew.Text); string data = String.Format("cardnum={0}&oldpsw={1}&newpsw={2}", MainStaticData.USERCARD, oldpwd, newpwd); String ReturnDatastr = HttpUtil.RequestData(MainStaticData.ServerAddr + MainStaticData.INTE_EMPLOYEECHANGEPSW, data); if (ReturnDatastr == "errorPassword") { MessageBox.Show("旧密码错误!"); return; } if (ReturnDatastr == "changeSuccess") { db_EmployeeLoginDao.logout(MainStaticData.USERCARD); MessageBox.Show("密码修改成功,请重新登录!"); Application.ExitThread(); MainStaticData.Restart(); return; } MessageBox.Show(ReturnDatastr);// }
/// <summary> /// 保存配置 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void btnSave_Click(object sender, EventArgs e) { if (tbServerIP.Text == "") { MessageBox.Show("服务器IP不能为空!"); return; } if (tbDeviceIP.Text == "" && cbConnType.Text == MainStaticData.ConnTypeData[0]) //网络连接 { MessageBox.Show("评价器IP不能为空!"); return; } db_ConfigDao.updateByKey("ServerAddr", String.Format("http://{0}:8080/", tbServerIP.Text)); db_ConfigDao.updateByKey("ServerIP", tbServerIP.Text); db_ConfigDao.updateByKey("DeviceIP", tbDeviceIP.Text); db_ConfigDao.updateByKey("ConnType", cbConnType.Text); db_ConfigDao.updateByKey("ServerPort", tbServerPort.Text); db_ConfigDao.updateByKey("isNoLogin", cbNoLogin.Checked); MessageBox.Show("配置保存成功,将自动重启!"); MainStaticData.Restart(); }
private void button1_Click(object sender, EventArgs e) { List <string> d = new List <string>(); if (tbWelKey.Text != "") { if (d.Contains(tbWelKey.Text)) { MessageBox.Show("按键设置重复!"); return; } else { d.Add(tbWelKey.Text); } } if (tbPauseKey.Text != "") { if (d.Contains(tbPauseKey.Text)) { MessageBox.Show("按键设置重复!"); return; } else { d.Add(tbPauseKey.Text); } } if (tbEvalKey.Text != "") { if (d.Contains(tbEvalKey.Text)) { MessageBox.Show("按键设置重复!"); return; } else { d.Add(tbEvalKey.Text); } } if (tbVoiceKey.Text != "") { if (d.Contains(tbVoiceKey.Text)) { MessageBox.Show("按键设置重复!"); return; } else { d.Add(tbVoiceKey.Text); } } if (db_KeyConfig.addIfNoExist(MainStaticData.USERCARD, "欢迎光临", tbWelKey.Text) == 0) { db_KeyConfig.update(tbWelKey.Text, MainStaticData.USERCARD, "欢迎光临"); } if (db_KeyConfig.addIfNoExist(MainStaticData.USERCARD, "暂停服务", tbPauseKey.Text) == 0) { db_KeyConfig.update(tbPauseKey.Text, MainStaticData.USERCARD, "暂停服务"); } if (db_KeyConfig.addIfNoExist(MainStaticData.USERCARD, "服务评价", tbEvalKey.Text) == 0) { db_KeyConfig.update(tbEvalKey.Text, MainStaticData.USERCARD, "服务评价"); } if (db_KeyConfig.addIfNoExist(MainStaticData.USERCARD, "语音播报", tbVoiceKey.Text) == 0) { db_KeyConfig.update(tbVoiceKey.Text, MainStaticData.USERCARD, "语音播报"); } MessageBox.Show("配置保存成功,将自动重启!"); Application.ExitThread(); MainStaticData.Restart(); }