using Seagull.BarTender.Print; using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Net.NetworkInformation; using System.Net.Sockets; using System.Net; using System.Text; using System.Windows.Forms; using UAS_MES_NEW.DataOperate; using UAS_MES_NEW.Entity; using UAS_MES_NEW.PublicMethod; using System.Net.Mail; namespace UAS_MES_NEW.Query { public partial class Query_MacAddress : Form { DataHelper dh = SystemInf.dh; Engine engine; public Query_MacAddress() { InitializeComponent(); } private void Export_Click(object sender, EventArgs e) { } //选择导出Excel时是选择导出数据的还是模板 private void ExcelExport(string DataOrTemplet) { } DataTable _dt; private void Query_SpecialReport_Load(object sender, EventArgs e) { NetworkInterface[] allNetworkInterface = NetworkInterface.GetAllNetworkInterfaces(); foreach (NetworkInterface nic in NetworkInterface.GetAllNetworkInterfaces()) { if (nic.OperationalStatus == OperationalStatus.Up) { Mac.Items.Add(nic.GetPhysicalAddress()); } } } private void Sn_KeyDown(object sender, KeyEventArgs e) { if (e.KeyData == Keys.Enter) { } } private void Print_Click(object sender, EventArgs e) { } private void PrintBarcode_Click(object sender, EventArgs e) { DataTable dt = (DataTable)dh.ExecuteSql("select * from DeviceMacAddress where DMA_MAC='" + Mac.Text + "'", "select"); if (dt.Rows.Count > 0) { string logout_confirm = MessageBox.Show(this.ParentForm, "已存在MAC" + Mac.Text + "对应设备名称" + dt.Rows[0]["DMA_MACHINENAME"].ToString() + "是否继续覆盖", "提示", MessageBoxButtons.YesNo, MessageBoxIcon.Question).ToString(); string dma_id = dt.Rows[0]["dma_id"].ToString(); if (logout_confirm == "Yes") { dh.ExecuteSql("delete from DeviceMacAddress where dma_id=" + dma_id, "delete"); dh.ExecuteSql("insert into DeviceMacAddress(dma_id, DMA_MAC, DMA_INMAN, DMA_INDATE, DMA_MACHINENAME)" + "values(DeviceMacAddress_seq.nextval,'" + Mac.Text + "','" + User.UserName + "',sysdate,'" + de_name.Text + "')", "insert"); OperateResult.AppendText("MAC" + Mac.Text + "上传成功", Color.Green); } } else { dh.ExecuteSql("insert into DeviceMacAddress(dma_id, DMA_MAC, DMA_INMAN, DMA_INDATE, DMA_MACHINENAME)" + "values(DeviceMacAddress_seq.nextval,'" + Mac.Text + "','" + User.UserName + "',sysdate,'" + de_name.Text + "')", "insert"); OperateResult.AppendText("MAC" + Mac.Text + "上传成功", Color.Green); } } } }