示例#1
0
 /// <summary>
 /// 创建一个异常处理
 /// </summary>
 /// <param name="db">实体数据</param>
 /// <param name="entity">将要创建的一个异常处理</param>
 public void Create(SysEntities db, SysException entity)
 {
     if (entity != null)
     {
         db.SysException.AddObject(entity);
     }
 }
示例#2
0
 /// <summary>
 /// 创建一个对象
 /// </summary>
 /// <param name="db">数据库</param>
 /// <param name="entity">实体</param>
 public int Create(SysException entity)
 {
     using (DBContainer db = new DBContainer())
     {
         db.SysException.AddObject(entity);
         return(db.SaveChanges());
     }
 }
示例#3
0
 /// <summary>
 /// 创建一个异常处理
 /// </summary>
 /// <param name="entity">一个对象</param>
 /// <returns></returns>
 public int Create(SysException entity)
 {
     using (SysEntities db = new SysEntities())
     {
         Create(db, entity);
         return(this.Save(db));
     }
 }
示例#4
0
        /// <summary>
        /// 删除一个异常处理
        /// </summary>
        /// <param name="db">实体数据</param>
        /// <param name="id">一条异常处理的主键</param>
        public void Delete(SysEntities db, string id)
        {
            SysException deleteItem = GetById(db, id);

            if (deleteItem != null)
            {
                db.SysException.DeleteObject(deleteItem);
            }
        }
示例#5
0
 /// <summary>
 /// 编辑一个异常处理对象
 /// </summary>
 /// <param name="db">实体数据</param>
 /// <param name="entity">将要编辑的一个异常处理对象</param>
 public SysException Edit(SysEntities db, SysException entity)
 {
     db.SysException.Attach(entity);
     db.ObjectStateManager.ChangeObjectState(entity, EntityState.Modified);
     return(entity);
 }
 public static void Log(SysException ex)
 {
 }