Пример #1
0
        protected SyncData(OracleDbOperation targetDb, OracleDbOperation localDb, string targetCode,
            string localCode, FtpHelper targetFtp, FtpHelper localFtp, StringBuilder sbLog)
        {
            this.targetDb = targetDb;
            this.localDb = localDb;
            this.targetCode = targetCode;
            this.localCode = localCode;
            this.targetFtp = targetFtp;
            this.localFtp = localFtp;
            this.sbLog = sbLog;

            dtOperation = new DataTableOperation();

            deleteAction = () =>
            {
                LogOperation.Append(sbLog, "删除成功");
            };
            totalAction = (tableName, count) =>
            {
                LogOperation.Append(sbLog, "统计:" + tableName + "表共同步了" + count + "条数据");
            };
            deleteFileAction = (itemCode,fileName) =>
            {
                LogOperation.Append(sbLog, string.Format("项目编号:{0}, 删除文件:{1}", itemCode, fileName));
            };

            ftpCopyAction = (itemCode, fileCount) =>
            {
                LogOperation.Append(sbLog, string.Format("项目编号:{0}, 拷贝文件数:{1}", itemCode, fileCount.ToString()));
            };
        }
Пример #2
0
        protected SyncData(OracleDbOperation targetDb, OracleDbOperation localDb, string targetCode,
                           string localCode, FtpHelper targetFtp, FtpHelper localFtp, StringBuilder sbLog)
        {
            this.targetDb   = targetDb;
            this.localDb    = localDb;
            this.targetCode = targetCode;
            this.localCode  = localCode;
            this.targetFtp  = targetFtp;
            this.localFtp   = localFtp;
            this.sbLog      = sbLog;

            dtOperation = new DataTableOperation();

            deleteAction = () =>
            {
                LogOperation.Append(sbLog, "删除成功");
            };
            totalAction = (tableName, count) =>
            {
                LogOperation.Append(sbLog, "统计:" + tableName + "表共同步了" + count + "条数据");
            };
            deleteFileAction = (itemCode, fileName) =>
            {
                LogOperation.Append(sbLog, string.Format("项目编号:{0}, 删除文件:{1}", itemCode, fileName));
            };

            ftpCopyAction = (itemCode, fileCount) =>
            {
                LogOperation.Append(sbLog, string.Format("项目编号:{0}, 拷贝文件数:{1}", itemCode, fileCount.ToString()));
            };
        }
Пример #3
0
        /// <summary>
        /// 删除消息。
        /// </summary>
        /// <param name="type"></param>
        /// <param name="xxbh"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public bool DelMessage(int type, string xxbh, string userId)
        {
            DataTableOperation dtOperation = new DataTableOperation();
            OracleDbOperation  dbOperation = new OracleDbOperation(OracleHelper.ConnectionString);

            dbOperation.BeginTransaction();

            string tableName;
            string sql;
            List <OracleParameter> parameters = new List <OracleParameter>();

            tableName = "xtxx";
            sql       = "select * from " + tableName + " a where a.xxbh = :xxbh";
            parameters.Clear();
            parameters.Add(new OracleParameter("xxbh", xxbh));
            DataTable dtXtxx = dbOperation.ExecuteDataTable(sql, tableName, parameters);

            if (dtXtxx.Rows.Count > 0)
            {
                DataRow drXtxx = dtXtxx.Rows[0];

                tableName = "xtxxjs";
                sql       = "select * from " + tableName + " a where a.jsxxbh = :jsxxbh";
                parameters.Clear();
                parameters.Add(new OracleParameter("jsxxbh", xxbh));
                DataTable dtXtxxjs = dbOperation.ExecuteDataTable(sql, tableName, parameters);
                switch (type)
                {
                case 0:
                    var drXtxxjs = (from DataRow dr in dtXtxxjs.Rows
                                    where dr["JSR"].ToString() == userId
                                    select dr).First();
                    drXtxxjs["jsrsc"] = "1";
                    break;

                case 1:
                    drXtxx["fsrsc"] = "1";
                    break;
                }
                int xtxxjsUndeleteCount = (from DataRow dr in dtXtxxjs.Rows
                                           where dr["jsrsc"].ToString() == "0"
                                           select dr).Count();
                string xtxxDeleteState = drXtxx["fsrsc"].ToString();
                if (xtxxjsUndeleteCount == 0 && xtxxDeleteState == "1")
                {
                    dtOperation.ClearDbDataTable(dtXtxx);
                    dtOperation.ClearDbDataTable(dtXtxxjs);
                    DeleteMessageFile(xxbh, null);
                }
                dbOperation.UpdateDataTable(dtXtxx);
                dbOperation.UpdateDataTable(dtXtxxjs);
                dbOperation.Commit();
            }
            else
            {
                dbOperation.Rollback();
                return(false);
            }
            return(true);
        }
Пример #4
0
        /// <summary>
        /// 删除消息。
        /// </summary>
        /// <param name="type"></param>
        /// <param name="xxbh"></param>
        /// <param name="userId"></param>
        /// <returns></returns>
        public bool DelMessage(int type, string xxbh, string userId)
        {
            DataTableOperation dtOperation = new DataTableOperation();
            OracleDbOperation dbOperation = new OracleDbOperation(OracleHelper.ConnectionString);

            dbOperation.BeginTransaction();

            string tableName;
            string sql;
            List<OracleParameter> parameters = new List<OracleParameter>();

            tableName = "xtxx";
            sql = "select * from " + tableName + " a where a.xxbh = :xxbh";
            parameters.Clear();
            parameters.Add(new OracleParameter("xxbh", xxbh));
            DataTable dtXtxx = dbOperation.ExecuteDataTable(sql, tableName, parameters);
            if (dtXtxx.Rows.Count > 0)
            {
                DataRow drXtxx = dtXtxx.Rows[0];

                tableName = "xtxxjs";
                sql = "select * from " + tableName + " a where a.jsxxbh = :jsxxbh";
                parameters.Clear();
                parameters.Add(new OracleParameter("jsxxbh", xxbh));
                DataTable dtXtxxjs = dbOperation.ExecuteDataTable(sql, tableName, parameters);
                switch (type)
                {
                    case 0:
                        var drXtxxjs = (from DataRow dr in dtXtxxjs.Rows
                                        where dr["JSR"].ToString() == userId
                                        select dr).First();
                        drXtxxjs["jsrsc"] = "1";
                        break;
                    case 1:
                        drXtxx["fsrsc"] = "1";
                        break;
                }
                int xtxxjsUndeleteCount = (from DataRow dr in dtXtxxjs.Rows
                                           where dr["jsrsc"].ToString() == "0"
                                           select dr).Count();
                string xtxxDeleteState = drXtxx["fsrsc"].ToString();
                if (xtxxjsUndeleteCount == 0 && xtxxDeleteState == "1")
                {
                    dtOperation.ClearDbDataTable(dtXtxx);
                    dtOperation.ClearDbDataTable(dtXtxxjs);
                    DeleteMessageFile(xxbh, null);
                }
                dbOperation.UpdateDataTable(dtXtxx);
                dbOperation.UpdateDataTable(dtXtxxjs);
                dbOperation.Commit();
            }
            else
            {
                dbOperation.Rollback();
                return false;
            }
            return true;
        }
Пример #5
0
 public WorkflowValidation()
 {
     condition   = new Dictionary <string, string>();
     dtOperation = new DataTableOperation();
 }
Пример #6
0
        /// <summary>
        /// 获取项目的资金集合
        /// </summary>
        /// <param name="itemCode"></param>
        /// <param name="node"></param>
        /// <returns></returns>
        public IList<Xm_Xmzj> GetItemMoneyList(string itemCode, string nodeId)
        {
            string strSql = "select * from xm_xmzj Where ItemCode = '{0}' and NodeId in ({1}) order by stage,xh";
            strSql = string.Format(strSql, itemCode, nodeId.Trim());

            DataTable dt = OracleHelper.ExecuteDataTable(strSql);

            List<Xm_Xmzj> dataList = new DataTableOperation().ConvertFromDataTableToEntities<Xm_Xmzj>(dt);

            return dataList;
        }
Пример #7
0
        /// <summary>
        /// 根据项目编号获取项目单位信息
        /// </summary>
        /// <param name="itemCode"></param>
        /// <param name="comType"></param>
        /// <returns></returns>
        public IList<Xm_Xmdw> GetItemCompany(string itemCode)
        {
            IList<Xm_Xmdw> dataList = new List<Xm_Xmdw>();

            string strSql = "select * from xm_xmdw where itemCode = '{0}' order by type";
            strSql = string.Format(strSql, itemCode);
            DataTable dt = OracleHelper.ExecuteDataTable(strSql);
            dataList = new DataTableOperation().ConvertFromDataTableToEntities<Xm_Xmdw>(dt);
            return dataList;
        }
Пример #8
0
 public WorkflowValidation()
 {
     condition = new Dictionary<string, string>();
     dtOperation = new DataTableOperation();
 }