當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。