Ejemplo n.º 1
0
        public GJBZ_PM(GJBZ_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.gxrq = gp.gxrq;
            this.gxx = gp.gxx;
            this.icsfl = gp.icsfl;
            this.pzdw = gp.pzdw;
            this.qcdw = gp.qcdw;
            this.ssrq = gp.ssrq;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 在读取数据前,插入一个"原标准文号列"
        /// </summary>
        /// <param name="reader"></param>
        /// <param name="err"></param>
        /// <returns></returns>
        protected override PM getPM(OleDbDataReader reader, out String err)
        {
            err = String.Empty;
            GJBZ_PM pm = new GJBZ_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.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 += "发布日期\"" + reader["发布日期"] + "\"出错 ";
                }

                dateStr = reader["实施日期"].ToString().Trim();
                try
                {
                    if (!String.Empty.Equals(dateStr))
                    {
                        pm.ssrq = DateTime.Parse(dateStr);
                    }
                }
                catch
                {
                    err += "实施日期\"" + reader["实施日期"] + "\"出错 ";
                }

                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 += "页数\"" + reader["页数"] + "\"出错 ";
                }

                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.pzdw = reader["批准单位"].ToString().Trim();
                pm.bzdhhy = reader["标准代号含义"].ToString().Trim();
                pm.bz = reader["备注"].ToString().Trim();
                pm.gxx = reader["更新项"].ToString().Trim();

            }

            if (!"".Equals(err)) err += pmKeyInfo(pm);

            pm.gxrq = DateTime.Now;
            pm.dlr = user.name;

            pm.fillEmptyStringAsNull();

            return pm;
        }
Ejemplo n.º 3
0
 /// <summary>
 /// 进行题录页数更新
 /// </summary>
 /// <param name="wjm"></param>
 /// <param name="flbm"></param>
 /// <param name="gjbz"></param>
 public void UpdatePageNumber(string wjm, string flbm, GJBZ_PM gjbz)
 {
     string path = destFolder + ConstructWjmPath(flbm);
     if (File.Exists(path + wjm))
     {
         try
         {
             PdfReader pdf = new PdfReader(path + wjm);
             if (null != pdf)
             {
                 gjbz.ys = pdf.NumberOfPages;
                 pdf.Close();
             }
         }
         catch { }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// 进行潜在的标准代替关系更新
        /// </summary>
        /// <param name="gp"></param>
        /// <returns></returns>
        public String UpdateDTBZ(GJBZ_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);

            //找到代替的标准,只代替最近的标准
            GJBZ_PM gpm = gjbzDAO.GetAlikeGJBZ_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
                {
                    gjbzDAO.UpdateGJBZ_PM(gpm, user.name);

                    /* 更新access表中记录 */
                    if (gp.bzwjm.Equals("NULL")) {

                        gp.fillEmptyStringAsNull();

                        deletePM((PM)gp, out err);
                        insertPM((PM)gp);
                        gp.eraseNullInEmptyString();

                    }
                }
                catch(Exception e)
                {
                    err += "更新替代关系异常(" + e.Message + ") " + pmKeyInfo(gp);
                }
            }

            return err;
        }
Ejemplo n.º 5
0
        public override string formatData(PM pm)
        {
            //反馈信息
            String result = String.Empty;
            String Empty = "NULL";
            GJBZ_PM gjbz = (GJBZ_PM)pm;

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

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

            gjbz.dtbz = GlobalMethod.CharConvert(gjbz.dtbz);
            gjbz.bdtbz = GlobalMethod.CharConvert(gjbz.bdtbz);

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

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

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

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

            result += r;

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

            gjbz.bzwjm = Empty;

            /* 找出flbm */

            /* 通过GB分类查找flbm */
            if (gjbz.flbm.Equals(Empty))
            {
                if (!gjbz.gbfl.Equals(Empty))
                {
                    string[] fl_arr = gjbz.gbfl.Split(';');
                    for (int i = fl_arr.Length - 1; i >= 0; i--)
                    {
                        GJBZ_FL gjbzFL = gjbzDAO.GetGJBZ_FLByZyfl(fl_arr[i]);
                        if (gjbzFL != null)
                        {
                            gjbz.flbm = gjbzFL.flbm;
                            break;
                        }
                    }
                }
            }

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

            /* 根据代替标准查找相似标准的分类编码 */
            if (gjbz.flbm.Equals(Empty))
            {
                if (!gjbz.dtbz.Equals(Empty))
                {
                    string[] dtbz_wh = gjbz.dtbz.Split(';');
                    foreach (string wh in dtbz_wh)
                    {
                        gjbz.flbm = GetFlbmByHistBZWH(gjbz.bzwh, wh);
                        if (!gjbz.flbm.Equals(Empty)) break;
                    }
                }
            }

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

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

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

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

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

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

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

                    gjbz.fillEmptyStringAsNull();

                    GJBZ_PM gpm = new GJBZ_PM(gjbz);
                    gpm.bzwh = newBzwh;
                    gpm.wjm = gjbz.wjm;
                    gpm.ybzwh = gpm.bzwh;
                    seqList.Add((PM)gpm);
                }

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

            /* 标准文号 不能处理得进行保留 */
            if (String.Empty.Equals(result) && !gjbz.isOK && !isBZWHQualified(gjbz.bzwh))
            {
                gjbz.isValid = false;
                goto bzwh_err;
            }

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

            return result;

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

            result += pmKeyInfo(pm);

            return result;
        }
Ejemplo n.º 6
0
        /// <summary>
        /// 进行标准的代替关系更新
        /// </summary>
        /// <param name="bzPM"></param>
        public void DTGX_CheckUpdate(GJBZ_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", "");

                GJBZ_PM oldBZ = gjbzDAO.GetGJBZ_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", "");

                GJBZ_PM newBZ = gjbzDAO.GetGJBZ_PMByBzwh(bzwh);

                if (null != newBZ)
                {
                    DTGX_Update(bzPM, newBZ);
                }
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 找到标准文件并进行上传,同时删除该条记录
        /// </summary>
        /// <param name="gjbz"></param>
        private string UploadBZfile(GJBZ_PM gjbz)
        {
            string ret = "";
            string path = ConstructWjmPath(gjbz.flbm);

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

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

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

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

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

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

            return ret;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// 根据“代替关系“进行代替项的更新,包括”代替标准“与”被代替标准“
        /// </summary>
        /// <param name="oldGjbz"></param>
        /// <param name="newGjbz"></param>
        private void DTGX_Update(GJBZ_PM oldBZ, GJBZ_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";
                }

                gjbzDAO.UpdateGJBZ_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);

                gjbzDAO.UpdateGJBZ_PM(newBZ, user.name);
            }
        }
Ejemplo n.º 9
0
        /// <summary>
        /// 根据版本性质恢复原有的标准文号
        /// </summary>
        /// <param name="gp"></param>
        /// <returns></returns>
        string ComposeFullBZWH(GJBZ_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;
        }
Ejemplo n.º 10
0
 /// <summary>
 /// 进行追加更新
 /// </summary>
 /// <param name="dest"></param>
 /// <param name="src"></param>
 private void AppendUpdate(GJBZ_PM dest, GJBZ_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.pzdw) && !IsEmpty(src.pzdw)) dest.pzdw = src.pzdw;
     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);
 }
Ejemplo n.º 11
0
    /// <summary>
    /// 获取用户填写的国家标准篇名信息
    /// </summary>
    /// <returns></returns>
    private GJBZ_PM GetGJBZPM()
    {
        GJBZ_PM gjbzPM = new GJBZ_PM();
        //标准文号
        gjbzPM.bzwh = this.bzwhTextBox.Text.Trim();
        //分类编码
        gjbzPM.flbm = this.flbmTextBox.Text;
        //文件名
        gjbzPM.wjm = this.pdfTextBox.Text;
        //中文名称
        gjbzPM.zwmc = this.zwmcTextBox.Text.Trim();
        //版本性质
        gjbzPM.bbxz = this.bbxzTextBox.Text.Trim();
        //ICS分类
        gjbzPM.icsfl = this.icsflTextBox.Text.Trim();
        //GB分类
        gjbzPM.gbfl = this.gbflTextBox.Text.Trim();
        //外文名称
        gjbzPM.wwmc = this.wwmcTextBox.Text.Trim();
        //发布日期
        if (!"".Equals(this.fbrqTextBox.Text))
        {
            gjbzPM.fbrq = DateTime.Parse(this.fbrqTextBox.Text);
        }
        //实施日期
        if (!"".Equals(this.ssrqTextBox.Text))
        {
            gjbzPM.ssrq = DateTime.Parse(this.ssrqTextBox.Text);
        }
        //采用关系
        gjbzPM.cygx = this.cygxTextBox.Text.Trim();
        //代替标准
        gjbzPM.dtbz = this.dtbzTextBox.Text.Trim();
        //被代替标准
        gjbzPM.bdtbz = this.bdtbzTextBox.Text.Trim();
        //页数
        if (!"".Equals(this.ysTextBox.Text))
            gjbzPM.ys = Int32.Parse(this.ysTextBox.Text);
        //作废
        gjbzPM.zf = this.zfCheckBox.Checked;
        //作废年份
        gjbzPM.zfnf = this.zfnfTextBox.Text.Trim();
        //中文主题词
        gjbzPM.zwztc = this.zwztcTextBox.Text.Trim();
        //外文主题词
        gjbzPM.wwztc = this.wwztcTextBox.Text.Trim();
        //起草单位
        gjbzPM.qcdw = this.qcdwTextBox.Text.Trim();
        //发布单位
        gjbzPM.fbdw = this.fbdwTextBox.Text.Trim();
        //批准单位
        gjbzPM.pzdw = this.pzdwTextBox.Text.Trim();
        //备注
        gjbzPM.bz = this.bzTextBox.Text.Trim();
        //标准代号含义
        gjbzPM.bzdhhy = this.bzdhhyTextBox.Text.Trim();
        //更新项
        gjbzPM.gxx = this.gxxTextBox.Text.Trim();
        //更新日期
        try
        {
            gjbzPM.gxrq = DateTime.Parse(this.gxrqTextBox.Text.Trim());
        }
        catch
        {
            gjbzPM.gxrq = DateTime.Now;
        }
        //登录人
        gjbzPM.dlr = this.dlrTextBox.Text;

        return gjbzPM;
    }
Ejemplo n.º 12
0
        /// <summary>
        /// 生成日志信息
        /// </summary>
        /// <param name="zwqkPM">中文篇名信息</param>
        /// <param name="opType">操作类型</param>
        /// <param name="uname">用户名</param>
        /// <returns></returns>
        private OperationLogItem GetOperationLogItem(GJBZ_PM gjbzPM, String opType, String uname)
        {
            if (null == gjbzPM)
            {
                return null;
            }

            OperationLogItem operationLogItem = new OperationLogItem();
            //操作类型
            operationLogItem.opType = opType;
            //数据库表
            operationLogItem.opTable = "GJBZ_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.zfnf + "','" +
                gjbzPM.zwztc + "','" + gjbzPM.wwztc + "','" +
                gjbzPM.qcdw + "','" + gjbzPM.fbdw + "','" +
                gjbzPM.pzdw + "','" + gjbzPM.bz + "','" +
                gjbzPM.bzdhhy + "','"  + gjbzPM.gxrq + "','" +
                gjbzPM.dlr +
                "')";
            operationLogItem.opContent = content;
            return operationLogItem;
        }
Ejemplo n.º 13
0
 /// <summary>
 /// 更新一条篇名信息
 /// </summary>
 /// <param name="gjbz_pm">要更新的篇名信息</param>
 /// <param name="uname">操作用户名</param>
 /// <returns></returns>
 public Boolean UpdateGJBZ_PM(GJBZ_PM gjbz_pm, String uname)
 {
     Boolean flag = true;
     int back = sqlMapper.Update("UpdateGJBZ_PM", gjbz_pm);
     if (back <= 0)
     {
         flag = false;
     }
     if (flag)
     {
         OperationLogItem operationLog = this.GetOperationLogItem(gjbz_pm, "UPDATE", uname);
         this.operationLogDAO.insertLogItem(operationLog);
     }
     return flag;
 }
Ejemplo n.º 14
0
 /// <summary>
 /// 插入一条篇名信息
 /// </summary>
 /// <param name="gjbz_pm">篇名信息</param>
 /// <returns></returns>
 public Boolean InsertGJBZ_PM(GJBZ_PM gjbz_pm)
 {
     Boolean flag = true;
     OperationLogItem operationLog = this.GetOperationLogItem(gjbz_pm, "INSERT", null);
     try
     {
         sqlMapper.Insert("InsertGJBZ_PM", gjbz_pm);
         this.operationLogDAO.insertLogItem(operationLog);
     }
     catch (Exception)
     {
         flag = false;
     }
     return flag;
 }
Ejemplo n.º 15
0
        /// <summary>
        /// 插入一条篇名信息
        /// </summary>
        /// <param name="gjbz_pm">篇名信息</param>
        /// <returns></returns>
        public String InsertGJBZ_PM(GJBZ_PM gjbz_pm)
        {
            try
            {
                sqlMapper.Insert("InsertGJBZ_PM", gjbz_pm);
            }
            catch (Exception e)
            {
                return "插入记录异常(" + e.Message + ")";
            }

            return String.Empty;
        }