/// <summary> /// 更新 /// </summary> /// <param name="obj"></param> /// <returns></returns> public static bool Modify(Dt_commission obj) { try { obj.Update(); return(true); } catch (Exception ex) { Log.Error(ex.Message); return(false); } }
public static void cableUpdate(Dt_commission c) { try { if (c.Updatetime == null) { c.Updatetime = DateTime.Now; } c.Update(); using (DbHelper db = new DbHelper()) { string sql = "Update cable set updateTime=@time where id=@id"; DbParameter[] parmar = { db.CreateParameter("@time", c.Updatetime), db.CreateParameter("@id", c.Id) }; db.ExecuteNonQuery(sql, parmar); } } catch (Exception ex) { Log.Error(ex.Message); } }