by kevin
  
    8.   
      十一月 2013 13:40
  >
  
  
  
做为一个非专业的Css编写人员,一不小心,就可以踩到坑。  觉得小于12号的字不利于阅读,所以google chrome小于12号的字,都会被修正为12号。  google了下,据说,随着浏览器版本的升级,处理的方案还不一样。  整体的代码如下:             1: * {
       2:     -webkit-text-size-adjust: none;
       3:     -webkit-transform-origin-x: 0;
       4:     -webkit-transform: scale(0.8333333333333334); /* 10/12=0.8333333333333334) */
       5: }
  
  
 
  
  by kevin
  
    22.   
      十月 2013 13:58
  >
  
  
  
要实现my cart那样的边框效果,很自然的想到   上面一个div,    下面一个div,    上面那个div的z-index比下面的这个大,    下面这个div往上移1px。  然后,悲剧就开始了。。。  总结了一下,基本上是以下几个坑:     z-index 仅能在定位元素上奏效,就是要求该元素设置 position:xxxx,否则z-index无效。    如果元素内嵌于li,那么li需要设置 position:relative    上面的div需要设置background,否则无法遮住下面的div   主要代码如下:             1: <li style="position:relative" id="cart" >
       2:     <div style="width:... 
[更多...] 
  
  by kevin
  
    9.   
      十月 2013 22:13
  >
  
  
  
囧:闭着嘴,这是基本囧。    冏:开口之后,依然很囧。     烱:发火是囧。     浻:吐口水还是囧。     埛:长成这样,当然是屌丝囧。   綗:不止屌丝,其实白富美也会囧。
  
  
 
  
  by kevin
  
    27.   
      九月 2013 13:46
  >
  
  
  
FluentData是一个微型的ORM框架,使用可以很容易的对数据库进行数据操作。前段时间,花了点时间,对FluentData3.0的使用手册做了翻译,求点评。  FluentData入门(一)--核心概念  FluentData入门(二)--创建DbContext  FluentData入门(三)—Query  FluentData入门(四)—Mapping  FluentData入门(五)—Insert, Update, Delete  FluentData入门(六)--存储过程和事务
  
  
 
  
  by kevin
  
    23.   
      九月 2013 13:44
  >
  
  
  
存储过程  使用SQL语句:              1: var rowsAffected = Context.Sql("ProductUpdate") 
       2:             .CommandType(DbCommandTypes.StoredProcedure) 
       3:             .Parameter("ProductId", 1) 
       4:             .Parameter("Name", "The Warren Buffet Way") 
       5:             .Execute(); 
使用builder: 
  
       1: va... 
[更多...] 
  
  by kevin
  
    17.   
      九月 2013 13:26
  >
  
  
  
插入数据    使用 SQL 语句:             1: int productId = Context.Sql(@"insert into Product(Name, CategoryId)
       2:             values(@0, @1);")
       3:             .Parameters("The Warren Buffet Way", 1)
       4:             .ExecuteReturnLastId<int>(); 
使用builder:
  
       1: int productId = Context.Insert("Product")
       2:... 
[更多...] 
  
  by kevin
  
    13.   
      九月 2013 17:55
  >
  
  
  
映射    自动映射 – 在数据库对象和.Net object自动进行1:1匹配                  1: List<Product> products = Context.Sql(@"select *
       2:             from Product")
       3:             .QueryMany<Product>(); 
自动映射到一个自定义的Collection: 
  
  
       1: ProductionCollection products = Context.Sql("select * from Product").QueryMany<Product, ProductionCollection&... 
[更多...] 
  
  by kevin
  
    13.   
      九月 2013 16:08
  >
  
  
  
查询一组数据    返回一组dynamic对象(new in .NET 4.0)             1: List<dynamic> products = Context.Sql("select * from Product").QueryMany<dynamic>(); 
返回一组强类型对象
  
       1: List<Product> products = Context.Sql("select * from Product").QueryMany<Product>(); 
返回一个自定义的Collection
  
       1: ProductionCollection products = Context.Sql("... 
[更多...] 
  
  by kevin
  
    7.   
      九月 2013 13:58
  >
  
  
  
如何创建和初始化一个DbContext   可以在*.config文件中配置connection string,将connection string name或者将整个connection string 作为参数传递给DbContext来创建DbContext。  重要配置   IgnoreIfAutoMapFails – IDbContext.IgnoreIfAutoMapFails返回一个IDbContext,该实例中,如果自动映射失败时是否抛出异常  通过*.config中配置的ConnectionStringName创建一个DbContext             1: public IDbContext Context()
       2: {
       3:     return new DbContext().ConnectionStringNam... 
[更多...] 
  
  by kevin
  
    7.   
      九月 2013 13:17
  >
  
  
  
DbContext类  这是FluentData的核心类,可以通过配置ConnectionString来定义这个类,如何连接数据库和对具体的哪个数据库进行数据查询操作。         DbCommand类  这个类负责在相对应的数据库执行具体的每一个数据操作。         Events     DbContext类定义了以下这些事件:     OnConnectionClosed     OnConnectionOpened     OnConnectionOpening     OnError     OnExecuted     OnExecuting    可以在事件中,记录每个SQL查询错误或者SQL查询执行的 时间等信息。   Builders     Builder用来创建Insert, Update, Delete等相关的DbCommand实例。  Mappi... 
[更多...]