/// <summary> /// 往GeologicalEvaluatio中插入一条数据 /// </summary> /// <param name="ge">GeologicalEvaluation实例</param> /// <returns>受影响的行数</returns> public static int Insert(Entity.GeologicalEvaluation ge) { //获取当前井号 string wellid = Entity.Well.well_num; int result = -1; //该数据不存在,就插入 if (!select(ge.depth)) { string sql = "insert into GeologicalEvaluation(Well_Num,DEPTH,AC,GR,SP,DEN,POR,PER,SW) values ('"; sql += wellid + "',"; sql += ge.depth + ","; sql += ge.AC + ","; sql += ge.GR + ","; sql += ge.SP + ","; sql += ge.DEN + ","; sql += ge.POR + ","; sql += ge.PER + ","; sql += ge.SW + ")"; result = Access.AccessHelper.Insert(sql); } return(result); }
/// <summary> /// 修改GeologicalEvaluatio中的一条数据 /// </summary> /// <param name="ge">GeologicalEvaluation实例</param> /// <param name="depth">数据的主键</param> /// <returns>受影响的行数</returns> public static int Update(Entity.GeologicalEvaluation ge, double depth) { //获取当前井号 string wellid = Entity.Well.well_num; string sql = "update GeologicalEvaluation set "; sql += "DEPTH=" + ge.depth; sql += ",AC=" + ge.AC; sql += ",GR=" + ge.GR; sql += ",SP=" + ge.SP; sql += ",DEN=" + ge.DEN; sql += ",POR=" + ge.POR; sql += ",PER=" + ge.PER; sql += ",SW=" + ge.SW; sql += " where DEPT=" + depth + ",Well_Num=" + wellid; int result = Access.AccessHelper.Update(sql); return(result); }