• 大小: 2.1MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-09-11
  • 语言: C#
  • 标签: C#  winform  员工  

资源简介

工资管理员功能: 实现按照科室录入个人的基本资料、工资和扣除金额的数据。 计算个人的实际发放工资。 按科室、职业分类统计人数和工资金额。 能够删除辞职人员的数据。 按月分类查询。 职工功能: 查询自己每月的工资

资源截图

代码片段和文件信息

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.staffConnectionString“].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)
                                       

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2015-10-02 16:57  WindowsFormsApplication6\.vs\
     目录           0  2015-10-02 16:57  WindowsFormsApplication6\.vs\WindowsFormsApplication6\
     目录           0  2015-10-02 16:57  WindowsFormsApplication6\.vs\WindowsFormsApplication6\v14\
     文件       70656  2015-10-02 18:01  WindowsFormsApplication6\.vs\WindowsFormsApplication6\v14\.suo
     文件        1039  2015-09-25 16:59  WindowsFormsApplication6\WindowsFormsApplication6.sln
     目录           0  2015-10-02 16:57  WindowsFormsApplication6\WindowsFormsApplication6\
     文件        4719  2015-09-29 11:31  WindowsFormsApplication6\WindowsFormsApplication6\AddUserForm.cs
     文件       15779  2015-09-29 11:31  WindowsFormsApplication6\WindowsFormsApplication6\AddUserForm.Designer.cs
     文件       12549  2015-09-29 11:31  WindowsFormsApplication6\WindowsFormsApplication6\AddUserForm.resx
     文件         497  2015-10-01 09:52  WindowsFormsApplication6\WindowsFormsApplication6\App.config
     目录           0  2015-10-02 16:57  WindowsFormsApplication6\WindowsFormsApplication6\bin\
     目录           0  2015-10-02 16:57  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\
     目录           0  2015-10-02 16:57  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\app.publish\
     文件      245120  2015-09-25 17:21  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\app.publish\WindowsFormsApplication6.exe
     文件     5242880  2015-10-03 09:30  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\staff.mdf
     文件     2097152  2015-10-03 09:30  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\staff_log.ldf
     文件        1941  2015-09-25 17:21  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.application
     文件      244224  2015-09-25 17:21  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.exe
     文件         497  2015-09-25 15:45  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.exe.config
     文件        3520  2015-09-25 17:21  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.exe.manifest
     文件      192000  2015-09-25 17:21  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.pdb
     文件        1941  2015-09-25 17:21  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.vshost.application
     文件       22696  2015-09-25 17:21  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.vshost.exe
     文件         497  2015-09-25 15:45  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.vshost.exe.config
     文件        3520  2015-09-25 17:21  WindowsFormsApplication6\WindowsFormsApplication6\bin\Debug\WindowsFormsApplication6.vshost.exe.manifest
     目录           0  2015-10-02 17:22  WindowsFormsApplication6\WindowsFormsApplication6\bin\Release\
     目录           0  2015-10-02 17:22  WindowsFormsApplication6\WindowsFormsApplication6\bin\Release\app.publish\
     文件      235904  2015-10-02 17:22  WindowsFormsApplication6\WindowsFormsApplication6\bin\Release\app.publish\WindowsFormsApplication6.exe
     文件        1941  2015-10-02 17:22  WindowsFormsApplication6\WindowsFormsApplication6\bin\Release\WindowsFormsApplication6.application
     文件      235008  2015-10-02 17:22  WindowsFormsApplication6\WindowsFormsApplication6\bin\Release\WindowsFormsApplication6.exe
     文件         497  2015-10-01 09:52  WindowsFormsApplication6\WindowsFormsApplication6\bin\Release\WindowsFormsApplication6.exe.config
............此处省略86个文件信息

评论

共有 条评论