日期:2014-05-20 浏览次数:21055 次
class dal { private dcDataContext dc; public dal() { dc = new dcDataContext(); } public bbei tbid(long tbid)//输入id返回bbei对象 { return dc.bbei.Where(q => q.tbid == tbid).First(); } }
class BLL { private bbei bb; private dcDataContext dc; public BLL() { bb = new bbei(); dc = new dcDataContext(); } public bool upda(long id) { bb = dal.tbid(id); //根据id返回对象 bb.name="张三"; //修改name为张三 dc.SubmitChanges(); //同步到数据库