Ejemplo n.º 1
0
        public bool UpdateTjcy(ActionEnum action, Xm_Ysxx ysxx, List<Item_File> fileInfos)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;

            switch (action)
            {
                case ActionEnum.Insert:
                    sqls.Add(SqlBuilder.BuildInsertSql(ysxx));
                    break;
                case ActionEnum.Update:
                    sqls.Add(SqlBuilder.BuildUpdateSql(ysxx));
                    break;
            }

            //清空项目所有的文件。
            tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}' and filecode not in ('24','25','26')";
            tmpSql = string.Format(tmpSql, ysxx.ITEMCODE, (int)WorkFlowNode.JunGong);
            sqls.Add(tmpSql);

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

            return OracleHelper.ExecuteCommand(sqls);
        }
Ejemplo n.º 2
0
        public bool SaveItem(Xm_Ysxx ysxx, List<Item_File> itemFile)
        {
            ArrayList strSql = new ArrayList();
            string tmpSql = string.Empty;
            ////预算信息
            strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Ysxx>(CommonManage.delWhere(ysxx.ITEMCODE)));
            strSql.Add(SqlBuilder.BuildInsertSql(ysxx));
            ////文件
            new BusiItemManage().SaveItemFile(ysxx.ITEMCODE, WorkFlowNode.JunGong, itemFile, ref strSql);

            return OracleHelper.ExecuteCommand(strSql);
        }
Ejemplo n.º 3
0
 public Xm_Ysxx GetItemInfo(string itemCode)
 {
     Xm_Ysxx ItemInfo = new Xm_Ysxx();
     string strSql = "select * from xm_ysxx where itemcode = '{0}'";
     strSql = string.Format(strSql, itemCode);
     DataTable dt = OracleHelper.ExecuteDataTable(strSql);
     if (dt.Rows.Count > 0)
     {
         ItemInfo = (Xm_Ysxx)new DataTableOperation().ConvertFromDataRowToEntity(dt.Rows[0], typeof(Xm_Ysxx));
     }
     return ItemInfo;
 }
Ejemplo n.º 4
0
        public bool UpdateYsxx(Xm_Ysxx ysxx)
        {
            ArrayList sqls = new ArrayList();
            string tmpSql;

            tmpSql = "update xm_xmxx set YSSJ = to_date('{0}','yyyy-mm-dd hh24:mi:ss') where ITEMCODE = '{1}'";
            tmpSql = string.Format(tmpSql, ysxx.ZYSJ, ysxx.ITEMCODE);
            sqls.Add(tmpSql);

            sqls.Add(SqlBuilder.BuildUpdateSql(ysxx));
            return OracleHelper.ExecuteCommand(sqls);
        }
Ejemplo n.º 5
0
        public bool UpdateYsxx(Xm_Ysxx ysxx, Xm_Xmdw xmdw, List<Item_File> fileInfos, WorkFlowNode ysType)
        {
            ArrayList sqls = new ArrayList();
            Dictionary<string, string> deleteCondition = new Dictionary<string, string>();
            string tmpSql;

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

            tmpSql = "update xm_xmxx set YSWH = '{0}' where ITEMCODE = '{1}'";
            tmpSql = string.Format(tmpSql, ysxx.YSWH, ysxx.ITEMCODE);
            sqls.Add(tmpSql);

            if (xmdw != null)
            {
                //清空技术复合单位记录。
                deleteCondition.Clear();
                deleteCondition.Add("itemcode", ysxx.ITEMCODE);
                deleteCondition.Add("TYPE", ((int)ItemCompanyType.JSFH).ToString());
                sqls.Add(SqlBuilder.BuildDeleteSql<Xm_Xmdw>(deleteCondition));

                //添加技术复合单位记录。
                sqls.Add(SqlBuilder.BuildInsertSql(xmdw));
            }

            //清空项目所有的文件。
            tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}'";
            tmpSql = string.Format(tmpSql, ysxx.ITEMCODE, (int)ysType);
            sqls.Add(tmpSql);

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

            return OracleHelper.ExecuteCommand(sqls);
        }
Ejemplo n.º 6
0
        public void UpdateYsxx(Xm_Ysxx ysxx, WorkFlowNode node, ref ArrayList strSql)
        {
            string tmpSql = string.Empty;
            if (node == WorkFlowNode.JunGong)
            {
                tmpSql = "delete from xm_ysxx where Itemcode = {0}";
                tmpSql = string.Format(tmpSql, ysxx.ITEMCODE);
                strSql.Add(tmpSql);
                tmpSql = "Insert Into xm_ysxx (itemCode,Yssqsj,Yssqdw) values ({0},to_date('{1}','yyyy-mm-dd'),'{2}')";
                tmpSql = string.Format(tmpSql, ysxx.ITEMCODE, ysxx.YSSQSJ.Value.ToString("yyyy-MM-dd"), ysxx.YSSQDW);
                strSql.Add(tmpSql);
            }
            if (node == WorkFlowNode.ChuYan)
            {
                tmpSql = "Update xm_ysxx set cydw = '{1}', cysj = to_date('{2}','yyyy-mm-dd') Where ItemCode = {0}";
                tmpSql = string.Format(tmpSql, ysxx.ITEMCODE, ysxx.CYDW, ysxx.CYSJ.Value.ToString("yyyy-MM-dd"));
                strSql.Add(tmpSql);
            }

            if (node == WorkFlowNode.ZhongYan)
            {
                tmpSql = "Update xm_ysxx set zydw = '{1}', zysj = to_date('{2}','yyyy-mm-dd'),yswh = '{3}',jsfhsj = to_date('{4}','yyyy-mm-dd') Where ItemCode = {0}";
                tmpSql = string.Format(tmpSql, ysxx.ITEMCODE, ysxx.ZYDW, ysxx.ZYSJ.Value.ToString("yyyy-MM-dd"), ysxx.YSWH, ysxx.JSFHSJ.Value.ToString("yyyy-MM-dd"));
                strSql.Add(tmpSql);

                tmpSql = "update xm_xmxx set YSSJ = to_date('{1}','yyyy-mm-dd') where ITEMCODE = '{0}'";
                tmpSql = string.Format(tmpSql, ysxx.ITEMCODE, ysxx.ZYSJ.Value.ToString("yyyy-MM-dd"));
                strSql.Add(tmpSql);
            }
        }
Ejemplo n.º 7
0
        /// <summary>
        /// 保存验收信息
        /// </summary>
        /// <param name="node"></param>
        /// <param name="ysxx"></param>
        /// <param name="itemFile"></param>
        /// <param name="xmdw"></param>
        /// <param name="gcxx"></param>
        /// <returns></returns>
        public bool SaveItem(WorkFlowNode node, Xm_Ysxx ysxx, List<Item_File> itemFile, Xm_Xmdw xmdw, Xm_Gcxx gcxx)
        {
            ArrayList strSql = new ArrayList();
            string tmpSql = string.Empty;
            ////文件
            new BusiItemManage().SaveItemFile(ysxx.ITEMCODE, node, itemFile, ref strSql);
            ////预算信息
            strSql.Add(SqlBuilder.BuildUpdateSql(ysxx));

            if (node == WorkFlowNode.ZhongYan)
            {
                ////工程信息
                new BusiItemManage().SaveItemGcxx(ysxx.ITEMCODE, gcxx, ref strSql);
                ////单位信息
                new BusiItemManage().SaveItemCompany(ysxx.ITEMCODE, ItemCompanyType.JSFH, xmdw, ref strSql);
                ////更新主表信息(验收时间、验收文号)
                tmpSql = "update xm_xmxx set YSSJ = to_date('{1}','yyyy-mm-dd'), YsWh = '{2}' where ITEMCODE = '{0}'";
                tmpSql = string.Format(tmpSql, ysxx.ITEMCODE,
                    ysxx.ZYSJ.HasValue ? ysxx.ZYSJ.Value.ToString("yyyy-MM-dd") : string.Empty, ysxx.YSWH);
                strSql.Add(tmpSql);
            }
            return OracleHelper.ExecuteCommand(strSql);
        }