/// <summary>
 /// 创建一个对象
 /// </summary>
 /// <param name="db">数据库</param>
 /// <param name="entity">实体</param>
 public int Create(SysLog entity)
 {
     using (DBContainer db = new DBContainer())
     {
         db.SysLogs.AddObject(entity);
         return db.SaveChanges();
     }
 }
示例#2
0
        public void WriteServiceLog(string oper, string mes, string result, string type, string module)
        {
            SysLog entity = new SysLog();
            entity.Id = ResultHelper.NewId;
            entity.Operator = oper;
            entity.Message = mes;
            entity.Result = result;
            entity.Type = type;
            entity.Module = module;
            entity.CreateTime = ResultHelper.NowTime;

            this.Create(entity);
        }
示例#3
0
 /// <summary>
 /// 创建新的 SysLog 对象。
 /// </summary>
 /// <param name="id">Id 属性的初始值。</param>
 public static SysLog CreateSysLog(global::System.String id)
 {
     SysLog sysLog = new SysLog();
     sysLog.Id = id;
     return sysLog;
 }
示例#4
0
 /// <summary>
 /// 用于向 SysLogs EntitySet 添加新对象的方法,已弃用。请考虑改用关联的 ObjectSet&lt;T&gt; 属性的 .Add 方法。
 /// </summary>
 public void AddToSysLogs(SysLog sysLog)
 {
     base.AddObject("SysLogs", sysLog);
 }
示例#5
0
 public int Create(SysLog entity)
 {
     return LogRepository.Create(entity);
 }