免费视频淫片aa毛片_日韩高清在线亚洲专区vr_日韩大片免费观看视频播放_亚洲欧美国产精品完整版

打開(kāi)APP
userphoto
未登錄

開(kāi)通VIP,暢享免費(fèi)電子書等14項(xiàng)超值服

開(kāi)通VIP
BLL 業(yè)務(wù)邏輯層代碼生成器

<%--
Name:
Author:
Description:
--%>
<%@ CodeTemplate Language="C#" TargetLanguage="Text" Src="" Inherits="" Debug="False" Description="Template description here." %>
<%@ Property Name="SampleStringProperty" Type="System.String" Default="SomeValue" Optional="True" Category="Strings" Description="This is a sample string property." %>
<%@ Property Name="SampleBooleanProperty" Type="System.Boolean" Default="True" Optional="False" Category="Booleans" Description="This is a sample boolean property." %>
<%@ Assembly Name="System.Data" %>
<%@ Import Namespace="System.Data" %>
<%@ Property Name="nameSpace" Type="String" Default="Eatery" Optional="False" Category="" Description="" OnChanged="" Editor="" EditorBase="" Serializer="" %>
<%@ Property Name="index" Type="System.int32" Default="0" Optional="False" Category="" Description="" OnChanged="" Editor="" EditorBase="" Serializer="" %>
<%@ Property Name="db" Type="SchemaExplorer.DatabaseSchema" Default="" Optional="False" Category="Context" Description="???" OnChanged="" Editor="" EditorBase="" Serializer="" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Assembly Name="SchemaExplorer" %>
<%@ Import Namespace="SchemaExplorer" %>
<%@ Import Namespace="System.IO" %>
using System;
using System.Data.Common;
using System.Collections.Generic;
using System.Text;
using Model;
using <%=nameSpace %>DAL;

namespace <%=nameSpace %>BLL
{
 public class <%=GetClassName() %>BLL
 {
  private <%=GetClassName() %>DAL <%=GetObjectName() %>DAL = new <%=GetClassName() %>DAL();
  
  public int Add(<%=GetClassName() %> <%=GetObjectName() %>)
        {
            return <%=GetObjectName() %>DAL.Add(<%=GetObjectName() %>);
        }
  
  public int AddReturn<%=StringUtil.ToPascalCase(db.Tables[index].Columns[0].Name) %>(<%=GetClassName() %> <%=GetObjectName() %>)
        {
            return <%=GetObjectName() %>DAL.AddReturn<%=StringUtil.ToPascalCase(db.Tables[index].Columns[0].Name) %>(<%=GetObjectName() %>);
        }
  
  public int Update(<%=GetClassName() %> <%=GetObjectName() %>)
  {
   return <%=GetObjectName() %>DAL.Update(<%=GetObjectName() %>);
  }
  
  public int Delete(int <%=StringUtil.ToCamelCase(GetPrimaryKey()) %>)
  {
   return <%=GetObjectName() %>DAL.Delete(<%=StringUtil.ToCamelCase(GetPrimaryKey()) %>);
  }
 
  public List<<%=GetClassName() %>> GetAll()
  {
   return <%=GetObjectName() %>DAL.GetAll();
  }
  
  public <%=GetClassName() %> GetSingle(int <%=StringUtil.ToCamelCase(GetPrimaryKey()) %>)
        {
            return <%=GetObjectName() %>DAL.GetSingle(<%=StringUtil.ToCamelCase(GetPrimaryKey()) %>);
  }
  
  public List<<%=GetClassName() %>> GetAllByConditions(string conditions)
  {
   return <%=GetObjectName() %>DAL.GetAllByConditions(conditions);
  }
 }
}
<script runat="template">
 public string GetClassName()
 {
  return StringUtil.ToPascalCase(db.Tables[index].Name);
 }
 public string GetObjectName()
 {
  return StringUtil.ToCamelCase(db.Tables[index].Name); 
 }
 public string GetPrimaryKey()
 {
  return db.Tables[index].Columns[0].Name ; 
 }
 public override void Render(TextWriter writer)
 {
  string path1 =OutputDirectory + GetClassName()  + "BLL.cs";
  System.Diagnostics.Trace.WriteLine(path1);
  StreamWriter fileWriter1 = new StreamWriter(path1,false);
  this.Response.AddTextWriter(fileWriter1);
  base.Render(writer);
  fileWriter1.Close();
 }
 private string _outputDirectory = String.Empty;

 [Editor(typeof(System.Windows.Forms.Design.FolderNameEditor), typeof(System.Drawing.Design.UITypeEditor))]
 [Optional]
 [Category("Output")]
 [Description("The directory to output the results to.")]
 public string OutputDirectory
 {
  get
  {
    // default to the directory that the template is located in
    if (_outputDirectory.Length == 0) return this.CodeTemplateInfo.DirectoryName;
 
    return _outputDirectory;
  }
  set
  {
    if (!value.EndsWith("http://")) value += "http://";
    _outputDirectory = value;
  }
 }
</script>

本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊舉報(bào)。
打開(kāi)APP,閱讀全文并永久保存 查看更多類似文章
猜你喜歡
類似文章
C#三層架構(gòu)詳解
C# IOC
使用PowerDesigner進(jìn)行代碼生成
ASP.NET三層架構(gòu)步驟講解
c# – Mapper已初始化
string常用操作
更多類似文章 >>
生活服務(wù)
分享 收藏 導(dǎo)長(zhǎng)圖 關(guān)注 下載文章
綁定賬號(hào)成功
后續(xù)可登錄賬號(hào)暢享VIP特權(quán)!
如果VIP功能使用有故障,
可點(diǎn)擊這里聯(lián)系客服!

聯(lián)系客服