2019年11月28日

用select提取List元素自身序号

摘要: var cs = currentCitys.Select((c, i) => new { id = c.CITY_ID, 序号 = (i + 1).ToString(), 城市类型 = c.IS_FOREIGN == "Y" ? "国际城市" : "国内城市", 名称 = c.NAME }).ToL 阅读全文

posted @ 2019-11-28 20:00 mol1995 阅读(946) 评论(0) 推荐(0) 编辑

以事务处理数据库

摘要: bool res = true; using (var db = DAL.DbBaseFactory.OpenConnection()) { IDbTransaction tran = db.DbTransaction; try { //res &= XXBLL.aaManager.Add(aa, 阅读全文

posted @ 2019-11-28 14:43 mol1995 阅读(118) 评论(0) 推荐(0) 编辑

导航