示例#1
0
文件: DBCenter.cs 项目: baixue001/IPS
        public static bool UpdateByID(M_Base data, int id)
        {
            SqlModel model = new SqlModel()
            {
                cmd    = SqlCmd.Update,
                tbName = data.TbName,
                pk     = data.PK
            };

            model.AddSpToList(data.GetParameters());
            model.sql = "UPDATE " + data.TbName + " SET " + DB.GetFieldAndParam(data) + " WHERE " + data.PK + "=" + id;
            PreSPList(model);
            DB.ExecuteNonQuery(model);
            return(true);
        }