tijian_jichuang/Code/TiJianJieGuo/frmHYSHYS.cs
2025-02-20 11:54:48 +08:00

86 lines
2.3 KiB
C#

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 EAS.Services;
using SOH.BLL;
using SOH.Entities;
using SOH;
using SOH.Common;
using SOH.Data;
namespace TiJianJieGuo
{
public partial class frmHYSHYS : Form
{
public frmHYSHYS(froHuanYanJieGuo fhyjg1)
{
InitializeComponent();
this.fhyjg = fhyjg1;
}
froHuanYanJieGuo fhyjg;
string shysxm;
string shysdlm;
private void button1_Click(object sender, EventArgs e)
{
if (this.textyhm.Text == "")
{
MessageBox.Show("用户名不能为空!");
return;
}
if (this.textmm.Text == "")
{
MessageBox.Show("密码不能为空!");
return;
}
try
{
var LoginService = ServiceContainer.GetService<It_czygl>();
t_czygl czymodel = LoginService.Login(this.textyhm.Text, this.textmm.Text, Convert.ToInt32(LoginUser.yydm));
if (czymodel != null)
{
shysdlm = this.textyhm.Text;
shysxm = czymodel.yonggong.xm;
fhyjg.GetSHYS(shysdlm, shysxm);
this.Close();
}
else
{
MessageBox.Show("用户名密码错误!请重新输入!");
}
}
catch (System.Exception ex)
{
MessageBox.Show(ex.Message);
}
}
private void frmHYSHYS_Load(object sender, EventArgs e)
{
//if (LoginUser.yydm == "1")
//{
var LoginService = ServiceContainer.GetService<It_czygl>();
t_czygl czymodel = LoginService.Login2(LoginUser.username, Convert.ToInt32(LoginUser.yydm));
this.textyhm.Text = LoginUser.username;
this.textmm.Text = czymodel.czymm;
//}
//else
//{
// this.textyhm.Text = "trdwj";
// this.textmm.Text = "123";
//}
}
}
}