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

130 lines
3.9 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Reflection;
using System.Text;
using System.Windows.Forms;
namespace dccdc.Selfhelp
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
}
private void MainForm_Load(object sender, EventArgs e)
{
//this.BackgroundImage = Image.FromFile(Application.StartupPath + "\\image\\main_bg.jpg");
int i = 0;
aa:
int c= extend.test(1, 1);
if(c!=2)
{
log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.GetType()).Info("初始化失败!"+i);
if(i<=10)
{
i++;
goto aa;
}
}
this.Width = 1440;
this.Height = 900;
btn_zyd.FlatAppearance.BorderSize = 0;
btn_cydj.FlatAppearance.BorderSize = 0;
btn_zzjf.FlatAppearance.BorderSize = 0;
btn_bgcx.FlatAppearance.BorderSize = 0;
btn_bgdy.FlatAppearance.BorderSize = 0;
}
private void btn_zyd_Click(object sender, EventArgs e)
{
frm_zyddy_1 zyd = new Selfhelp.frm_zyddy_1();
zyd.TopMost = true;
zyd.Show();
}
private void btn_zyd_MouseHover(object sender, EventArgs e)
{
this.Cursor = Cursors.Hand;
}
private void btn_zyd_MouseLeave(object sender, EventArgs e)
{
Cursor = Cursors.Default;
}
private void btn_cydj_Click(object sender, EventArgs e)
{
frm_cydd1 cydj = new Selfhelp.frm_cydd1();
cydj.TopMost = true;
cydj.Show();
}
private void btn_zzjf_Click(object sender, EventArgs e)
{
frm_zzjf zzjf = new Selfhelp.frm_zzjf();
zzjf.TopMost = true;
zzjf.Show();
}
private void btn_bgcx_Click(object sender, EventArgs e)
{
frm_bgcx bgcx = new Selfhelp.frm_bgcx();
bgcx.TopMost = true;
bgcx.Show();
}
private void btn_bgdy_Click(object sender, EventArgs e)
{
frm_bgdy bgdy = new Selfhelp.frm_bgdy();
bgdy.TopMost = true;
bgdy.Show();
}
private void timer1_Tick(object sender, EventArgs e)
{
timer1.Enabled = false;
var loger = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
try
{
string msg = "";
int mc = extend.open_printer(13, 0, ref msg);
loger.Info("打印小票打印机:" + mc + "\t" + msg);
mc = extend.get_printerStatus();
loger.Info("小票打印机状态:" + mc);
mc = extend.close_printer();
loger.Info("关闭小票打印机:" + mc);
}
catch (Exception ex)
{
loger.Info("小票打印机异常:" + ex.Message);
}
try
{
//string msg = "";
//int mc = extend.open_printer(13, 0, ref msg);
//loger.Info("打印小票打印机:" + mc + "\t" + msg);
//mc = extend.get_printerStatus();
//loger.Info("小票打印机状态:" + mc);
//mc = extend.close_printer();
int ac = 0;
int mc = extend.get_A4printerstatus(ref ac);
loger.Info("A4状态" + mc);
loger.Info("A4状态" + ac);
}
catch (Exception ex)
{
loger.Info("A4打印机异常" + ex.Message);
}
timer1.Enabled = true;
}
}
}