public GJIBZ_PM(GJIBZ_PM gp) { this.wjm = gp.wjm; this.wwmc = gp.wwmc; this.wwztc = gp.wwztc; this.ys = gp.ys; this.zf = gp.zf; this.zf1 = gp.zf1; this.zfnf = gp.zfnf; this.zwmc = gp.zwmc; this.zwztc = gp.zwztc; this.bbxz = gp.bbxz; this.bdtbz = gp.bdtbz; this.bz = gp.bz; this.bzwh = gp.bzwh; this.ybzwh = gp.ybzwh; this.bzwjm = gp.bzwjm; this.cygx = gp.cygx; this.dlr = gp.dlr; this.dtbz = gp.dtbz; this.fbrq = gp.fbrq; this.flbm = gp.flbm; this.gbfl = gp.gbfl; this.zyfl = gp.zyfl; this.gxrq = gp.gxrq; this.gxx = gp.gxx; this.icsfl = gp.icsfl; this.qrnd = gp.qrnd; this.ssrq = gp.ssrq; }
/// <summary> /// 获取用户填写的国际标准篇名信息 /// </summary> /// <returns></returns> private GJIBZ_PM GetGJIBZPM() { GJIBZ_PM gjibzPM = new GJIBZ_PM(); //标准文号 gjibzPM.bzwh = this.bzwhTextBox.Text.Trim(); //分类编码 gjibzPM.flbm = this.flbmTextBox.Text; //文件名 gjibzPM.wjm = this.pdfTextBox.Text; //中文名称 gjibzPM.zwmc = this.zwmcTextBox.Text.Trim(); //版本性质 gjibzPM.bbxz = this.bbxzTextBox.Text.Trim(); //ICS分类 gjibzPM.icsfl = this.icsflTextBox.Text.Trim(); //GB分类 gjibzPM.gbfl = this.gbflTextBox.Text.Trim(); //外文名称 gjibzPM.wwmc = this.wwmcTextBox.Text.Trim(); //发布日期 if (!"".Equals(this.fbrqTextBox.Text)) { gjibzPM.fbrq = DateTime.Parse(this.fbrqTextBox.Text); } //实施日期 if (!"".Equals(this.ssrqTextBox.Text)) { gjibzPM.ssrq = DateTime.Parse(this.ssrqTextBox.Text); } //采用关系 gjibzPM.cygx = this.cygxTextBox.Text.Trim(); //代替标准 gjibzPM.dtbz = this.dtbzTextBox.Text.Trim(); //被代替标准 gjibzPM.bdtbz = this.bdtbzTextBox.Text.Trim(); //页数 if (!"".Equals(this.ysTextBox.Text)) gjibzPM.ys = Int32.Parse(this.ysTextBox.Text); //作废 gjibzPM.zf = this.zfCheckBox.Checked; //作废年份 gjibzPM.zfnf = this.zfnfTextBox.Text.Trim(); //中文主题词 gjibzPM.zwztc = this.zwztcTextBox.Text.Trim(); //外文主题词 gjibzPM.wwztc = this.wwztcTextBox.Text.Trim(); //备注 gjibzPM.bz = this.bzTextBox.Text.Trim(); //更新项 gjibzPM.gxx = this.gxxTextBox.Text.Trim(); //更新日期 try { gjibzPM.gxrq = DateTime.Parse(this.gxrqTextBox.Text.Trim()); } catch { gjibzPM.gxrq = DateTime.Now; } //登录人 gjibzPM.dlr = this.dlrTextBox.Text; return gjibzPM; }
/// <summary> /// 更新一条篇名信息 /// </summary> /// <param name="gjbz_pm">要更新的篇名信息</param> /// <param name="uname">操作用户名</param> /// <returns></returns> public Boolean UpdateGJIBZ_PM(GJIBZ_PM gjbz_pm, String uname) { Boolean flag = true; int back = sqlMapper.Update("UpdateGJIBZ_PM", gjbz_pm); if (back <= 0) { flag = false; } if (flag) { OperationLogItem operationLog = this.GetOperationLogItem(gjbz_pm, "UPDATE", uname); this.operationLogDAO.insertLogItem(operationLog); } return flag; }
/// <summary> /// 生成日志信息 /// </summary> /// <param name="zwqkPM">中文篇名信息</param> /// <param name="opType">操作类型</param> /// <param name="uname">用户名</param> /// <returns></returns> private OperationLogItem GetOperationLogItem(GJIBZ_PM gjbzPM, String opType, String uname) { if (null == gjbzPM) { return null; } OperationLogItem operationLogItem = new OperationLogItem(); //操作类型 operationLogItem.opType = opType; //数据库表 operationLogItem.opTable = "GJIBZ_PM"; //全文页数 operationLogItem.opPageCount = gjbzPM.ys; operationLogItem.opObjectID = "国际标准"; // 操作涉及的书刊 operationLogItem.opBookIn = "国际标准"; // 时间 operationLogItem.opDate = DateTime.Now; // 操作员 operationLogItem.opPerson = uname; //记录操作模式,判断是否属于批量操作。取值范围SINGLE/BATCH。 operationLogItem.opMode = "SINGLE"; //操作的内容 String content = "('" + gjbzPM.flbm + "','" + gjbzPM.bzwh + "','" + gjbzPM.wjm + "','" + gjbzPM.bbxz + "','" + gjbzPM.zwmc + "','" + gjbzPM.icsfl + "','" + gjbzPM.gbfl + "','" + gjbzPM.wwmc + "','" + gjbzPM.fbrq + "','" + gjbzPM.ssrq + "','" + gjbzPM.cygx + "','" + gjbzPM.dtbz + "','" + gjbzPM.bdtbz + "','" + gjbzPM.ys + "','" + gjbzPM.zf + "','"+gjbzPM.zf1 + "','" + gjbzPM.zfnf + "','" + gjbzPM.zwztc + "','" + gjbzPM.wwztc + "','" + gjbzPM.bz + "','" + gjbzPM.gxrq + "','" + gjbzPM.dlr + "')"; operationLogItem.opContent = content; return operationLogItem; }
/// <summary> /// 插入一条篇名信息 /// </summary> /// <param name="gjbz_pm">篇名信息</param> /// <returns></returns> public Boolean InsertGJIBZ_PM(GJIBZ_PM gjbz_pm) { Boolean flag = true; OperationLogItem operationLog = this.GetOperationLogItem(gjbz_pm, "INSERT", null); try { sqlMapper.Insert("InsertGJIBZ_PM", gjbz_pm); this.operationLogDAO.insertLogItem(operationLog); } catch (Exception) { flag = false; } return flag; }
/// <summary> /// 插入一条篇名信息 /// </summary> /// <param name="gjbz_pm">篇名信息</param> /// <returns></returns> public String InsertGJIBZ_PM(GJIBZ_PM gjbz_pm) { try { sqlMapper.Insert("InsertGJIBZ_PM", gjbz_pm); } catch (Exception e) { return e.Message; } return String.Empty; }
protected override PM getPM(OleDbDataReader reader, out String err) { err = String.Empty; GJIBZ_PM pm = new GJIBZ_PM(); if (hasFormatTable) { pm.flbm = reader["分类编码"].ToString().Trim(); pm.bzwh = reader["标准文号"].ToString(); pm.ybzwh = pm.bzwh; //记住原有的"标准文号" pm.wjm = reader["文件名"].ToString().Trim(); pm.ywjm = pm.wjm; pm.icsfl = reader["ICS分类"].ToString().Trim(); pm.gbfl = reader["GB分类"].ToString().Trim(); pm.zyfl = reader["专业分类"].ToString().Trim(); pm.bbxz = reader["版本性质"].ToString().Trim(); pm.zwmc = reader["中文名称"].ToString().Trim(); pm.wwmc = reader["外文名称"].ToString().Trim(); try { pm.isOK = Boolean.Parse(reader["强制入库"].ToString()); } catch { pm.isOK = false; } string dateStr = ""; dateStr = reader["发布日期"].ToString().Trim(); try { if (!String.Empty.Equals(dateStr)) { pm.fbrq = DateTime.Parse(dateStr); } } catch { err += pm.bzwh + ": 发布日期\"" + reader["发布日期"] + "\"出错\n"; } dateStr = reader["实施日期"].ToString().Trim(); try { if (!String.Empty.Equals(dateStr)) { pm.ssrq = DateTime.Parse(dateStr); } } catch { err += pm.bzwh + ": 实施日期\"" + reader["实施日期"] + "\"出错\n"; } pm.cygx = reader["采用关系"].ToString().Trim(); string yeshu = ""; yeshu = reader["页数"].ToString().Trim(); try { if (!String.Empty.Equals(yeshu)) { pm.ys = Int32.Parse(yeshu); } else pm.ys = 0; } catch { err += pm.bzwh + ": 页数\"" + reader["页数"] + "\"出错\n"; } try { pm.zf = Boolean.Parse(reader["作废"].ToString().Trim()); } catch (Exception) { pm.zf = false; } if (true == pm.zf) pm.zf1 = "T"; else pm.zf1 = "F"; pm.dtbz = reader["代替标准"].ToString().Trim(); pm.bdtbz = reader["被代替标准"].ToString().Trim(); pm.zfnf = reader["作废年份"].ToString().Trim(); pm.zwztc = reader["中文主题词"].ToString().Trim(); pm.wwztc = reader["外文主题词"].ToString().Trim(); pm.bz = reader["备注"].ToString().Trim(); pm.gxx = reader["更新项"].ToString().Trim(); pm.qrnd = reader["确认年代"].ToString().Trim(); } else { //不支持 } pm.isBack = false; pm.isDup = false; pm.gxrq = DateTime.Now; pm.dlr = user.name; pm.fillEmptyStringAsNull(); return pm; }
/// <summary> /// 进行追加更新 /// </summary> /// <param name="dest"></param> /// <param name="src"></param> private void AppendUpdate(GJIBZ_PM dest, GJIBZ_PM src) { if (IsEmpty(dest.wjm) && !IsEmpty(src.wjm)) dest.wjm = src.wjm; if (IsEmpty(dest.bbxz) && !IsEmpty(src.bbxz)) dest.bbxz = src.bbxz; //if (IsEmpty(dest.flbm) && !IsEmpty(src.flbm)) dest.flbm = src.flbm; if (IsEmpty(dest.icsfl) && !IsEmpty(src.icsfl)) dest.icsfl = src.icsfl; if (IsEmpty(dest.gbfl) && !IsEmpty(src.gbfl)) dest.gbfl = src.gbfl; if (IsEmpty(dest.zwmc) && !IsEmpty(src.zwmc)) dest.zwmc = src.zwmc; if (IsEmpty(dest.wwmc) && !IsEmpty(src.wwmc)) dest.wwmc = src.wwmc; if (IsEmpty(dest.cygx) && !IsEmpty(src.cygx)) dest.cygx = src.cygx; if (IsEmpty(dest.zfnf) && !IsEmpty(src.zfnf)) dest.zfnf = src.zfnf; if (IsEmpty(dest.zwztc) && !IsEmpty(src.zwztc)) dest.zwztc = src.zwztc; if (IsEmpty(dest.wwztc) && !IsEmpty(src.wwztc)) dest.wwztc = src.wwztc; if (IsEmpty(dest.ssrq) && !IsEmpty(src.ssrq)) dest.ssrq = src.ssrq; if (IsEmpty(dest.fbrq) && !IsEmpty(src.fbrq)) dest.fbrq = src.fbrq; if (IsEmpty(dest.gxx) && !IsEmpty(src.gxx)) dest.gxx = src.gxx; if (IsEmpty(dest.bz) && !IsEmpty(src.bz)) dest.bz = src.bz; //if (IsEmpty(dest.ys) && !IsEmpty(src.ys)) dest.ys = src.ys; //if (IsEmpty(dest.zf) && !IsEmpty(src.zf)) dest.zf = src.zf; if (0 != src.ys) dest.ys = src.ys; dest.zf |= src.zf; if (true == dest.zf) dest.zf1 = "T"; else dest.zf1 = "F"; //if (IsEmpty(dest.dtbz) && !IsEmpty(src.dtbz)) dest.dtbz = src.dtbz; //if (IsEmpty(dest.bdtbz) && !IsEmpty(src.bdtbz)) dest.bdtbz = src.bdtbz; dest.dtbz = BZMethod.MergeDTGX(src.dtbz, dest.dtbz); dest.bdtbz = BZMethod.MergeDTGX(src.bdtbz, dest.bdtbz); }
/*** * 查找相同类标准的潜在替代关系 */ 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; }
/// <summary> /// 进行题录页数更新 /// </summary> /// <param name="wjm"></param> /// <param name="flbm"></param> /// <param name="bz"></param> public void UpdatePageNumber(string wjm, string flbm, GJIBZ_PM bz) { string path = destFolder + ConstructWjmPath(flbm); if (File.Exists(path + wjm)) { try { PdfReader pdf = new PdfReader(path + wjm); if (null != pdf) { bz.ys = pdf.NumberOfPages; pdf.Close(); } } catch { } } }
public override string formatData(PM pm) { //反馈信息 String result = String.Empty; String Empty = "NULL"; GJIBZ_PM gjibz = (GJIBZ_PM)pm; /* 通过专业分类查找flbm */ if (!gjibz.zyfl.Equals(Empty)) { string[] fl_arr = gjibz.zyfl.Split(';'); for (int i = fl_arr.Length - 1; i >= 0; i--) { gjibz.flbm = GetFlbmByZyfl(fl_arr[i]); if (!Empty.Equals(gjibz.flbm)) break; } } /*** * 处理标准文号中特殊年份后缀 */ gjibz.bzwh = gjibz.bzwh.Trim(); gjibz.bzwh = BZMethod.ReformYearString(gjibz.bzwh); gjibz.bzwh = ExtractGjibzQrnd(gjibz); string BZWH=gjibz.bzwh, bbxz=""; result += FormatBZWH(ref BZWH, ref bbxz); gjibz.bzwh = BZWH; gjibz.bzwh = PostFormatBzwh(gjibz.bzwh); /* 处理德国、法国标准中代替标准 */ if (gjibz.bzwh.StartsWith("DIN ") || gjibz.bzwh.StartsWith("NF ")) { gjibz.dtbz = AmendDtbzwh(gjibz.dtbz, gjibz.bzwh); gjibz.bdtbz = AmendDtbzwh(gjibz.bdtbz, gjibz.bzwh); } if (!"".Equals(bbxz)) gjibz.bbxz = bbxz; gjibz.wjm = BZMethod.BzwhToWjm(BZWH); /* 标准文号规范完成后,通过相似标准文号查找flbm */ if (gjibz.flbm.Equals(Empty)) { gjibz.flbm = GetFlbmByHistBZWH(gjibz.bzwh); } /* 通过标准文号的文件特征查找flbm */ /***** /* 根据代替标准查找相似标准的分类编码 / if (gjibz.flbm.Equals(Empty)) { if (!gjibz.dtbz.Equals(Empty)) { string[] dtbz_wh = gjibz.dtbz.Split(';'); foreach (string wh in dtbz_wh) { gjibz.flbm = GetFlbmByHistBZWH(gjibz.bzwh, wh); if (!gjibz.flbm.Equals(Empty)) break; } } } if (gjibz.flbm.Equals(Empty)) { gjibz.flbm = wb_get_flbm_by_wjtz(gjibz.bzwh); } *****/ /* 默认的分类编码 */ if (gjibz.flbm.Equals(Empty)) { //gjibz.flbm = "B1"; result += "未找到合适的分类编码 "; } string notnull = "notnull"; string dterr = ""; /* 规范代替标准,被代替标准 */ if (!gjibz.dtbz.Equals("NULL")) { string[] dtbz = gjibz.dtbz.Split(';'); dterr += FormatBZWH(ref dtbz[0], ref notnull); gjibz.dtbz = dtbz[0]; for (int i = 1; i < dtbz.Length; i++) { dterr += FormatBZWH(ref dtbz[i], ref notnull); gjibz.dtbz += ";" + dtbz[i]; } gjibz.dtbz = BZMethod.dtBzwhSort(gjibz.dtbz); } if (!gjibz.bdtbz.Equals("NULL")) { string[] bdtbz = gjibz.bdtbz.Split(';'); dterr += FormatBZWH(ref bdtbz[0], ref notnull); gjibz.bdtbz = bdtbz[0]; for (int i = 1; i < bdtbz.Length; i++) { dterr += FormatBZWH(ref bdtbz[i], ref notnull); gjibz.bdtbz += ";" + bdtbz[i]; } gjibz.bdtbz = BZMethod.dtBzwhSort(gjibz.bdtbz); } if (!"".Equals(dterr)) { dterr = "相关代替标准:" + dterr; } result += dterr; gjibz.zwmc = GlobalMethod.RemoveQues(gjibz.zwmc); gjibz.flbm = GlobalMethod.Semicolon(gjibz.flbm); gjibz.icsfl = GlobalMethod.Semicolon(gjibz.icsfl); gjibz.gbfl = GlobalMethod.Semicolon(gjibz.gbfl); gjibz.zwztc = GlobalMethod.Semicolon(gjibz.zwztc); gjibz.wwztc = GlobalMethod.Semicolon(gjibz.wwztc); gjibz.dlr = user.name; gjibz.gxrq = DateTime.Now; gjibz.bzwjm = Empty; //分类编码可能有多个,以分类隔开 String[] flbms = gjibz.flbm.Split(';'); foreach (string flbm in flbms) { if (gjibzDAO.GetGJIBZ_FLByFlbm(flbm) == null) { result += "分类编码" + flbm + "不存在 "; } else { string bzwjm = fileFolder + ConstructWjmPath(flbm); if (Directory.Exists(bzwjm)) { bzwjm += gjibz.wjm; if (File.Exists(bzwjm)) gjibz.bzwjm = bzwjm; } } } /* 补全同类标准的空缺字段 */ string prefix = gjibz.bzwh.Substring(0, gjibz.bzwh.LastIndexOf('-') + 1); if (null != prev_gjibz.bzwh && prev_gjibz.bzwh.IndexOf(prefix) >= 0) { if (gjibz.icsfl.Equals("NULL")) gjibz.icsfl = prev_gjibz.icsfl; if (gjibz.gbfl.Equals("NULL")) gjibz.gbfl = prev_gjibz.gbfl; } prev_gjibz = gjibz; if (Empty.Equals(gjibz.zwmc) && Empty.Equals(gjibz.wwmc)) { result += " 中、英名称为空 "; } if (result.Equals(String.Empty)) { //拆分连续标准文号 String toSplitBzwh = gjibz.bzwh; seqBzwh = BZMethod.SplitSeqBZWH(gjibz.bzwh); foreach (String newBzwh in seqBzwh) { gjibz.bzwh = newBzwh; gjibz.wjm = BZMethod.BzwhToWjm(newBzwh); gjibz.fillEmptyStringAsNull(); GJIBZ_PM gipm = new GJIBZ_PM(gjibz); gipm.bzwh = newBzwh; gipm.wjm = gjibz.wjm; gipm.ybzwh = gipm.bzwh; seqList.Add((PM)gipm); } if (seqBzwh.Count > 0) { /* 拆分之后,删除原始记录 */ gjibz.bzwh = toSplitBzwh; gjibz.isValid = false; string err; deletePM((PM)gjibz, out err); } } /* 强制入库 */ if (gjibz.isOK) { gjibz.isValid = true; return String.Empty; } if (!result.Equals(String.Empty)) result += pmKeyInfo(pm); return result; }
/// <summary> /// 进行标准的代替关系更新 /// </summary> /// <param name="bzPM"></param> public void DTGX_CheckUpdate(GJIBZ_PM bzPM) { string dtbz = bzPM.dtbz; string[] dtbz_arr = dtbz.Split(';'); /** * 更新代替关系 */ string bzwh; for (int i = 0; i < dtbz_arr.Length; i++) { bzwh = dtbz_arr[i]; GJIBZ_PM oldBZ = gjibzDAO.GetGJIBZ_PMByBzwh(bzwh); if (null != oldBZ) { DTGX_Update(oldBZ, bzPM); } } string bdtbz = bzPM.bdtbz; string[] bdtbz_arr = bdtbz.Split(';'); /** * 更新被代替关系 */ for (int i = 0; i < bdtbz_arr.Length; i++) { bzwh = bdtbz_arr[i]; GJIBZ_PM newBZ = gjibzDAO.GetGJIBZ_PMByBzwh(bzwh); if (null != newBZ) { DTGX_Update(bzPM, newBZ); } } }
/// <summary> /// 找到标准文件并进行上传,同时删除该条记录 /// </summary> /// <param name="gjibz"></param> private string UploadBZfile(GJIBZ_PM gjibz) { string ret = ""; string path = ConstructWjmPath(gjibz.flbm); if (gjibz.bzwjm.Equals("NULL")) { ret = gjibz.wjm; gjibz.wjm = gjibz.ywjm; return "对应的文件\"" + ret + "\"不存在.\n"; } String bzwjm = fileFolder + path; /* 存在该标准的文件,则进行上传 */ if (File.Exists(bzwjm + gjibz.wjm)) { gjibz.bzwjm = bzwjm + gjibz.wjm; try { PdfReader pdf = new PdfReader(gjibz.bzwjm); if (null != pdf) { gjibz.ys = pdf.NumberOfPages; pdf.Close(); } else gjibz.ys = 0; } catch { gjibz.ys = 0; return gjibz.wjm + " PDF文件存在问题"; } FileMove.MoveFile(gjibz.bzwjm, gjibz.wjm, destFolder + path); File.Delete(gjibz.bzwjm); } else gjibz.wjm = gjibz.ywjm; return ret; }
private String ExtractGjibzQrnd(GJIBZ_PM gjibz) { string bzwh = gjibz.bzwh; /* 特殊情况处理:提取版本性质 */ int posi = -1; if ((posi = bzwh.IndexOf("(Vol")) >= 0) { String partBbxz = ""; for (int i = posi+1; i < bzwh.Length; i++) { if (bzwh[i] == ')') break; partBbxz += bzwh[i]; } gjibz.bbxz = partBbxz; bzwh = bzwh.Replace(partBbxz, ""); } posi = -1; if ((posi = bzwh.IndexOf("(R")) >= 0 && posi >= bzwh.LastIndexOf("-")) { String partBbxz = ""; for (int i = posi+1; i < bzwh.Length; i++) { if (bzwh[i] == ')') break; partBbxz += bzwh[i]; } gjibz.bbxz = partBbxz; bzwh = bzwh.Replace(partBbxz, ""); bzwh = bzwh.Replace("()", ""); } if (bzwh.IndexOf('-') >= 0) { string bzwh_posfix = bzwh.Substring(bzwh.LastIndexOf('-') + 1); string bzwh_prefix = bzwh.Substring(0, bzwh.LastIndexOf('-')); /* 年份后面的其他内容迁移到‘-’之前 */ if (bzwh_posfix.Length > 4) { /* 提取确认年份 */ int s = bzwh_posfix.IndexOf('('); int t = bzwh_posfix.IndexOf(')'); if (s >= 4 && t - s == 5) { string qrnd = bzwh_posfix.Substring(s + 1, 4); try { int year = Int32.Parse(qrnd); if (year > 1700 && year < 2700) { bzwh_posfix = bzwh_posfix.Remove(s, t - s); bzwh_posfix = bzwh_posfix.Replace(')', ' '); gjibz.qrnd = qrnd; } } catch { } } /* 剩下的前移 */ if (bzwh_posfix.Length > 4) bzwh_prefix += " "; for (int i = 4; i < bzwh_posfix.Length; i++) { bzwh_prefix += bzwh_posfix[i]; } if (bzwh_posfix.Length > 4) bzwh = bzwh_prefix + "-" + bzwh_posfix.Substring(0, 4); else bzwh = bzwh_prefix + "-" + bzwh_posfix; } else bzwh = bzwh_prefix + "-" + bzwh_posfix; } return bzwh; }
/// <summary> /// 根据“代替关系“进行代替项的更新,包括”代替标准“与”被代替标准“ /// </summary> /// <param name="oldGjbz"></param> /// <param name="newGjbz"></param> private void DTGX_Update(GJIBZ_PM oldBZ, GJIBZ_PM newBZ) { string bdtbzOfOldBZ = oldBZ.bdtbz; string dtbzOfNewBZ = newBZ.dtbz; if (null == bdtbzOfOldBZ) bdtbzOfOldBZ = oldBZ.bdtbz = ""; if (null == dtbzOfNewBZ) dtbzOfNewBZ = newBZ.dtbz = ""; /** * 更新“被代替标准”的“被代替”字段 */ string bzwhOfNewBZ = newBZ.bzwh; if (bdtbzOfOldBZ.IndexOf(bzwhOfNewBZ) < 0) { if (!"".Equals(bdtbzOfOldBZ)) oldBZ.bdtbz += ";"; oldBZ.bdtbz += bzwhOfNewBZ; oldBZ.bdtbz = BZMethod.dtBzwhSort(oldBZ.bdtbz); if (GlobalMethod.IsBzInvalid(newBZ.ssrq)) { oldBZ.zf = true; oldBZ.zf1 = "T"; } gjibzDAO.UpdateGJIBZ_PM(oldBZ, user.name); } /** * 更新“代替标准”的“代替”字段 */ string bzwhOfOldBZ = oldBZ.bzwh; if (dtbzOfNewBZ.IndexOf(bzwhOfOldBZ) < 0) { if (!"".Equals(dtbzOfNewBZ)) newBZ.dtbz += ";"; newBZ.dtbz += bzwhOfOldBZ; newBZ.dtbz = BZMethod.dtBzwhSort(newBZ.dtbz); gjibzDAO.UpdateGJIBZ_PM(newBZ, user.name); } }