You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using demo.ClassHelper.RandomOperate;
|
|
|
|
namespace demo
|
|
{
|
|
class EmsPost
|
|
{
|
|
private static EmsPost m_instance = new EmsPost();
|
|
/// <summary>
|
|
/// 创建一个静态实例
|
|
/// </summary>
|
|
public static EmsPost Instance
|
|
{
|
|
get { return m_instance; }
|
|
}
|
|
public bool GetPostInfo(string idcNo, ref string[] postInfo)
|
|
{
|
|
bool ret = false;
|
|
if (idcNo == null)
|
|
{
|
|
return false;
|
|
}
|
|
try
|
|
{
|
|
string recvNo = RandomHelper.GetRandomCode(GlobalVariable.randomTelNo, 11);
|
|
int addressIndex = RandomHelper.GetRandom(0, GlobalVariable.address.Length);
|
|
string recvAdd = GlobalVariable.address[addressIndex];
|
|
string traceNo = RandomHelper.GetRandomCode(GlobalVariable.randomTraceNo, GlobalVariable.scanGunParam.barcodeLen);
|
|
postInfo = new string[] { recvNo, recvAdd, traceNo };
|
|
ret = true;
|
|
}
|
|
catch
|
|
{
|
|
}
|
|
return ret;
|
|
}
|
|
}
|
|
}
|