SVN r1193
SVN-Revision: r1193
This commit is contained in:
@@ -451,6 +451,14 @@ namespace Lskj.Model
|
|||||||
/// 单据终审后可以添加明细
|
/// 单据终审后可以添加明细
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public bool BillFinalReviewAdd;
|
public bool BillFinalReviewAdd;
|
||||||
|
/// <summary>
|
||||||
|
/// 单据来源主表推拽到单据主表后,隐藏推拽行
|
||||||
|
/// </summary>
|
||||||
|
public bool SourceMainPushPullHide;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Initializes a new instance of the <see cref="BillModel"/> class.
|
/// Initializes a new instance of the <see cref="BillModel"/> class.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -547,4 +555,5 @@ namespace Lskj.Model
|
|||||||
this.TreeTableDragCondition = rowItem.Table.Columns.Contains("TreeTableDragCondition") ? rowItem["TreeTableDragCondition"] + "" : "";
|
this.TreeTableDragCondition = rowItem.Table.Columns.Contains("TreeTableDragCondition") ? rowItem["TreeTableDragCondition"] + "" : "";
|
||||||
this.isReplaceFixed = rowItem.Table.Columns.Contains("isReplaceFixed") ? !"1".Equals(rowItem["isReplaceFixed"] + "") : true;
|
this.isReplaceFixed = rowItem.Table.Columns.Contains("isReplaceFixed") ? !"1".Equals(rowItem["isReplaceFixed"] + "") : true;
|
||||||
this.SaveRefreshAdditional = rowItem.Table.Columns.Contains("SaveRefreshAdditional") ? "1".Equals(rowItem["SaveRefreshAdditional"] + "") : false;
|
this.SaveRefreshAdditional = rowItem.Table.Columns.Contains("SaveRefreshAdditional") ? "1".Equals(rowItem["SaveRefreshAdditional"] + "") : false;
|
||||||
this.CancelCopyAssociation
|
this.CancelCopyAssociation = rowItem.Table.Columns.Contains("CancelCopyAssociation") ? !"1".Equals(rowItem["CancelCopyAssociation"] + "") : true;
|
||||||
|
this.PrintingConditions = row
|
||||||
+69
-14
@@ -16,6 +16,8 @@ using System.Management;
|
|||||||
using DevExpress.XtraTab;
|
using DevExpress.XtraTab;
|
||||||
using System.Windows.Forms;
|
using System.Windows.Forms;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Net.NetworkInformation;
|
||||||
|
using System.Net.Sockets;
|
||||||
|
|
||||||
namespace Lskj.Model
|
namespace Lskj.Model
|
||||||
{
|
{
|
||||||
@@ -273,35 +275,88 @@ namespace Lskj.Model
|
|||||||
/// 获取本机MAC地址
|
/// 获取本机MAC地址
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns>本机MAC地址</returns>
|
/// <returns>本机MAC地址</returns>
|
||||||
string GetMacAddress()
|
private string GetMacAddress()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
string strMac = string.Empty;
|
string fallbackMac = string.Empty;
|
||||||
ManagementClass mc = new ManagementClass("Win32_NetworkAdapterConfiguration");
|
|
||||||
ManagementObjectCollection moc = mc.GetInstances();
|
NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();
|
||||||
foreach (ManagementObject mo in moc)
|
|
||||||
|
foreach (NetworkInterface ni in interfaces)
|
||||||
{
|
{
|
||||||
if ((bool)mo["IPEnabled"])
|
if (ni == null)
|
||||||
{
|
{
|
||||||
strMac = mo["MacAddress"].ToString();
|
continue;
|
||||||
string[] IPAddress = (string[])mo["IPAddress"];
|
}
|
||||||
if (IPAddress.Length > 0 && IPAddress[0].Equals(LoginIPV4))
|
|
||||||
|
if (ni.OperationalStatus != OperationalStatus.Up)
|
||||||
{
|
{
|
||||||
break;
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ni.NetworkInterfaceType == NetworkInterfaceType.Loopback ||
|
||||||
|
ni.NetworkInterfaceType == NetworkInterfaceType.Tunnel)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
PhysicalAddress physicalAddress = ni.GetPhysicalAddress();
|
||||||
|
if (physicalAddress == null || physicalAddress.GetAddressBytes().Length == 0)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
string mac = FormatMacAddress(physicalAddress);
|
||||||
|
if (string.IsNullOrEmpty(fallbackMac))
|
||||||
|
{
|
||||||
|
fallbackMac = mac;
|
||||||
|
}
|
||||||
|
|
||||||
|
IPInterfaceProperties properties = ni.GetIPProperties();
|
||||||
|
foreach (UnicastIPAddressInformation ipInfo in properties.UnicastAddresses)
|
||||||
|
{
|
||||||
|
if (ipInfo.Address.AddressFamily != AddressFamily.InterNetwork)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrEmpty(LoginIPV4) &&
|
||||||
|
ipInfo.Address.ToString() == LoginIPV4)
|
||||||
|
{
|
||||||
|
RecordMAC = mac;
|
||||||
|
return mac;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
moc = null;
|
|
||||||
mc = null;
|
RecordMAC = fallbackMac;
|
||||||
RecordMAC= strMac.Replace(":", "-");
|
return fallbackMac;
|
||||||
return strMac.Replace(":", "-");
|
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private string FormatMacAddress(PhysicalAddress physicalAddress)
|
||||||
|
{
|
||||||
|
byte[] bytes = physicalAddress.GetAddressBytes();
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
|
||||||
|
for (int i = 0; i < bytes.Length; i++)
|
||||||
|
{
|
||||||
|
if (i > 0)
|
||||||
|
{
|
||||||
|
sb.Append("-");
|
||||||
|
}
|
||||||
|
|
||||||
|
sb.Append(bytes[i].ToString("X2"));
|
||||||
|
}
|
||||||
|
|
||||||
|
return sb.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 加密狗id
|
/// 加密狗id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user