curriculum_design/AdminManip.cs
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
/********************************************
* 员工管理中添加及删除 *
* Made by MeiZhaoRui *
* 2014年05月01日 更新 *
*******************************************/
using System;
using System.Collections;
using System.Data;
using System.Windows.Forms;
namespace curriculum_design
{
public partial class AdminManip : Form
{
DataSet ds = null;
string UserName = "", Level = "";
Hashtable OldValue;
public AdminManip(string username = "", string level = "")
{
InitializeComponent();
ds = Program.sqlManage.GetDataSet("select cAdminId,cLevel from Admins");
this.UserName = username;
this.Level = level;
OldValue = new Hashtable(){{"cAdminId",username},{"cLevel",level}};
}
private void tb_UseName_Leave(object sender, EventArgs e)
{
if (Global.CheckStr(tb_UserName.Text.ToString().Trim(), true) == Global.CheckState.Forbidden)
{
MsgBox.ShowError("不能以数字开头或您输入的字符不合法\n" + Global.UnAcceptChars);
tb_UserName.Focus();
return;
}
if (UserName == Level && tb_UserName.Text.Length > 0)
{
string level = radioButton1.Checked ? "2" : "1";
for (int i = 0; i < ds.Tables[0].Rows.Count; ++i)
{
if (tb_UserName.Text.ToString().Trim() == ds.Tables[0].Rows[i][0].ToString().Trim()
&& level == ds.Tables[0].Rows[i][1].ToString().Trim())
{
MsgBox.ShowError("同一类型用户中已存在相同用户,请使用其他用户名!");
tb_UserName.Text = "";
UserName_OK.Visible = false;
tb_UserName.Focus();
return;
}
}
UserName_OK.Visible = true;
}
}
private void Add_Click(object sender, EventArgs e)
{
if (Passwd_OK.Visible && CheckPass_OK.Visible && UserName_OK.Visible )
{
Hashtable NewValue = new Hashtable();
NewValue.Add("cAdminId", tb_UserName.Text.Trim() );
后面还有 63 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。