资源简介
小型员工薪酬管理系统 管理员登录 注册员工信息 修改账户密码 管理员工信息界面 查询员工信息 发放员工工资 显示员工信息 分类搜索(可直接运行)
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.Data.SqlClient;
using System.Configuration;
namespace WindowsFormsApplication6
{
public partial class AddUserForm : Form
{
public AddUserForm()
{
InitializeComponent();
}
private void button1_Click(object sender EventArgs e)
{
string sql = “select Name from StaffAccount where Name=‘“ + txtUserName + “‘“;
string connstr = ConfigurationManager.ConnectionStrings[“WindowsFormsApplication6.Properties.Settings.staffConnectionString1“].ConnectionString;
SqlConnection conn = new SqlConnection(connstr);
SqlCommand cmd = new SqlCommand(sql conn);
conn.Open();
SqlDataReader sdr = cmd.ExecuteReader();
if (sdr.Read())
{
lblUserMsg.Text = “用户名已存在请重新输入!“;
}
else if (txtUserName.Text.Trim() == ““)
{
lblUserMsg.Text = “用户名不能为空!“;
}
else if (txtPassword.Text.Trim() == ““)
{
lblPwd.Text = “密码不能为空!“;
lblPwd.Text = ““;
}
else if (txtPwdConfirm.Text.Trim() == ““)
{
lblPswConfirm.Text = “验证密码不能为空!“;
lblUserMsg.Text = ““;
lblPwd.Text = ““;
}
else if (txtPassword.Text.Trim() != txtPwdConfirm.Text.Trim())
{
lblPwd.Text = “2次密码必须一样!“;
lblPswConfirm.Text = “请重新输入!“;
}
else if (txtName.Text.Trim() == ““ | txtAge.Text.Trim() == ““ | cmboxSex.Text == ““ | cmboxOffice.Text == ““)
{
lblbaseInfo.Text = “基本信息不完整!“;
}
else
{
lblUserMsg.Text = ““;
lblPwd.Text = ““;
lblPswConfirm.Text = ““;
lblbaseInfo.Text = ““;
string uType = ““;
if (rbtAdmin.Checked)
uType = “Administrator“;
else if (rbtNormalUser.Checked)
uType = “NormalUser“;
else
uType = “NormalUser“;
conn.Close();
string sqlInsert = “insert into StaffAccount(NamePasswordUserType) values(@UserName@UserPwd@UserType)“;
string sqlInsertInfo = “insert into StaffInfo(NameSexAgeOffice) values(@Name@Sex@Age@Office)“;
SqlParameter[] param = {
new SqlParameter(“@UserName“txtUserName.Text)
new SqlParameter(“@UserPwd“txtPassword.Text)
new SqlParameter(“@UserType“uType)
};
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-01-23 19:23 Staff-System-master\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\.vs\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\.vs\staff\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\.vs\staff\v15\
文件 74240 2018-01-17 22:42 Staff-System-master\WindowsFormsApplication6\.vs\staff\v15\.suo
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\.vs\staff\v15\Server\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\.vs\staff\v15\Server\sqlite3\
文件 0 2018-01-17 16:22 Staff-System-master\WindowsFormsApplication6\.vs\staff\v15\Server\sqlite3\db.lock
文件 733184 2018-01-17 20:37 Staff-System-master\WindowsFormsApplication6\.vs\staff\v15\Server\sqlite3\storage.ide
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\.vs\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\.vs\WindowsFormsApplication6\
目录 0 2018-01-23 19:27 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\.vs\WindowsFormsApplication6\v15\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\.vs\staff\
目录 0 2018-01-23 19:23 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\.vs\staff\v15\
文件 43008 2018-01-17 15:53 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\.vs\staff\v15\.suo
文件 15720 2018-01-17 14:36 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\AddUserForm.Designer.cs
文件 4604 2018-01-17 14:33 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\AddUserForm.cs
文件 12549 2018-01-17 14:36 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\AddUserForm.resx
文件 773 2018-01-17 14:34 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\App.config
文件 6355 2018-01-17 14:33 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\Form1.Designer.cs
文件 2749 2018-01-17 14:33 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\Form1.cs
文件 133736 2018-01-17 14:36 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\Form1.resx
文件 10379 2018-01-17 19:45 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\MainForm.Designer.cs
文件 2011 2018-01-17 19:45 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\MainForm.cs
文件 42449 2018-01-17 19:45 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\MainForm.resx
文件 18266 2018-01-17 14:36 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\ManagerForm.Designer.cs
文件 4692 2018-01-17 14:32 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\ManagerForm.cs
文件 14359 2018-01-17 14:36 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\ManagerForm.resx
文件 7630 2018-01-17 14:36 Staff-System-master\WindowsFormsApplication6\WindowsFormsApplication6\PasswordChange.Designer.cs
............此处省略102个文件信息
- 上一篇:unity3D神启全套源码资源
- 下一篇:JFCms专业版4.0
评论
共有 条评论