bll.出库申请单管理.ChangeState()
这个方法执行出库单的状态更改动作
因为 每个bll都是单独的数据库连接 为了事务的一致
我在 bll.出库单管理.出库()
这个方法里直接操作出库申请单表的state字段而不是调用
bll.出库申请单管理.ChangeState()
然后 现在写销售单管理 销售单生成出库申请单
当出库申请单状态更改时需要更改销售单的状态
这样的 我就还要更改两处的代码bll.出库申请单管理.ChangeState()
bll.出库单管理.出库()
这样的设计太差了 都是为了实现数据库的事务一致
多数据库的事务一致 net可以实现 但是有点烦
折中的方式 我觉得是这样
调用bll的代码实现数据库连接的管理 
以asp.net mvc + linq to sql 为例
controller 负责 控制 datacontext 
new bll(datacontext db)
bll 一系列的操作
最后 db.submitchanges()
这样的操作不知道会不会有问题
首先;对于数据读取是没有问题的
有个问题就是这种情况 比如删除一个记录后返回列表
这样的就需要 bll.delete()后 db.submitchanges() 
然后再去查询获取列表
对于这样的设计对于没有多线程的web程序来说 应该不会有什么问题
这样做还有个好处就是 每次请求就只用到一个数据库连接
而像一个门户网站的首页 如果用我之前的方式 可能需要几十个数据库连接
 
posted @ 2010-12-21 16:21 liuwei0514 Views(53) Comments(0) Edit

1 把浮动在最上面的元素放在html代码的最后面

2 以下是正解

giving the parent element a higher z-index actual fixes the bug

 

http://brenelz.com/blog/squish-the-internet-explorer-z-index-bug/

原因:“In Internet Explorer positioned elements generate a new stacking context, starting with a z-index value of 0. Therefore z-index doesn’t work correctly”

posted @ 2010-12-07 21:53 liuwei0514 Views(69) Comments(0) Edit
blowing in the wind  
 歌手:Bob Dylan       
How many roads must a man walk down
Before they call him a man 
How many seas must a white dove sail 
Before she sleeps in the sand 
How many times must the cannon balls fly 
Before they're forever banned 
The answer, my friend, is blowing in the wind
The answer is blowing in the wind 


How many years must a mountain exist 
Before it is washed to the sea 
How many years can some people exist
Before they're allowed to be free 
How many times can a man turn his head 
And pretend that he just doesn't see 
The answer, my friend, is blowing in the wind
The answer is blowing in the wind

How many times must a man look up
Before he can see the sky 
How many ears must one man have
Before he can hear people cry 
How many deaths will it take 
'Till he knows that too many people have died
The answer, my friend, is blowing in the wind
The answer is blowing in the wind
 
一个男人必须走过多少路 

在他被称为男人之前 

一支白鸽必须飞过多少海洋 

才能在沙滩上安睡 

加农炮还得飞行多少次 

才会被永远禁止 

答案啊! 

朋友,就飘在风里 

答案就飘在茫茫的风里 


一座山能存在多久 

在它被冲刷入海之前 

人们能够存活多少年 

在他获得自由以前 

一个人可以掉过头去几次 

假装什麼都没看见 

答案啊! 

朋友,就飘在风里 

答案就飘在茫茫的风里 


一个人得仰望几次 

才能看见蓝天 

一个人得有多少耳朵 

才能听见人们的哭泣 

还得多少人死亡 

他才能明白已有太多人死去 

答案啊! 

朋友,就飘在风里 

答案就飘在茫茫的风里
posted @ 2010-11-26 21:29 liuwei0514 Views(7) Comments(0) Edit

http://forums.asp.net/t/1183564.aspx

在这里提出了一个我也想问的问题

问题描述:

bll 4个类 blla bllb bllc blld

blld.f()

{

blla.f();

bllb.f();

bllc.f();

}

这里 bllc.f();发生异常要撤销bllb.f();blla.f();

解决

1:

http://forums.asp.net/t/1183564.aspx这里的回复里提出用

System.Transactions
详见 http://www.cnblogs.com/ltp/archive/2009/06/17/1505319.html
2:
blld.f() 用独立的代码实现

blla.f();

bllb.f();

bllc.f();

以上功能用同一个数据库连接 然后用数据库的事务

希望有相关经验的高手进来指点指点

问题已经发布在

http://space.cnblogs.com/q/20319/

posted @ 2010-11-25 11:50 liuwei0514 Views(35) Comments(0) Edit
 y.Level.ToString().PadLeft(y.Level*2, (char)0xA0) + y.Name,
想了好久 终于找到了
posted @ 2010-11-23 21:56 liuwei0514 Views(6) Comments(0) Edit
首先 一个生成Lambda表达式的静态类 public static class PredicateExtensions    {        public static Expression<Func<T, bool>> True<T>() { return f => true; }        public static Expressio...Read More
posted @ 2010-11-03 17:11 liuwei0514 Views(299) Comments(1) Edit
验证工作交给谁,service、controller、model? 交给 service 比如:添加用户 UserModel 有 Validate 方法 再去验证内部的各个字段什么的~~~ 具体的验证 用 asp.net mvc validation framework xVal ...Read More
posted @ 2010-10-25 16:37 liuwei0514 Views(21) Comments(0) Edit
Membership.GetUser(user.ProviderUserKey.ToString());Read More
posted @ 2010-10-12 15:49 liuwei0514 Views(34) Comments(0) Edit
WITH CTEArea([ID],[Code],[Name],[level]) as (     SELECT [ID],[Code],[Name],1 as [level] FROM [WMS_Area] WHERE [ParentID] ='00000000-0000-0000-0000-000000000000' and [Name]='江苏省'     UNION ALL     SEL...Read More
posted @ 2010-10-11 15:20 liuwei0514 Views(5) Comments(0) Edit
BlogML如何标记缩略图? “Slug Is Not Valid.” Oxite路由规则在那里?Read More
posted @ 2010-07-18 23:09 liuwei0514 Views(22) Comments(0) Edit