public bool UpdateJdData(ActionEnum action, Xm_Ss_Ztb_Jbxx jzxx, List<Xm_Ss_Jdgz_Xmbb> xmybs, List<Xm_Ss_Jdgz_Xmbb> xmjbs, List<Item_File> files) { ArrayList sqls = new ArrayList(); string tmpSql; switch (action) { case ActionEnum.Insert: sqls.Add(SqlBuilder.BuildInsertSql(jzxx)); break; case ActionEnum.Update: sqls.Add(SqlBuilder.BuildUpdateSql(jzxx)); //清空项目所有的文件。 tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}' and filecode in ('{2}')"; tmpSql = string.Format(tmpSql, jzxx.ItemCode, (int)WorkFlowNode.ShiShi, "21"); sqls.Add(tmpSql); //清空所有项目报表记录。 Dictionary<string, string> xmbbCondition = new Dictionary<string, string>(); xmbbCondition.Add("itemcode", jzxx.ItemCode); sqls.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Jdgz_Xmbb>(xmbbCondition)); break; } tmpSql = "update xm_xmxx set KGSJ = to_date('{0}','yyyy-mm-dd hh24:mi:ss'),JGSJ = to_date('{1}','yyyy-mm-dd hh24:mi:ss') where ITEMCODE = '{2}'"; tmpSql = string.Format(tmpSql, jzxx.KGSJ, jzxx.JGSJ, jzxx.ItemCode); sqls.Add(tmpSql); //插入基本信息的文件。 foreach (Item_File fileInfo in files) { sqls.Add(SqlBuilder.BuildInsertSql(fileInfo)); } foreach (var xmbb in xmybs.Union(xmjbs)) { sqls.Add(SqlBuilder.BuildInsertSql(xmbb)); } return OracleHelper.ExecuteCommand(sqls); }
public bool UpdateZtbData(ActionEnum action, Xm_Ss_Ztb_Jbxx ztbJbxx, Xm_Xmdw xmdw, List<Xm_Ss_Ztb_Zbqk> zbqks, List<Xm_Ss_Ztb_Sght> sghts, List<Item_File> fileInfos) { List<string> sgdwNames = (from record in sghts select record.CBF).Distinct().ToList(); List<Xm_Xmdw> sgdws = new List<Xm_Xmdw>(); foreach (var item in sgdwNames) { sgdws.Add(new Xm_Xmdw() { ItemCode = ztbJbxx.ItemCode, Type = ItemCompanyType.SG, Name = item }); } ArrayList sqls = new ArrayList(); string tmpSql; switch (action) { case ActionEnum.Insert: sqls.Add(SqlBuilder.BuildInsertSql(ztbJbxx)); sqls.Add(SqlBuilder.BuildInsertSql(xmdw)); break; case ActionEnum.Update: sqls.Add(SqlBuilder.BuildUpdateSql(ztbJbxx)); sqls.Add(SqlBuilder.BuildUpdateSql(xmdw)); //清空项目所有的文件。 tmpSql = "delete from item_file where itemcode = '{0}' and nodeid = '{1}' and filecode in ('16','17','18','19')"; tmpSql = string.Format(tmpSql, ztbJbxx.ItemCode, (int)WorkFlowNode.ShiShi); sqls.Add(tmpSql); //清空所有中标情况记录。 tmpSql = "delete from xm_ss_ztb_zbqk where itemcode = '{0}'"; tmpSql = string.Format(tmpSql, ztbJbxx.ItemCode); sqls.Add(tmpSql); //清空所有施工合同记录。 tmpSql = "delete from xm_ss_ztb_sght where itemcode = '{0}'"; tmpSql = string.Format(tmpSql, ztbJbxx.ItemCode); sqls.Add(tmpSql); //清空所有施工单位记录。 tmpSql = "delete from xm_xmdw where itemcode = '{0}' and TYPE = '{1}'"; tmpSql = string.Format(tmpSql, ztbJbxx.ItemCode, (int)ItemCompanyType.SG); sqls.Add(tmpSql); break; } tmpSql = "update xm_xmxx set KBSJ = to_date('{0}','yyyy-mm-dd hh24:mi:ss') where ITEMCODE = '{1}'"; tmpSql = string.Format(tmpSql, ztbJbxx.KBSJ, ztbJbxx.ItemCode); sqls.Add(tmpSql); //插入基本信息的文件。 foreach (Item_File fileInfo in fileInfos) { sqls.Add(SqlBuilder.BuildInsertSql(fileInfo)); } foreach (var zbqk in zbqks) { sqls.Add(SqlBuilder.BuildInsertSql(zbqk)); } foreach (var sght in sghts) { sqls.Add(SqlBuilder.BuildInsertSql(sght)); } foreach (var sgdw in sgdws) { sqls.Add(SqlBuilder.BuildInsertSql(sgdw)); } return OracleHelper.ExecuteCommand(sqls); }
public void SaveItem_SS(Xm_Ss_Ztb_Jbxx ztbJbxx, List<Xm_Ss_Ztb_Zbqk> zbqks, List<Xm_Ss_Ztb_Sght> sghts, List<Xm_Ss_Gcjl_Jlry> jlrys, List<Xm_Ss_Gcjl_Jlht> jlhts, List<Xm_Ss_Jdgz_Xmbb> xmybs, List<Xm_Ss_Jdgz_Xmbb> xmjbs, List<Xm_Ss_Zjbf> zjbfs,ref ArrayList strSql) { Dictionary<string, string> deleteWhere = new Dictionary<string, string>(); deleteWhere.Add("itemcode", ztbJbxx.ItemCode); ////招投标基本记录。 strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Ztb_Jbxx>(deleteWhere)); strSql.Add(SqlBuilder.BuildInsertSql(ztbJbxx)); ////中标情况记录。 strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Ztb_Zbqk>(deleteWhere)); foreach (var zbqk in zbqks) { strSql.Add(SqlBuilder.BuildInsertSql(zbqk)); } ////施工合同记录。 strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Ztb_Sght>(deleteWhere)); foreach (var sght in sghts) { strSql.Add(SqlBuilder.BuildInsertSql(sght)); } ////监理人员记录。 strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Gcjl_Jlry>(deleteWhere)); foreach (var jlry in jlrys) { strSql.Add(SqlBuilder.BuildInsertSql(jlry)); } ////监理合同记录。 strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Gcjl_Jlht>(deleteWhere)); foreach (var jlht in jlhts) { strSql.Add(SqlBuilder.BuildInsertSql(jlht)); } ////项目报表记录。 strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Jdgz_Xmbb>(deleteWhere)); foreach (var xmbb in xmybs) { strSql.Add(SqlBuilder.BuildInsertSql(xmbb)); } foreach (var xmbb in xmjbs) { strSql.Add(SqlBuilder.BuildInsertSql(xmbb)); } ////资金拨付记录 strSql.Add(SqlBuilder.BuildDeleteSql<Xm_Ss_Zjbf>(deleteWhere)); foreach (var zjbf in zjbfs) { strSql.Add(SqlBuilder.BuildInsertSql(zjbf)); } }