• 大小: 2.36MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-13
  • 语言: C#
  • 标签: C#  

资源简介

基于C#实现的OA办公系统,包括日常管理、人员请假销假等

资源截图

代码片段和文件信息

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace PWMS
{
    public partial class F_Login : Form
    {
        DataClass.MyMeans MyClass = new PWMS.DataClass.MyMeans();
        
        public F_Login()
        {
            InitializeComponent();
        }

        private void butClose_Click(object sender EventArgs e)
        {
            if ((int)(this.Tag) == 1)
            {
                DataClass.MyMeans.Login_n = 3;
                Application.Exit();
            }
            else
                if ((int)(this.Tag) == 2)
                    this.Close();
        }

        private void butLogin_Click(object sender EventArgs e)
        {
            if (textName.Text != ““ & textPass.Text != ““)
            {
                SqlDataReader temDR = MyClass.getcom(“select * from tb_Login where Name=‘“ + textName.Text.Trim() + “‘ and Pass=‘“ + textPass.Text.Trim() + “‘“);
                bool ifcom = temDR.Read();
                if (ifcom)
                {
                    DataClass.MyMeans.Login_Name = textName.Text.Trim();
                    DataClass.MyMeans.Login_ID = temDR.GetString(0);
                    DataClass.MyMeans.My_con.Close();
                    DataClass.MyMeans.My_con.Dispose();
                    DataClass.MyMeans.Login_n = (int)(this.Tag);
                    this.Close();
                }
                else
                {
                    MessageBox.Show(“用户名或密码错误!“ “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
                    textName.Text = ““;
                    textPass.Text = ““;
                }
                MyClass.con_close();
            }
            else
                MessageBox.Show(“请将登录信息添写完整!“ “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
        }

        private void F_Login_Load(object sender EventArgs e)
        {
            try
            {
                MyClass.con_open();  //连接数据库
                MyClass.con_close();
                textName.Text = ““;
                textPass.Text = ““;

            }
            catch
            {
                MessageBox.Show(“数据库连接失败。“ “提示“ MessageBoxButtons.OK MessageBoxIcon.Information);
                Application.Exit();
            }
        }

        private void textName_KeyPress(object sender KeyPressEventArgs e)
        {
            if (e.KeyChar == ‘\r‘)
                textPass.Focus();
        }

        private void textPass_KeyPress(object sender KeyPressEventArgs e)
        {
            if (e.KeyChar == ‘\r‘)
                butLogin.Focus();
        }

        private void F_Login_Activated(object sender EventArgs e)
        {
            textName.Focus();
        }

    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2016-06-06 20:18  PWMS\
     目录           0  2016-06-06 20:20  PWMS\PWMS\
     目录           0  2016-06-06 20:20  PWMS\PWMS\Backup\
     目录           0  2016-06-13 12:13  PWMS\PWMS\Backup\PWMS\
     文件         901  2008-12-01 18:00  PWMS\PWMS\Backup\PWMS.sln
     文件       35328  2016-06-06 20:18  PWMS\PWMS\Backup\PWMS.suo
     目录           0  2016-06-06 20:18  PWMS\PWMS\Database\
     文件     5242880  2008-12-01 18:02  PWMS\PWMS\Database\db_PWMS.mdf
     文件     1048576  2008-12-01 18:01  PWMS\PWMS\Database\db_PWMS_log.ldf
     目录           0  2016-06-06 20:18  PWMS\PWMS\DataClass\
     文件        4306  2008-12-01 18:00  PWMS\PWMS\DataClass\MyMeans.cs
     文件        6856  2008-12-01 18:00  PWMS\PWMS\F_Login.Designer.cs
     文件        2986  2008-12-01 18:00  PWMS\PWMS\F_Login.cs
     文件      341697  2008-12-01 18:00  PWMS\PWMS\F_Login.resx
     文件       38155  2008-12-01 18:00  PWMS\PWMS\F_Main.Designer.cs
     文件        7044  2008-12-01 18:00  PWMS\PWMS\F_Main.cs
     文件     1001411  2008-12-01 18:00  PWMS\PWMS\F_Main.resx
     目录           0  2016-06-06 20:18  PWMS\PWMS\Image\
     文件        2906  2008-12-01 18:01  PWMS\PWMS\Image\01.png
     文件        3071  2008-12-01 18:02  PWMS\PWMS\Image\02.PNG
     文件        3242  2008-12-01 18:02  PWMS\PWMS\Image\03.PNG
     文件        2897  2008-12-01 18:02  PWMS\PWMS\Image\04.PNG
     文件        3096  2008-12-01 18:02  PWMS\PWMS\Image\05.PNG
     文件        3526  2008-12-01 18:02  PWMS\PWMS\Image\06.PNG
     文件        2933  2008-12-01 18:02  PWMS\PWMS\Image\07.PNG
     文件        3636  2008-12-01 18:02  PWMS\PWMS\Image\08.PNG
     文件        3033  2008-12-01 18:02  PWMS\PWMS\Image\09.PNG
     文件       29776  2008-12-01 18:02  PWMS\PWMS\Image\PEOPLE.jpg
     文件      659936  2008-12-01 18:02  PWMS\PWMS\Image\主界面.bmp
     文件        6480  2008-12-01 18:02  PWMS\PWMS\Image\人事档案浏览.bmp
     文件        6480  2008-12-01 18:02  PWMS\PWMS\Image\人事资料查询.BMP
............此处省略73个文件信息

评论

共有 条评论