/// <summary> /// 得到.Net实体类的类头. /// </summary> /// <param name="namespaceName">命名空间名</param> /// <param name="refList">引用列表</param> /// <param name="claName">类名</param> /// <param name="claRemark">类注释</param> private void GetClassHeader(string namespaceName, string[] refList, string claName, string claRemark) { //claName = GeneratorTool.CapFirstLetter(claName); claName = GeneratorTool.ChartConversion(claName); string str = ""; str += GeneratorTool.GetEntityClassHeader(); str += "\n"; for (int i = 0; i < refList.Length; i++) { str += refList[i] + "\n"; } str += "\nnamespace " + namespaceName + "\n{\n[Serializable]\n[DataContract]\n[System.ComponentModel.DataAnnotations.Schema.Table(\"" + claName + "\")]\n"; str += GeneratorTool.ForwardIndentCodeBlock(this.FormatClassRemark(claRemark), 1); str += "\n" + this._tab + "public class " + claName + "{\n"; this._classHeader = str; }
/// <summary> /// 得到.Net实体类的类头. /// </summary> /// <param name="namespaceName">命名空间名</param> /// <param name="refList">引用列表</param> /// <param name="claName">类名</param> /// <param name="claRemark">类注释</param> private void GetClassHeader(string namespaceName, string[] refList, string claName, string claRemark) { //claName = GeneratorTool.CapFirstLetter(claName); claName = GeneratorTool.ChartConversion(claName); string str = ""; str += GeneratorTool.GetEntityClassHeader(); str += "\n"; for (int i = 0; i < refList.Length; i++) { str += refList[i] + "\n"; } str += "\nnamespace " + namespaceName + "\n{\n"; str += GeneratorTool.ForwardIndentCodeBlock(this.FormatClassRemark(claRemark + "DAL层"), 1); str += "\n" + this._tab + "public class " + claName + "DAL:I" + claName + "DAL\n{\n"; this._classHeader = str; }
/// <summary> /// 得到.Net实体类的类头. /// </summary> /// <param name="namespaceName">命名空间名</param> /// <param name="refList">引用列表</param> /// <param name="claName">类名</param> /// <param name="claRemark">类注释</param> private void GetClassHeader(string namespaceName, string[] refList, string claName, string claRemark) { //claName = GeneratorTool.CapFirstLetter(claName); claName = GeneratorTool.ChartConversion(claName); string str = ""; str += GeneratorTool.GetEntityClassHeader(); str += "\n"; for (int i = 0; i < refList.Length; i++) { str += refList[i] + "\n"; } str += "\nnamespace " + namespaceName + "\n{\n"; str += GeneratorTool.ForwardIndentCodeBlock(this.FormatClassRemark(claRemark + "接口层"), 1); str += "\n" + this._tab + "public class " + claName.Replace("_", "") + "Controller:BaseController\n{\n"; str += "\n" + this._tab + "private readonly " + _classdal + " " + _classidal + ";\n"; str += "\n" + this._tab + "public " + claName.Replace("_", "") + "Controller(" + _classdal + " " + _classnodal + ")\n{\n"; str += "\n" + this._tab + _classidal + " = " + _classnodal + ";\n}\n"; this._classHeader = str; }