JavaScriptTemplateCode.cs
997 Bytes
using Hh.Mes.POJO.WebEntity.tool;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
namespace Hh.Mes.T4
{
public partial class JavaScriptTemplate
{
private readonly string AreaName;
private readonly string ControllerName;
private readonly Dictionary<string, string> Data;
/// <summary>
/// 初始化Js数据模板
/// </summary>
/// <param name="areaName">区域名称</param>
/// <param name="tableName">表名</param>
/// <param name="tableColumns">数据</param>
public JavaScriptTemplate(string areaName, string tableName, List<TableColumnInfo> tableColumns)
{
AreaName = areaName;
var str = CultureInfo.CurrentCulture.TextInfo.ToTitleCase(tableName);
ControllerName = string.Join("", str.Split("_"));
Data = tableColumns.ToDictionary(x => x.ColumnName, x => x.ColumnDescription);
}
}
}