Example #1
0
        public bool AddBgxx(Xm_Ss_Bgxx bgxx, List<Item_File> fileInfos)
        {
            ArrayList sqls = new ArrayList();
            sqls.Add(SqlBuilder.BuildInsertSql(bgxx));

            //插入基本信息的文件。
            foreach (Item_File fileInfo in fileInfos)
            {
                sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
            }

            return OracleHelper.ExecuteCommand(sqls);
        }
Example #2
0
        public bool UpdateBgxxData(Xm_Ss_Bgxx bgxx, ActionEnum gcxxAction, Xm_Gcxx gcxx, Xm_Xmzj xmzjgs, List<Item_File> files)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;

            sqls.Add(SqlBuilder.BuildUpdateSql(bgxx));

            if (gcxx != null)
            {
                switch (gcxxAction)
                {
                    case ActionEnum.Insert:
                        tmpSql = "delete from xm_gcxx where itemcode = '{0}' and stage = '{1}' and xh >= {2}";
                        tmpSql = string.Format(tmpSql, gcxx.ItemCode, (int)gcxx.Stage, gcxx.Xh);
                        sqls.Add(tmpSql);
                        sqls.Add(SqlBuilder.BuildInsertSql(gcxx));
                        break;
                    case ActionEnum.Update:
                        sqls.Add(SqlBuilder.BuildUpdateSql(gcxx));
                        break;
                }
            }

            if (xmzjgs != null)
            {
                tmpSql = "delete from xm_xmzj where itemcode = '{0}' and stage = '{1}' and xh = '{2}'";
                tmpSql = string.Format(tmpSql, xmzjgs.ItemCode, (int)xmzjgs.Stage, xmzjgs.Xh);
                sqls.Add(tmpSql);
                sqls.Add(SqlBuilder.BuildInsertSql(xmzjgs));

                //清空项目所有的文件。
                tmpSql = "delete from item_file where itemcode = '{0}' and stage = '{1}' and xh = '{2}' and filecode in ('{3}')";
                tmpSql = string.Format(tmpSql, xmzjgs.ItemCode, (int)xmzjgs.Stage, xmzjgs.Xh, (int)FileCode.预算补充文件);
                sqls.Add(tmpSql);

                //插入基本信息的文件。
                foreach (Item_File fileInfo in files)
                {
                    sqls.Add(SqlBuilder.BuildInsertSql(fileInfo));
                }
            }

            return OracleHelper.ExecuteCommand(sqls);
        }