当前位置: 首页>>代码示例>>C#>>正文


C# MDBservice.PM类代码示例

本文整理汇总了C#中StateGrid.MDBservice.PM的典型用法代码示例。如果您正苦于以下问题:C# PM类的具体用法?C# PM怎么用?C# PM使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PM类属于StateGrid.MDBservice命名空间,在下文中一共展示了PM类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: checkPMValid

        public override bool checkPMValid(PM pm, out string errMsg)
        {
            errMsg = String.Empty;
            ZGCG_PM zgcg = (ZGCG_PM)pm;
            this.openOleDbConnection();
            sqlcmd.CommandText = @"select * from " + formatPmTableName
                + " where 成果编号[email protected]成果编号 and 成果名称[email protected]成果名称";
            sqlcmd.Connection = this.ObjConnection;
            sqlcmd.Parameters.Add(new OleDbParameter("成果编号", zgcg.cgbh));
            sqlcmd.Parameters.Add(new OleDbParameter("成果名称", zgcg.cgmc));
            OleDbDataReader reader = sqlcmd.ExecuteReader();

            if (reader.Read())
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return true;
            }
            else
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return false;
            }
        }
开发者ID:Brinews,项目名称:Code,代码行数:25,代码来源:ZGCG_MDB.cs

示例2: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            XWLW_PM xwlw = (XWLW_PM)pm;
            xwlw.gxrq = DateTime.Now;

            xwlw.eraseNullInEmptyString();

            err += insertPMwithUpdateWJM(pm);

            if (!String.Empty.Equals(err))
                return err;

            String path = "/";
            path += xwlw.sybm.Substring(0, 2) + "/";
            path += xwlw.sybm.Substring(2, 2) + "/";
            path += xwlw.sybm.Substring(5, 4) + "/";

            String srcFile;
            srcFile = fileFolder + xwlw.wjm_old;
            if (!File.Exists(srcFile))
            {
                srcFile = fileFolder + path + xwlw.wjm_old;
            }

            String destFile = path + xwlw.wjm;
            err = FileMove.MoveFile(srcFile, xwlw.wjm, destFolder + "/" + path);
            if (!String.Empty.Equals(err))
            {
                err = xwlw.wjm_old + " " + err + "\n";
                xwlwDAO.DeleteXWLW_PM(xwlw.wjm);
            }
            else
            {
                try
                {
                    System.IO.File.Delete(srcFile);
                }
                catch { }
            }

            xwlw.fillEmptyStringAsNull();

            /* 进行正确记录备份 */
            if (String.Empty.Equals(err))
            {
                pm.isBack = true;
                string none = "DONE";
                deletePM(pm, out none);
                insertPM(pm);
                pm.isBack = false;
            }

            if (!hasFormatTable && String.Empty.Equals(err))
            {
                err += DeleteWF(pm);
            }

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:60,代码来源:XWLW_MDB.cs

示例3: checkPMValid

        public override bool checkPMValid(PM pm, out string errMsg)
        {
            errMsg = String.Empty;
            ZCWX_PM zcwx = (ZCWX_PM)pm;

            this.openOleDbConnection();
            sqlcmd.CommandText = @"select * from " + formatPmTableName + " where 中文篇名[email protected]中文篇名 and 出版单位[email protected]出版单位";
            sqlcmd.Connection = this.ObjConnection;

            sqlcmd.Parameters.Add(new OleDbParameter("中文篇名", zcwx.zwpm));
            sqlcmd.Parameters.Add(new OleDbParameter("出版单位", zcwx.cbdw));

            OleDbDataReader reader = sqlcmd.ExecuteReader();

            if (reader.Read())
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return true;
            }
            else
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return false;
            }
        }
开发者ID:Brinews,项目名称:Code,代码行数:27,代码来源:ZCWX_MDB.cs

示例4: checkPMValid

        public override bool checkPMValid(PM pm, out string errMsg)
        {
            errMsg = String.Empty;
            KCBG_PM kcbg = (KCBG_PM)pm;
            this.openOleDbConnection();

            sqlcmd.CommandText = @"select * from " + formatPmTableName
                + " where 索引编码[email protected]索引编码 and 报告名称[email protected]报告名称";

            sqlcmd.Connection = this.ObjConnection;
            sqlcmd.Parameters.Add(new OleDbParameter("索引编码", kcbg.sybm));
            sqlcmd.Parameters.Add(new OleDbParameter("报告名称", kcbg.bgmc));

            OleDbDataReader reader = sqlcmd.ExecuteReader();

            if (reader.Read())
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return true;
            }
            else
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return false;
            }
        }
开发者ID:Brinews,项目名称:Code,代码行数:28,代码来源:KCBG_MDB.cs

示例5: checkPMValid

        public override bool checkPMValid(PM pm, out string errMsg)
        {
            errMsg = String.Empty;
            GYBG_PM gybg = (GYBG_PM)pm;
            this.openOleDbConnection();

            sqlcmd.CommandText = @"select * from " + formatPmTableName + " where 年份[email protected]年份 and 标题[email protected]标题";

            sqlcmd.Connection = this.ObjConnection;
            sqlcmd.Parameters.Add(new OleDbParameter("年份", gybg.nf));
            sqlcmd.Parameters.Add(new OleDbParameter("报告名称", gybg.bt));

            OleDbDataReader reader = sqlcmd.ExecuteReader();

            if (reader.Read())
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return true;
            }
            else
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return false;
            }
        }
开发者ID:Brinews,项目名称:Code,代码行数:27,代码来源:GYBG_MDB.cs

示例6: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            GYBG_PM gybg = (GYBG_PM)pm;
            gybg.gxrq = DateTime.Now;

            gybg.eraseNullInEmptyString();
            err += insertPMwithUpdateWJM(pm);

            if (!String.Empty.Equals(err))
                return err;

            String path = getGybgFilePath(gybg.sybm);

            String srcFile;
            srcFile = fileFolder + gybg.ywjm;
            if (!File.Exists(srcFile))
                srcFile = fileFolder + path + gybg.ywjm;

            String destFile = path + gybg.wjm;
            err += FileMove.MoveFile(srcFile, gybg.wjm, destFolder + "/" + path);

            if (!String.Empty.Equals(err))
            {
                err += "\n";
                gybgDAO.DeleteGYBG_PM(gybg.wjm, user.name);
            }

            gybg.fillEmptyStringAsNull();

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:32,代码来源:GYBG_MDB.cs

示例7: checkPMValid

        public override bool checkPMValid(PM pm, out string errMsg)
        {
            errMsg = String.Empty;
            DLBK_PM dlbk = (DLBK_PM)pm;
            this.openOleDbConnection();
            sqlcmd.CommandText = @"select * from " + formatPmTableName
                + " where 分类编码[email protected]分类编码 and 标题[email protected]标题 and 作者[email protected]作者";
            sqlcmd.Connection = this.ObjConnection;
            sqlcmd.Parameters.Add(new OleDbParameter("分类编码", dlbk.flbm));
            sqlcmd.Parameters.Add(new OleDbParameter("标题", dlbk.bt));
            sqlcmd.Parameters.Add(new OleDbParameter("作者", dlbk.zz));
            OleDbDataReader reader = sqlcmd.ExecuteReader();

            if (reader.Read())
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return true;
            }
            else
            {
                reader.Close();
                sqlcmd.Parameters.Clear();
                return false;
            }
        }
开发者ID:Brinews,项目名称:Code,代码行数:26,代码来源:DLBK_MDB.cs

示例8: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            ZGCG_PM zgcg = (ZGCG_PM)pm;
            zgcg.gxrq = DateTime.Now;

            zgcg.eraseNullInEmptyString();
            err += insertPMwithUpdateWJM(pm);

            if (!String.Empty.Equals(err))
                return err;

            if (String.Empty.Equals(err))
            {
                pm.isBack = true;
                String dummy = "DONE";
                deletePM(pm, out dummy);
                insertPM(pm);
                pm.isBack = false;
            }

            if (!hasFormatTable && String.Empty.Equals(err))
            {
                //删除WF表记录
                deleteWFPM(pm, pmTableName, out err);
            }

            zgcg.fillEmptyStringAsNull();

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:31,代码来源:ZGCG_MDB.cs

示例9: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            BDBK_PM bdbk = (BDBK_PM)pm;
            bdbk.gxrq = DateTime.Now;

            bdbk.eraseNullInEmptyString();
            err += insertPMwithUpdateWJM(pm);

            if (!String.Empty.Equals(err))
                return err;

            String path = "/";
            path += bdbk.sybm.Substring(0, 2) + "/";
            path += bdbk.sybm.Substring(2, 2) + "/";
            path += bdbk.nf.ToString() + "/";

            String srcFile;
            if (hasFormatTable)
            {
                srcFile = fileFolder + bdbk.oldWjm;
                if (!File.Exists(srcFile))
                {
                    srcFile = fileFolder + path + bdbk.oldWjm;
                }
            }
            else srcFile = fileFolder + bdbk.ywjm;

            String destFile = path + bdbk.wjm;

            err += FileMove.MoveFile(srcFile, bdbk.wjm, destFolder + "/" + path);

            if (!String.Empty.Equals(err))
            {
                err += "\n";
                bdbkDAO.DeleteBDBK_PM(bdbk.wjm);
            }

            if (String.Empty.Equals(err))
            {
                pm.isBack = true;
                String dummy = "DONE";
                deletePM(pm, out dummy);
                insertPM(pm);
                pm.isBack = false;
            }

            if (!hasFormatTable && String.Empty.Equals(err))
            {
                //删除WF表记录
                DeletePmByWjm(bdbk.ywjm, pmTableName, out err);
            }

            bdbk.fillEmptyStringAsNull();

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:57,代码来源:BDBK_MDB.cs

示例10: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            WWHY_PM wwhy = (WWHY_PM)pm;
            wwhy.gxrq = DateTime.Now;
            wwhy.eraseNullInEmptyString();

            err += insertPMwithUpdateWJM(pm);

            if (!String.Empty.Equals(err))
                return err;

            String path = "/";
            path += wwhy.sybm.Substring(0, 2) + "/";
            path += wwhy.sybm.Substring(2, 2) + "/";
            path += wwhy.sybm.Substring(4, 2) + "/";
            path += wwhy.sybm.Substring(6, 2) + "/";
            path += wwhy.sybm.Substring(9, 4) + "/";

            String srcFile;
            srcFile = fileFolder + wwhy.wjm_old;
            if (!File.Exists(srcFile))
            {
                srcFile = fileFolder + path + wwhy.wjm_old;
            }

            String destFile = path + wwhy.wjm;

            err += FileMove.MoveFile(srcFile, wwhy.wjm, destFolder + "/" + path);

            if (!String.Empty.Equals(err))
            {
                err += "\n";
                wwhyDAO.deleteWwhyPMByWjm(wwhy.wjm, user.name);
            }

            //备份到done表记录
            if (String.Empty.Equals(err))
            {
                pm.isBack = true;
                String dummy = "DONE";
                deletePM(pm, out dummy);
                insertPM(pm);
                pm.isBack = false;
            }

            if (!hasFormatTable && String.Empty.Equals(err))
            {
                //删除WF表记录
                deleteWFPM(pm, pmTableName, out err);
            }

            wwhy.fillEmptyStringAsNull();

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:56,代码来源:WWHY_MDB.cs

示例11: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            NYBG_PM nybg = (NYBG_PM)pm;
            nybg.gxrq = DateTime.Now;

            nybg.eraseNullInEmptyString();
            err += insertPMwithUpdateWJM(pm);

            if (!String.Empty.Equals(err))
                return err;

            String path = "/";
            path += nybg.sybm.Substring(0, 2) + "/";
            path += nybg.sybm.Substring(2, 2) + "/";
            path += nybg.sybm.Substring(4, 2) + "/";
            path += nybg.nf.ToString() + "/";

            String srcFile;
            if (hasFormatTable)
            {
                srcFile = fileFolder + nybg.oldWjm;
                if (!File.Exists(srcFile))
                    srcFile = fileFolder + WjmPath(nybg.oldWjm) + nybg.oldWjm;
            }
            else srcFile = fileFolder + nybg.ywjm;

            String destFile = path + nybg.wjm;
            err += FileMove.MoveFile(srcFile, nybg.wjm, destFolder + "/" + path);

            if (!String.Empty.Equals(err))
            {
                err += "\n";
                nybgDAO.DeleteNYBG_PM(nybg.wjm, user.name);
            }

            //备份到done表记录
            if (String.Empty.Equals(err))
            {
                pm.isBack = true;
                String dummy = "DONE";
                deletePM(pm, out dummy);
                insertPM(pm);
                pm.isBack = false;
            }

            if (!hasFormatTable && String.Empty.Equals(err))
            {
                //删除WF表记录
                deleteWFPM(pm, pmTableName, out err);
            }

            nybg.fillEmptyStringAsNull();

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:56,代码来源:NYBG_MDB.cs

示例12: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            ZWQK_PM zwqk = (ZWQK_PM)pm;

            zwqk.eraseNullInEmptyString();

            err += insertPMwithUpdateWJM(pm);

            if (!String.Empty.Equals(err))
                return err;

            String path = "/";
            path += zwqk.sybm.Substring(0, 2) + "/";
            path += zwqk.sybm.Substring(2, 2) + "/";
            path += zwqk.sybm.Substring(4, 2) + "/";
            path += zwqk.sybm.Substring(6, 2) + "/";
            path += zwqk.nf.ToString() + "/";

            String srcFile;
            srcFile = fileFolder + "/" + zwqk.wjm_old;
            if (!File.Exists(srcFile))
            {
                srcFile = fileFolder + path + zwqk.wjm_old;
            }

            String destFile = path + zwqk.wjm;

            err = FileMove.MoveFile(srcFile, zwqk.wjm, destFolder + "/" + path);

            if (!String.Empty.Equals(err))
            {
                err += pmKeyInfo(zwqk);
                try
                {
                    zwqkDAO.deleteZwqkPMByWjm(zwqk.wjm, user.name);
                }
                catch { }
            }

            /* delete 正常记录 from 万方表 */
            if (!hasFormatTable && err.Equals(String.Empty))
            {
                err = DeleteWF(zwqk);
            }

            /* 保存正常记录到ACCESS表中 */
            if (err.Equals(String.Empty))
            {
                //BackupPM(zwqk);
                zwqk.isBack = true;
                err = insertPM((PM)zwqk);
            }

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:56,代码来源:ZWQK_MDB.cs

示例13: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            ZCWX_PM zcwx = (ZCWX_PM)pm;
            zcwx.gxrq = DateTime.Now;

            zcwx.eraseNullInEmptyString();
            err += insertPMwithUpdateSybm(pm);

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:11,代码来源:ZCWX_MDB.cs

示例14: deletePM

        public override int deletePM(PM pm, out String err)
        {
            int back = 0;
            err = String.Empty;
            ZCWX_PM ZCWX = (ZCWX_PM)pm;
            //打开连接
            this.openOleDbConnection();
            OleDbCommand sqlcmd = new OleDbCommand();
            if (!String.Empty.Equals(validateTableName(formatPmTableName)))
            {
                sqlcmd.CommandText = @"create Table " + formatPmTableName + @"(分类编码 char(10), 索引编码 char(20), 馆藏号 char(50), 中文篇名 char(255), 出版单位 char(255), 文献密级 char(4), 文献类型 char(4), 责任个人 char(255), 责任单位 char(255), 出版日期 datetime, 载体形态 char(20), 国图分类 char(50), 中文主题词 char(255), 中文文摘 text, 备注 text, 更新日期 datetime, 登录人 char(20))";
                sqlcmd.Connection = this.ObjConnection;
                try
                {
                    back = sqlcmd.ExecuteNonQuery();
                }
                catch (Exception e)
                {
                    err = e.Message + "\n";
                    return 0;
                }
            }
            //sql语句
            sqlcmd.CommandText = @"delete from " + formatPmTableName + " where 中文篇名[email protected]中文篇名 and 出版单位[email protected]出版单位 and 出版日期[email protected]出版日期";
            sqlcmd.Connection = this.ObjConnection;
            sqlcmd.Parameters.Add(new OleDbParameter("中文篇名", ZCWX.zwpm));
            sqlcmd.Parameters.Add(new OleDbParameter("出版单位", ZCWX.cbdw));

            OleDbParameter parameter = new OleDbParameter("出版日期", OleDbType.DBDate);
            if (ZCWX.cbrq == null) parameter.Value = DBNull.Value;
            else parameter.Value = ZCWX.cbrq;
            sqlcmd.Parameters.Add(parameter);

            try
            {
                back = sqlcmd.ExecuteNonQuery();
            }
            catch (Exception e)
            {
                err = "Exception: " + e.Message + "\n";
            }
            sqlcmd.Parameters.Clear();

            return back;
        }
开发者ID:Brinews,项目名称:Code,代码行数:45,代码来源:ZCWX_MDB.cs

示例15: addOneRecord

        public override string addOneRecord(PM pm)
        {
            String err = String.Empty;
            KCBG_PM kcbg = (KCBG_PM)pm;

            kcbg.gxrq = DateTime.Now;

            kcbg.eraseNullInEmptyString();
            err += insertPMwithUpdateWJM(pm);

            if (!String.Empty.Equals(err))
                return err;

            String path = getKjbgFilePath(kcbg.sybm);

            String srcFile;
            srcFile = fileFolder + kcbg.ywjm;
            if (!File.Exists(srcFile))
                srcFile = fileFolder + path + kcbg.ywjm;

            String destFile = path + kcbg.wjm;
            err += FileMove.MoveFile(srcFile, kcbg.wjm, destFolder + "/" + path);

            if (!String.Empty.Equals(err))
            {
                err += "\n";
                kcbgDAO.DeleteKCBG_PM(kcbg.wjm, user.name);
            }

            kcbg.fillEmptyStringAsNull();

            /* 进行正确记录备份 */
            if (String.Empty.Equals(err))
            {
                pm.isBack = true;
                string none = "DONE";
                deletePM(pm, out none);
                insertPM(pm);
                pm.isBack = false;
            }

            return err;
        }
开发者ID:Brinews,项目名称:Code,代码行数:43,代码来源:KCBG_MDB.cs


注:本文中的StateGrid.MDBservice.PM类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。