tijian_tieying/web/dccdc.Selfhelp/frm_zzjf.cs
2025-02-20 12:14:39 +08:00

149 lines
4.6 KiB
C#

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Net;
using System.Text;
using System.Windows.Forms;
namespace dccdc.Selfhelp
{
public partial class frm_zzjf : Form
{
public frm_zzjf()
{
InitializeComponent();
}
bool close = true;
private void frm_zzjf_Load(object sender, EventArgs e)
{
btn_tjjf.FlatAppearance.BorderSize = 0;
btn_ymjf.FlatAppearance.BorderSize = 0;
}
private void frm_zzjf_MouseMove(object sender, MouseEventArgs e)
{
Rectangle rect = new Rectangle(30, 30, 170, 56);
if (rect.Contains(e.Location))
{
Cursor = Cursors.Hand;
}
else
{
Cursor = Cursors.Default;
}
}
private void frm_zzjf_MouseClick(object sender, MouseEventArgs e)
{
Rectangle rect = new Rectangle(30, 30, 170, 56);
if (rect.Contains(e.Location))
{
this.Close();
}
}
private void btn_tjjf_Click(object sender, EventArgs e)
{
close = false;
frm_CodeReader fc = new frm_CodeReader("请扫描体检指引单上的条码进行缴费");
if (fc.ShowDialog() == DialogResult.OK)
{
fc.TopMost = true;
fc.TopLevel = true;
string code = fc.CodeStr;
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
string jsonData = wc.DownloadString(extend.URL + "zzj/getTJJFXX?id=" + code);
try
{
dccdc.Models.DTO.YMJFXX yj = Newtonsoft.Json.JsonConvert.DeserializeObject<dccdc.Models.DTO.YMJFXX>(jsonData);
if (yj.State == 0)
{
Status s = new Status(yj.Message);
s.ShowDialog();
s.Close();
this.Close();
}
else
{
frm_zzjf_tj ymjf = new frm_zzjf_tj(yj);
ymjf.ShowDialog();
this.Close();
}
}
catch (Exception ex)
{
Status s = new Status(ex.Message);
s.ShowDialog();
s.Close();
this.Close();
}
}
else
{
Status s = new Status("没有识别到条码信息");
s.ShowDialog();
s.Close();
this.Close();
}
}
private void btn_ymjf_Click(object sender, EventArgs e)
{
close = false;
frm_CodeReader fc = new frm_CodeReader("请扫缴费单上的条码或者接种本上的条码进行缴费");
if(fc.ShowDialog()==DialogResult.OK)
{
string code = fc.CodeStr;
WebClient wc = new WebClient();
wc.Encoding = Encoding.UTF8;
string jsonData = wc.DownloadString(extend.URL + "zzj/getYYJFXX?id=" + code);
try
{
dccdc.Models.DTO.YMJFXX yj = Newtonsoft.Json.JsonConvert.DeserializeObject<dccdc.Models.DTO.YMJFXX>(jsonData);
if(yj.State==0)
{
Status s = new Status(yj.Message);
s.ShowDialog();
s.Close();
this.Close();
}
else
{
frm_zzjf_ym ymjf = new frm_zzjf_ym(yj);
ymjf.ShowDialog();
this.Close();
}
}
catch(Exception ex)
{
Status s = new Status(ex.Message);
s.ShowDialog();
s.Close();
this.Close();
}
}
else
{
Status s = new Status("没有识别到条码信息");
s.ShowDialog();
s.Close();
this.Close();
}
}
private void label1_Click(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
if (close)
this.Close();
}
}
}