frm_Login.cs
1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
using HHWCS.Common;
using HHWCS.Model;
using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using SystemLogHelper;
namespace HHWCS.View
{
public partial class Frm_Login : Form
{
#region 字段属性
//ServiceReference1.Service1Client ser = new ServiceReference1.Service1Client();
#endregion
public Frm_Login()
{
InitializeComponent();
this.txt_UserID.Focus();
}
private void btnYes_Click(object sender, EventArgs e)
{
if (txt_UserID.Text == null || txt_UserID.Text == "" || txt_Password.Text == null || txt_Password.Text == "")
{
MessageBox.Show("请输入用户名和密码!");
txt_UserID.Focus();
}
else
{
#region 更新版
try
{
//MySqlHelper.ExecuteNonQuery(APP.MysqlConnection, "select * from ");
this.Hide();
APP.User = new User()
{
UserName=txt_UserID.Text
};
Frm_Main frm_Main = new Frm_Main();
frm_Main.Show();
}
catch (Exception ex)
{
MessageBox.Show("通讯失败。");
LogExecute.WriteExceptionLog("登陆打开数据库异常.",ex);
}
#endregion
}
}
private void btnNo_Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}