找传奇、传世资源到传世资源站!

c# 企业人事管理系统源码(含数据库以及文档)

8.5玩家评分(1人评分)
下载后可评
介绍 评论 失效链接反馈

from clipboard
from clipboard
from clipboard
from clipboard
from clipboard
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;//51aspx源码专家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(); } }}

评论

发表评论必须先登陆, 您可以 登陆 或者 注册新账号 !


在线咨询: 问题反馈
客服QQ:174666394

有问题请留言,看到后及时答复