예제 #1
0
파일: HYBZ_PM.cs 프로젝트: Brinews/Code
        public HYBZ_PM(HYBZ_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.bzdhhy = gp.bzdhhy;
            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.fbdw = gp.fbdw;
            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.qcdw = gp.qcdw;
            this.ssrq = gp.ssrq;

            this.gkdw = gp.gkdw;
            this.ly = gp.ly;
            this.qrnd = gp.qrnd;
        }
예제 #2
0
파일: EditPM.aspx.cs 프로젝트: Brinews/Code
    /// <summary>
    /// 获取用户填写的行业标准篇名信息
    /// </summary>
    /// <returns></returns>
    private HYBZ_PM GetHYBZPM()
    {
        HYBZ_PM hybzPM = new HYBZ_PM();
        //标准文号
        hybzPM.bzwh = this.bzwhTextBox.Text.Trim();
        //分类编码
        hybzPM.flbm = this.flbmTextBox.Text;
        //文件名
        hybzPM.wjm = this.pdfHyperLink.Text;
        //中文名称
        hybzPM.zwmc = this.zwmcTextBox.Text.Trim();
        //版本性质
        hybzPM.bbxz = this.bbxzTextBox.Text.Trim();
        //ICS分类
        hybzPM.icsfl = this.icsflTextBox.Text.Trim();
        //GB分类
        hybzPM.gbfl = this.gbflTextBox.Text.Trim();
        //外文名称
        hybzPM.wwmc = this.wwmcTextBox.Text.Trim();
        //发布日期
        if (!"".Equals(this.fbrqTextBox.Text))
        {
            hybzPM.fbrq = DateTime.Parse(this.fbrqTextBox.Text);
        }
        //实施日期
        if (!"".Equals(this.ssrqTextBox.Text))
        {
            hybzPM.ssrq = DateTime.Parse(this.ssrqTextBox.Text);
        }
        //采用关系
        hybzPM.cygx = this.cygxTextBox.Text.Trim();
        //代替标准
        hybzPM.dtbz = this.dtbzTextBox.Text.Trim();
        //被代替标准
        hybzPM.bdtbz = this.bdtbzTextBox.Text.Trim();
        //页数
        if (!"".Equals(this.ysTextBox.Text))
            hybzPM.ys = Int32.Parse(this.ysTextBox.Text);
        //作废
        hybzPM.zf = this.zfCheckBox.Checked;
        //作废年份
        hybzPM.zfnf = this.zfnfTextBox.Text.Trim();
        //中文主题词
        hybzPM.zwztc = this.zwztcTextBox.Text.Trim();
        //外文主题词
        hybzPM.wwztc = this.wwztcTextBox.Text.Trim();
        //起草单位
        hybzPM.qcdw = this.qcdwTextBox.Text.Trim();
        //发布单位
        hybzPM.fbdw = this.fbdwTextBox.Text.Trim();
        //归口单位
        hybzPM.gkdw = this.gkdwTextBox.Text.Trim();
        //备注
        hybzPM.bz = this.bzTextBox.Text.Trim();
        //标准代号含义
        hybzPM.bzdhhy = this.bzdhhyTextBox.Text.Trim();
        //来源
        hybzPM.ly = this.lyTextBox.Text.Trim();
        //更新项
        hybzPM.gxx = this.gxxTextBox.Text.Trim();
        //更新日期
        try
        {
            hybzPM.gxrq = DateTime.Parse(this.gxrqTextBox.Text.Trim());
        }
        catch
        {
            hybzPM.gxrq = DateTime.Now;
        }
        //确认年代
        hybzPM.qrnd = this.qrndTextBox.Text.Trim();
        //登录人
        hybzPM.dlr = this.dlrTextBox.Text.Trim();

        return hybzPM;
    }
예제 #3
0
파일: HYBZ_DAO.cs 프로젝트: Brinews/Code
        /// <summary>
        /// 生成日志信息
        /// </summary>
        /// <param name="zwqkPM">中文篇名信息</param>
        /// <param name="opType">操作类型</param>
        /// <param name="uname">用户名</param>
        /// <returns></returns>
        private OperationLogItem GetOperationLogItem(HYBZ_PM hybzPM, String opType, String uname)
        {
            if (null == hybzPM)
            {
                return null;
            }

            OperationLogItem operationLogItem = new OperationLogItem();
            //操作类型
            operationLogItem.opType = opType;
            //数据库表
            operationLogItem.opTable = "HYBZ_PM";
            //全文页数
            operationLogItem.opPageCount = hybzPM.ys;

            operationLogItem.opObjectID = "行业标准";
            // 操作涉及的书刊
            operationLogItem.opBookIn = "行业标准";

            // 时间
            operationLogItem.opDate = DateTime.Now;
            // 操作员
            operationLogItem.opPerson = uname;
            //记录操作模式,判断是否属于批量操作。取值范围SINGLE/BATCH。
            operationLogItem.opMode = "SINGLE";

            //操作的内容
            String content = "('" +
                hybzPM.flbm + "','" + hybzPM.bzwh + "','" +
                hybzPM.wjm + "','" + hybzPM.bbxz + "','" +
                hybzPM.zwmc + "','" + hybzPM.icsfl + "','" +
                hybzPM.gbfl + "','" + hybzPM.wwmc + "','" +
                hybzPM.fbrq + "','" + hybzPM.ssrq + "','" +
                hybzPM.cygx + "','" + hybzPM.dtbz + "','" +
                hybzPM.bdtbz + "','" + hybzPM.ys + "','" +
                hybzPM.zf + "','" + hybzPM.zf1 + "','" + hybzPM.zfnf + "','" +
                hybzPM.zwztc + "','" + hybzPM.wwztc + "','" +
                hybzPM.qcdw + "','" + hybzPM.fbdw + "','" +
                hybzPM.gkdw + "','" + hybzPM.bz + "','" +
                hybzPM.bzdhhy + "','" + hybzPM.ly + "','" +
                hybzPM.qrnd + "','" + hybzPM.gxrq + "','" +
                hybzPM.dlr +
                "')";
            operationLogItem.opContent = content;
            return operationLogItem;
        }
예제 #4
0
파일: HYBZ_DAO.cs 프로젝트: Brinews/Code
        /// <summary>
        /// 插入一条篇名信息
        /// </summary>
        /// <param name="hybz_pm">篇名信息</param>
        /// <returns></returns>
        public String InsertHYBZ_PM(HYBZ_PM hybz_pm)
        {
            try
            {
                sqlMapper.Insert("InsertHYBZ_PM", hybz_pm);
            }
            catch (Exception e)
            {
                return e.Message;
            }

            return String.Empty;
        }
예제 #5
0
파일: HYBZ_DAO.cs 프로젝트: Brinews/Code
 /// <summary>
 /// 更新一条篇名信息
 /// </summary>
 /// <param name="hybz_pm">要更新的篇名信息</param>
 /// <param name="uname">操作用户名</param>
 /// <returns></returns>
 public Boolean UpdateHYBZ_PM(HYBZ_PM hybz_pm, String uname)
 {
     Boolean flag = true;
     int back = sqlMapper.Update("UpdateHYBZ_PM", hybz_pm);
     if (back <= 0)
     {
         flag = false;
     }
     if (flag)
     {
         OperationLogItem operationLog = this.GetOperationLogItem(hybz_pm, "UPDATE", uname);
         this.operationLogDAO.insertLogItem(operationLog);
     }
     return flag;
 }
예제 #6
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
 /// <summary>
 /// 进行题录页数更新
 /// </summary>
 /// <param name="wjm"></param>
 /// <param name="flbm"></param>
 /// <param name="bz"></param>
 public void UpdatePageNumber(string wjm, string flbm, HYBZ_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 { }
     }
 }
예제 #7
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
        protected override PM getPM(OleDbDataReader reader, out String err)
        {
            err = String.Empty;
            HYBZ_PM pm = new HYBZ_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.qcdw = reader["起草单位"].ToString().Trim();
                pm.fbdw = reader["发布单位"].ToString().Trim();
                pm.gkdw = reader["归口单位"].ToString().Trim();
                pm.bzdhhy = reader["标准代号含义"].ToString().Trim();
                pm.bz = reader["备注"].ToString().Trim();
                pm.gxx = reader["更新项"].ToString().Trim();

                pm.qrnd = reader["确认年代"].ToString().Trim();
                pm.ly = reader["来源"].ToString().Trim();

            }
            else
            {
                //不支持
            }

            pm.gxrq = DateTime.Now;
            pm.dlr = user.name;
            pm.fillEmptyStringAsNull();

            return pm;
        }
예제 #8
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
        public override string formatData(PM pm)
        {
            //反馈信息
            String result = String.Empty;
            String Empty = "NULL";
            HYBZ_PM hybz = (HYBZ_PM)pm;

            //规范“标准文号”
            hybz.bzwh = GlobalMethod.CharConvert(hybz.bzwh);
            hybz.dtbz = GlobalMethod.CharConvert(hybz.dtbz);
            hybz.bdtbz = GlobalMethod.CharConvert(hybz.bdtbz);

            if (!BZMethod.BzwhWordsValidate(hybz.bzwh))
                goto bzwh_err;

            hybz.bzwh = DashToSpace(hybz.bzwh);

            hybz.bzwh = hybz.bzwh.Trim();
            /* 文号中年份后的(year),把year放入确认年份中 */
            hybz.bzwh = ExtractQrnd(hybz);

            string bbxz = hybz.bbxz;
            hybz.bzwh = BZMethod.HBSlashHandler(hybz.bzwh);
            hybz.bzwh = FormatBZWH(hybz.bzwh, ref bbxz, out result);
            hybz.bzwh = SuppFormat(hybz.bzwh);
            hybz.bbxz = bbxz;
            hybz.wjm = BZMethod.BzwhToWjm(hybz.bzwh, hybz.bbxz);

            hybz.dtbz = PreprocessDtbz(hybz.dtbz);
            hybz.bdtbz = PreprocessDtbz(hybz.bdtbz);

            string r="", notnull = "notnull";
            if (!hybz.dtbz.Equals("NULL"))
            {
                string[] dtbz = hybz.dtbz.Split(';');
                hybz.dtbz = FormatBZWH(dtbz[0], ref notnull, out r);
                for (int i = 1; i < dtbz.Length; i++)
                {
                    hybz.dtbz += ";" + FormatBZWH(dtbz[i], ref notnull, out r);
                }

                hybz.dtbz = BZMethod.dtBzwhSort(hybz.dtbz);
            }

            if (!"".Equals(r))
            {
                r = " 代替标准:" + r;
                result += r;
            }

            if (!hybz.bdtbz.Equals("NULL"))
            {
                string[] bdtbz = hybz.bdtbz.Split(';');
                hybz.bdtbz = FormatBZWH(bdtbz[0], ref notnull, out r);
                for (int i = 1; i < bdtbz.Length; i++)
                {
                    hybz.bdtbz += ";" + FormatBZWH(bdtbz[i], ref notnull, out r);
                }

                hybz.bdtbz = BZMethod.dtBzwhSort(hybz.bdtbz);
            }

            if (!"".Equals(r))
            {
                r = " 被代替标准:" + r;
                result += r;
            }

            hybz.zwmc = GlobalMethod.RemoveQues(hybz.zwmc);
            hybz.flbm = GlobalMethod.Semicolon(hybz.flbm);
            hybz.icsfl = GlobalMethod.Semicolon(hybz.icsfl);
            hybz.gbfl = GlobalMethod.Semicolon(hybz.gbfl);
            hybz.zwztc = GlobalMethod.Semicolon(hybz.zwztc);
            hybz.wwztc = GlobalMethod.Semicolon(hybz.wwztc);
            hybz.dlr = user.name;
            hybz.gxrq = DateTime.Now;

            hybz.bzwjm = Empty;

            /* 通过专业分类查找flbm */
            if (!hybz.zyfl.Equals(Empty))
            {
                String[] fl_arr = hybz.zyfl.Split(';');
                for (int i = fl_arr.Length - 1; i >= 0; i--)
                {
                    hybz.flbm = GetFlbmByZyfl(fl_arr[i]);
                    if (!Empty.Equals(hybz.flbm))
                        break;
                }
            }

            /* 通过wjtz查找flbm */
            if (hybz.flbm.Equals(Empty))
            {
                if (hybz.bzwh.IndexOf(' ') >= 0)
                {
                    hybz.flbm = GetFlbmByWjtz(hybz.bzwh.Split(' ')[0]);
                }
            }

            /* 通过相似标准文号查找flbm */
            if (hybz.flbm.Equals(Empty))
            {
                hybz.flbm = GetFlbmByHistBZWH(hybz.bzwh);
            }

            /***
             * 根据代替标准进行分类编码的查找
             */
            if (hybz.flbm.Equals(Empty))
            {
                if (!hybz.dtbz.Equals(Empty))
                {
                    string[] hybz_wh = hybz.dtbz.Split(';');
                    foreach (string bz in hybz_wh)
                    {
                        hybz.flbm = GetFlbmByHistBZWH(hybz.bzwh, bz);
                        if (!hybz.flbm.Equals(Empty)) break;
                    }
                }
            }

            /***
             * 特殊标准分类处理
             */
            if (hybz.bzwh.StartsWith("JGJ "))
            {
                hybz.flbm = "B3JG";
            }

            /* 默认的分类编码 */
            if (hybz.flbm.Equals(Empty))
            {
                //hybz.flbm = "B3";
                result += "未找到合适的分类编码 ";
            }

            //分类编码可能有多个,以分类隔开
            String[] flbms = hybz.flbm.Split(';');
            foreach (string flbm in flbms)
            {
                if (hybzDAO.GetHYBZ_FLByFlbm(flbm) == null)
                {
                    result += "分类编码" + flbm + "不存在 ";
                }
                else
                {
                    string bzwjm = fileFolder + ConstructWjmPath(flbm);

                    if (Directory.Exists(bzwjm))
                    {
                        bzwjm += hybz.wjm;
                        if (File.Exists(bzwjm))
                            hybz.bzwjm = bzwjm;
                    }
                }
            }

            /* 补全同类标准的空缺字段 */
            string prefix = hybz.bzwh.Substring(0, hybz.bzwh.LastIndexOf('-') + 1);
            if (null != prev_hybz.bzwh && prev_hybz.bzwh.IndexOf(prefix) >= 0)
            {
                if (hybz.icsfl.Equals("NULL")) hybz.icsfl = prev_hybz.icsfl;
                if (hybz.gbfl.Equals("NULL")) hybz.gbfl = prev_hybz.gbfl;
            }
            prev_hybz = hybz;

            if (Empty.Equals(hybz.zwmc))
            {
                result += "中文名称为空 ";
            }

            if (result.Equals(String.Empty))
            {
                //拆分连续标准文号
                String toSplitBzwh = hybz.bzwh;
                seqBzwh = BZMethod.SplitSeqBZWH(hybz.bzwh);

                foreach (String newBzwh in seqBzwh)
                {
                    hybz.bzwh = newBzwh;
                    hybz.wjm = BZMethod.BzwhToWjm(newBzwh, hybz.bbxz);

                    hybz.fillEmptyStringAsNull();

                    HYBZ_PM hpm = new HYBZ_PM(hybz);
                    hpm.bzwh = newBzwh;
                    hpm.wjm = hybz.wjm;
                    hpm.ybzwh = hpm.bzwh;
                    seqList.Add((PM)hpm);
                }

                if (seqBzwh.Count > 0)
                {
                    /* 拆分之后,删除原始记录 */
                    hybz.bzwh = toSplitBzwh;
                    hybz.isValid = false;
                    string err;
                    deletePM((PM)hybz, out err);
                }
            }

            if (String.Empty.Equals(result) && !hybz.isOK && !isBZWHQualified(hybz.bzwh))
            {
                hybz.isValid = false;
                goto bzwh_err;
            }

            if (!result.Equals(String.Empty))
                result += pmKeyInfo(pm);

            return result;

            bzwh_err:
            result += "标准文号不能够正确识别 ";
            result += pmKeyInfo(pm);

            return result;
        }
예제 #9
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
        /// <summary>
        /// 更新潜在的替代标准和被替代标准关系
        /// </summary>
        /// <param name="gp"></param>
        /// <returns></returns>
        public String UpdateDTBZ(HYBZ_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);

            //找到代替的标准,只代替最近的标准
            HYBZ_PM gpm = hybzDAO.GetAlikeHYBZ_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";
                }

                string bzwh_full = ComposeFullBZWH(gp);

                if (gpm.bdtbz == null)
                {
                    gpm.bdtbz = bzwh_full;
                }
                else if (gpm.bdtbz.IndexOf(gp.bzwh) < 0 && gpm.bdtbz.IndexOf(bzwh_full) < 0)
                {
                    if (!"".Equals(gpm.bdtbz)) gpm.bdtbz += ";";
                    gpm.bdtbz += bzwh_full;
                }

                bzwh_full = ComposeFullBZWH(gpm);

                if (gp.dtbz == null)
                {
                    gp.dtbz = bzwh_full;
                }
                else if (gp.dtbz.IndexOf(gpm.bzwh) < 0 && gp.dtbz.IndexOf(bzwh_full) < 0)
                {
                    if (!"".Equals(gp.dtbz)) gp.dtbz += ";";
                    gp.dtbz += bzwh_full;
                }

                try
                {
                    hybzDAO.UpdateHYBZ_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;
        }
예제 #10
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
        /// <summary>
        /// 找到标准文件并进行上传,同时删除该条记录
        /// </summary>
        /// <param name="hybz"></param>
        private string UploadBZfile(HYBZ_PM hybz)
        {
            string ret = "";
            string path = ConstructWjmPath(hybz.flbm);

            if (hybz.bzwjm.Equals("NULL"))
            {
                ret = hybz.wjm;
                hybz.wjm = hybz.ywjm;
                return "对应的文件\"" + ret + "\"不存在.\n";
            }

            String bzwjm = fileFolder + path;
            /* 存在该标准的文件,则进行上传 */
            if (File.Exists(bzwjm + hybz.wjm))
            {
                hybz.bzwjm = bzwjm + hybz.wjm;

                try
                {
                    PdfReader pdf = new PdfReader(hybz.bzwjm);
                    if (null != pdf)
                    {
                        hybz.ys = pdf.NumberOfPages;

                        pdf.Close();
                    }
                    else
                        hybz.ys = 0;
                }
                catch
                {
                    hybz.ys = 0;
                    return hybz.wjm + " PDF文件存在问题";
                }

                FileMove.MoveFile(hybz.bzwjm, hybz.wjm, destFolder + path);

                File.Delete(hybz.bzwjm);
            }
            else
                hybz.wjm = hybz.ywjm;

            return ret;
        }
예제 #11
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
        /// <summary>
        /// 进行标准的代替关系更新
        /// </summary>
        /// <param name="bzPM"></param>
        public void DTGX_CheckUpdate(HYBZ_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];
                bzwh = bzwh.Replace("/T", "");
                bzwh = bzwh.Replace("/Z", "");

                HYBZ_PM oldBZ = hybzDAO.GetHYBZ_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];
                bzwh = bzwh.Replace("/T", "");
                bzwh = bzwh.Replace("/Z", "");

                HYBZ_PM newBZ = hybzDAO.GetHYBZ_PMByBzwh(bzwh);

                if (null != newBZ)
                {
                    DTGX_Update(bzPM, newBZ);
                }
            }
        }
예제 #12
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
        private string ExtractQrnd(HYBZ_PM hybz)
        {
            string bzwh = hybz.bzwh;

            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(')', ' ');
                                hybz.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;
        }
예제 #13
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
        /// <summary>
        /// 根据“代替关系“进行代替项的更新,包括”代替标准“与”被代替标准“
        /// </summary>
        /// <param name="oldGjbz"></param>
        /// <param name="newGjbz"></param>
        private void DTGX_Update(HYBZ_PM oldBZ, HYBZ_PM newBZ)
        {
            string bdtbzOfOldBZ = oldBZ.bdtbz;
            string dtbzOfNewBZ = newBZ.dtbz;

            if (null == bdtbzOfOldBZ) bdtbzOfOldBZ = oldBZ.bdtbz = "";
            if (null == dtbzOfNewBZ) dtbzOfNewBZ = newBZ.dtbz = "";

            /**
             * 更新“被代替标准”的“被代替”字段
             */
            string bzwhOfNewBZ = ComposeFullBZWH(newBZ);
            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";
                }

                hybzDAO.UpdateHYBZ_PM(oldBZ, user.name);
            }

            /**
             * 更新“代替标准”的“代替”字段
             */
            string bzwhOfOldBZ = ComposeFullBZWH(oldBZ);
            if (dtbzOfNewBZ.IndexOf(bzwhOfOldBZ) < 0)
            {
                if (!"".Equals(dtbzOfNewBZ)) newBZ.dtbz += ";";
                newBZ.dtbz += bzwhOfOldBZ;
                newBZ.dtbz = BZMethod.dtBzwhSort(newBZ.dtbz);

                hybzDAO.UpdateHYBZ_PM(newBZ, user.name);
            }
        }
예제 #14
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
        /// <summary>
        /// 根据版本性质恢复原有的标准文号
        /// </summary>
        /// <param name="gp"></param>
        /// <returns></returns>
        string ComposeFullBZWH(HYBZ_PM gp)
        {
            string ret = gp.bzwh.Substring(0, gp.bzwh.IndexOf(' '));

            if (gp.bbxz != null && (gp.bbxz.Equals("T") || gp.bbxz.Equals("Z")))
            {
                ret += "/" + gp.bbxz;
            }

            ret += gp.bzwh.Substring(gp.bzwh.IndexOf(' '));

            return ret;
        }
예제 #15
0
파일: HYBZ_MDB.cs 프로젝트: Brinews/Code
 /// <summary>
 /// 进行追加更新
 /// </summary>
 /// <param name="dest"></param>
 /// <param name="src"></param>
 private void AppendUpdate(HYBZ_PM dest, HYBZ_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.fbdw) && !IsEmpty(src.fbdw)) dest.fbdw = src.fbdw;
     if (IsEmpty(dest.qcdw) && !IsEmpty(src.qcdw)) dest.qcdw = src.qcdw;
     if (IsEmpty(dest.gkdw) && !IsEmpty(src.gkdw)) dest.gkdw = src.gkdw;
     if (IsEmpty(dest.qrnd) && !IsEmpty(src.qrnd)) dest.qrnd = src.qrnd;
     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.bzdhhy) && !IsEmpty(src.bzdhhy)) dest.bzdhhy = src.bzdhhy;
     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);
 }
예제 #16
0
파일: HYBZ_DAO.cs 프로젝트: Brinews/Code
 /// <summary>
 /// 插入一条篇名信息
 /// </summary>
 /// <param name="hybz_pm">篇名信息</param>
 /// <returns></returns>
 public Boolean InsertHYBZ_PM(HYBZ_PM hybz_pm)
 {
     Boolean flag = true;
     OperationLogItem operationLog = this.GetOperationLogItem(hybz_pm, "INSERT", null);
     try
     {
         sqlMapper.Insert("InsertHYBZ_PM", hybz_pm);
         this.operationLogDAO.insertLogItem(operationLog);
     }
     catch (Exception)
     {
         flag = false;
     }
     return flag;
 }