/*** * 查找相同类标准的潜在替代关系 */ public String UpdateDTBZ(GJIBZ_PM gp) { String err = String.Empty; if (gp.bzwh.LastIndexOf('-') < 0) { err = "标准文号缺少年份 "; return err; } //进行标准替代关系的更新, 确保标准文号格式正确 string pre_wh = gp.bzwh.Substring(0, gp.bzwh.LastIndexOf('-') + 1); //找到代替的标准,只代替最近的标准 GJIBZ_PM gpm = gjibzDAO.GetAlikeGJIBZ_PM(pre_wh, gp.bzwh, "desc"); if (gpm != null && gpm.bzwh.CompareTo(gp.bzwh) < 0) { gpm.zf = false; gpm.zf1 = "F"; gpm.zfnf = gp.bzwh.Substring(gp.bzwh.Length - 4); if (GlobalMethod.IsBzInvalid(gp.ssrq)) { gpm.zf = true; gpm.zf1 = "T"; } if (gpm.bdtbz == null) { gpm.bdtbz = gp.bzwh; } else if (gpm.bdtbz.IndexOf(gp.bzwh) < 0) { if (!"".Equals(gpm.bdtbz)) gpm.bdtbz += ";"; gpm.bdtbz += gp.bzwh; } if (gp.dtbz == null) { gp.dtbz = gpm.bzwh; } else if (gp.dtbz.IndexOf(gpm.bzwh) < 0) { if (!"".Equals(gp.dtbz)) gp.dtbz += ";"; gp.dtbz += gpm.bzwh; } try { gjibzDAO.UpdateGJIBZ_PM(gpm, user.name); /* 更新ACCESS数据表记录 */ if (gp.bzwjm.Equals("NULL")) { gp.fillEmptyStringAsNull(); deletePM((PM)gp, out err); insertPM((PM)gp); gp.eraseNullInEmptyString(); } } catch { err += "更新替代关系错误异常 "; } } return err; }