You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
74 lines
2.5 KiB
74 lines
2.5 KiB
using System.Xml;
|
|
using System.Data;
|
|
using System.Collections.Generic;
|
|
|
|
namespace SSWMS.Common
|
|
{
|
|
public class XmlStyle
|
|
{
|
|
public static XmlDocument XmlFormStyles;
|
|
|
|
public static void Init(string sPath)
|
|
{
|
|
XmlFormStyles = new XmlDocument();
|
|
XmlFormStyles.Load(sPath);
|
|
}
|
|
|
|
public static DataTable GetDataTable(string FormName, string TableName)
|
|
{
|
|
DataTable dt = null;
|
|
try
|
|
{
|
|
DataSet ds = new DataSet();
|
|
ds.ReadXml(new XmlTextReader(XmlFormStyles.SelectSingleNode(
|
|
string.Format("/Styles/Form[@Name='{0}']/Table[@Name='{1}']",
|
|
FormName, TableName)).OuterXml, XmlNodeType.Document,
|
|
new XmlParserContext(null, null, null, XmlSpace.None)));
|
|
dt = (ds.Tables.Count > 1) ? ds.Tables[1] : new DataTable();
|
|
}
|
|
catch
|
|
{
|
|
dt = new DataTable();
|
|
}
|
|
return dt;
|
|
}
|
|
|
|
private static Dictionary<string, string> dHeader = new Dictionary<string, string>()
|
|
{
|
|
{ "GOODS_PROPERTY_01", "101" },
|
|
{ "GOODS_PROPERTY_02", "102" },
|
|
{ "GOODS_PROPERTY_03", "103" },
|
|
{ "GOODS_PROPERTY_04", "104" },
|
|
{ "PLAN_PROPERTY_01", "�ͻ�����" },
|
|
{ "PLAN_PROPERTY_02", "�ͻ�����" },
|
|
{ "PLAN_PROPERTY_03", "����ƽ̨" },
|
|
{ "PLAN_PROPERTY_04", "���ȼ�" },
|
|
{ "PLAN_PROPERTY_05", "�����ֶ�" },
|
|
{ "STORAGE_PROPERTY_01", "��Ʒ����" },
|
|
{ "STORAGE_PROPERTY_02", "��Ʒ����" },
|
|
{ "STORAGE_PROPERTY_03", "��Ʒ�ȼ�" },
|
|
{ "STORAGE_PROPERTY_04", "��װ��ʽ" },
|
|
{ "STORAGE_PROPERTY_05", "�ͻ�����" },
|
|
{ "STORAGE_PROPERTY_06", "�ͻ�����" },
|
|
{ "STORAGE_PROPERTY_07", "����" },
|
|
{ "STORAGE_PROPERTY_08", "�" },
|
|
{ "STORAGE_PROPERTY_09", "�߶�" },
|
|
{ "STORAGE_PROPERTY_10", "���̹���" },
|
|
{ "STORAGE_PROPERTY_11", "����ʱ��" },
|
|
{ "GOODS_BARCODE", "��������" }
|
|
};
|
|
|
|
public static string GetHeader(DataRow dr)
|
|
{
|
|
string sColumn = dr["Column"].ToString();
|
|
if (dHeader.ContainsKey(sColumn))
|
|
{
|
|
return dHeader[sColumn];
|
|
}
|
|
else
|
|
{
|
|
return dr["Header"].ToString();
|
|
}
|
|
}
|
|
}
|
|
}
|