Esempio n. 1
0
        public bool SaveItem(Xm_Jsxx jsxx, Xm_Xmzj itemZj, List<Item_File> itemFile)
        {
            ArrayList strSql = new ArrayList();
            string tmpSql = string.Empty;

            ////项目决算
            strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Jsxx>(CommonManage.delWhere(jsxx.ITEMCODE)));
            strSql.Add(SqlBuilder.BuildInsertSql(jsxx));
            ////资金
            new BusiItemManage().SaveItemMoney(jsxx.ITEMCODE, WorkFlowNode.JueSuan, itemZj, ref strSql);
            ////文件
            new BusiItemManage().SaveItemFile(jsxx.ITEMCODE, WorkFlowNode.JueSuan, itemFile, ref strSql);
            ////更新主表
            if (jsxx.SCDASJ.HasValue)
            {
                tmpSql = "update xm_xmxx set JSSJ = to_date('{0}','yyyy-mm-dd') where ITEMCODE = '{1}'";
                tmpSql = string.Format(tmpSql, jsxx.SCDASJ.Value.ToString("yyyy-MM-dd"), jsxx.ITEMCODE);
                strSql.Add(tmpSql);
            }

            return OracleHelper.ExecuteCommand(strSql);
        }
Esempio n. 2
0
        public bool SaveItem(Xm_GhsjYsxx itemGhys,List<Item_File> itemFile, 
            Xm_Xmzj itemZj, Xm_Gcxx itemGcxx, Xm_Xmdw itemDw)
        {
            ArrayList strSql = new ArrayList();
            string tmpSql = string.Empty;

            ////项目规划设计信息
            strSql.Add(SqlBuilder.BuildDeleteSql<Xm_GhsjYsxx>(CommonManage.delWhere(itemGhys.ItemCode)));
            strSql.Add(SqlBuilder.BuildInsertSql(itemGhys));
            ////文件
            new BusiItemManage().SaveItemFile(itemGhys.ItemCode, WorkFlowNode.GHSJYS, itemFile, ref strSql);
            ////资金
            new BusiItemManage().SaveItemMoney(itemGhys.ItemCode, WorkFlowNode.GHSJYS, itemZj, ref strSql);
            ////工程
            new BusiItemManage().SaveItemGcxx(itemGhys.ItemCode, itemGcxx, ref strSql);
            ////单位
            new BusiItemManage().SaveItemCompany(itemGhys.ItemCode, ItemCompanyType.GH, itemDw, ref strSql);

            return OracleHelper.ExecuteCommand(strSql);
        }
Esempio n. 3
0
        public bool SaveItem(Xm_Xmxx itemInfo, Xm_Sb_Jbxx itemSb,
            List<Item_File> itemFile, Xm_Xmzj itemZj, Xm_Gcxx itemGcxx)
        {
            ArrayList strSql = new ArrayList();
            string tmpSql = string.Empty;
            //// 项目主表
            strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Xmxx>(CommonManage.delWhere(itemInfo.ItemCode)));
            strSql.Add(SqlBuilder.BuildInsertSql(itemInfo));
            ////项目申报信息
            strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Sb_Jbxx>(CommonManage.delWhere(itemSb.ItemCode)));
            strSql.Add(SqlBuilder.BuildInsertSql(itemSb));
            ////文件
            new BusiItemManage().SaveItemFile(itemInfo.ItemCode, WorkFlowNode.TB, itemFile, ref strSql);
            ////资金
            new BusiItemManage().SaveItemMoney(itemInfo.ItemCode, WorkFlowNode.TB, itemZj, ref strSql);
            ////工程
            new BusiItemManage().SaveItemGcxx(itemInfo.ItemCode, itemGcxx, ref strSql);
            ////GIS信息

            return OracleHelper.ExecuteCommand(strSql);
        }
Esempio n. 4
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);
        }
Esempio n. 5
0
        /// <summary>
        /// 保存项目资金
        /// </summary>
        /// <param name="itemCode"></param>
        /// <param name="node"></param>
        /// <param name="itemZJ"></param>
        /// <returns></returns>
        public void SaveItemMoney(string itemCode, WorkFlowNode node, Xm_Xmzj itemZJ, ref ArrayList strSql)
        {
            string tmpSql = string.Empty;

            tmpSql = "delete from xm_xmzj where itemCode in ({0}) and nodeId = '{1}'";
            tmpSql = string.Format(tmpSql, itemCode.Trim(), ((int)node).ToString());
            strSql.Add(tmpSql);
            if (itemZJ != null)
            {
                strSql.Add(SqlBuilder.BuildInsertSql(itemZJ));
                //tmpSql = "insert into xm_xmzj(itemcode,stage,nodeid,xh,zjze,sbgzf,tdpzgcf,ntslgcf,dlgcf,qtgcf,bkyjf,qtfy,fee1,fee2,fee3,fee4,fee5,fee6,fee7,fee8)"
                //           + " Values ('{0}','{1}','{2}','{3}','{4}','{5}','{6}','{7}','{8}','{9}','{10}','{11}')";
                //tmpSql = string.Format(tmpSql, itemZJ.ItemCode, ((int)itemZJ.Stage).ToString(), ((int)itemZJ.NodeId).ToString(), itemZJ.Xh, itemZJ.Zjze,
                //    itemZJ.Sbgzf, itemZJ.Tdpzgcf, itemZJ.Ntslgcf, itemZJ.Dlgcf, itemZJ.Qtgcf, itemZJ.Bkyjf, itemZJ.Qtfy);
                //strSql.Add(tmpSql);
            }
        }