157 |
157 |
IOConstructionBaseInfo cbDB = new IOConstructionBaseInfo();
|
158 |
158 |
try
|
159 |
159 |
{
|
160 |
|
string strSQL = cbDB.CreatePrimarykeyString(m_ConstructionCode);
|
161 |
|
if (!cbDB.SelectAction(strSQL, ref m_ConstructionBaseInfo)) return false;
|
|
160 |
StringBuilder strSQL = new StringBuilder();
|
|
161 |
strSQL.Append(cbDB.CreatePrimarykeyString(m_ConstructionCode));
|
|
162 |
if (!cbDB.SelectAction(strSQL.ToString(), ref m_ConstructionBaseInfo)) return false;
|
162 |
163 |
|
163 |
164 |
return true;
|
164 |
165 |
}
|
... | ... | |
185 |
186 |
{
|
186 |
187 |
// データ初期表示
|
187 |
188 |
// 積算予算書を取得する
|
188 |
|
string strSQL = ebDB.CreatePrimarykeyString(m_ConstructionCode);
|
|
189 |
StringBuilder strSQL = new StringBuilder();
|
|
190 |
strSQL.Append(ebDB.CreatePrimarykeyString(m_ConstructionCode));
|
189 |
191 |
EstimateBudget ebRec = new EstimateBudget();
|
190 |
|
bool bRet = ebDB.SelectAction(strSQL, ref ebRec);
|
|
192 |
bool bRet = ebDB.SelectAction(strSQL.ToString(), ref ebRec);
|
191 |
193 |
|
192 |
194 |
// データ取得
|
193 |
195 |
m_CostCalcEditValue1 = ebRec.RetValue1; // 予定価格
|
... | ... | |
348 |
350 |
try
|
349 |
351 |
{
|
350 |
352 |
// 積算予算書を取得する
|
351 |
|
string strSQL = ebDB.CreatePrimarykeyString(m_ConstructionCode);
|
|
353 |
StringBuilder strSQL = new StringBuilder();
|
|
354 |
strSQL.Append(ebDB.CreatePrimarykeyString(m_ConstructionCode));
|
352 |
355 |
EstimateBudget ebRec = new EstimateBudget();
|
353 |
|
ebDB.SelectAction(strSQL, ref ebRec);
|
|
356 |
ebDB.SelectAction(strSQL.ToString(), ref ebRec);
|
354 |
357 |
|
355 |
358 |
// データ表示
|
356 |
359 |
m_dispLabelControl[(int)DispControl.ConstructionCode].Text = CommonMotions.cnvStringCodeFromInt(m_ConstructionBaseInfo.ConstructionCode, "-", 8); // 工事コード
|
357 |
360 |
m_dispLabelControl[(int)DispControl.SubmittedDate].Text = CommonMotions.cnvDateToUndecidedString(m_ConstructionBaseInfo.EstimatesSubmittedDate); // 見積提出日
|
358 |
361 |
|
359 |
362 |
// 工事基本情報明細取得
|
360 |
|
strSQL = cbidDB.CreatePrimarykeyString(m_ConstructionCode, (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
|
|
363 |
strSQL.Clear();
|
|
364 |
strSQL.Append(cbidDB.CreatePrimarykeyString(m_ConstructionCode, (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName));
|
361 |
365 |
List<ConstructionBaseInfoDetail> workdlist = new List<ConstructionBaseInfoDetail>();
|
362 |
|
if (!cbidDB.SelectAction(strSQL, ref workdlist) || workdlist.Count == 0) return false;
|
|
366 |
if (!cbidDB.SelectAction(strSQL.ToString(), ref workdlist) || workdlist.Count == 0) return false;
|
363 |
367 |
m_dispLabelControl[(int)DispControl.ConstructionName].Text = workdlist[0].DetailString; // 工事名称
|
364 |
368 |
|
365 |
369 |
m_dispLabelControl[(int)DispControl.PredeterminedPrice].Text = ebRec.RetValue1.ToString("#,0"); // 予定価格
|
... | ... | |
367 |
371 |
|
368 |
372 |
// 工事種別マスタ取得
|
369 |
373 |
// 担当者マスタ取得
|
370 |
|
strSQL = ctypeDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionType);
|
|
374 |
strSQL.Clear();
|
|
375 |
strSQL.Append(ctypeDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionType));
|
371 |
376 |
ConstructionTypeMaster ctypeRec = new ConstructionTypeMaster();
|
372 |
|
ctypeDB.SelectAction(strSQL, ref ctypeRec);
|
|
377 |
ctypeDB.SelectAction(strSQL.ToString(), ref ctypeRec);
|
373 |
378 |
m_dispLabelControl[(int)DispControl.ConstructionType].Text = ctypeRec.NameString; // 工事種別
|
374 |
379 |
|
375 |
380 |
// 担当者マスタ取得
|
376 |
381 |
int PersonCode = ebRec.IntegratedCode;
|
377 |
382 |
if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
|
378 |
|
strSQL = picDB.CreatePrimarykeyString(PersonCode);
|
|
383 |
strSQL.Clear();
|
|
384 |
strSQL.Append(picDB.CreatePrimarykeyString(PersonCode));
|
379 |
385 |
PersonInChargeMaster personRec = new PersonInChargeMaster();
|
380 |
|
picDB.SelectAction(strSQL, ref personRec);
|
|
386 |
picDB.SelectAction(strSQL.ToString(), ref personRec);
|
381 |
387 |
m_dispLabelControl[(int)DispControl.IntegratedPerson].Text = personRec.PersonName; // 積算者
|
382 |
388 |
lblPersonCode.Text = PersonCode.ToString();
|
383 |
389 |
|
... | ... | |
418 |
424 |
|
419 |
425 |
// 積算見積明細に入力用の大項目があれば公共工事とする
|
420 |
426 |
List<EstimateDataDetail> DetailList = new List<EstimateDataDetail>();
|
421 |
|
string strSQL = DetailDB.CreatePrimarykeyString(m_ConstructionCode);
|
422 |
|
strSQL += " And (";
|
|
427 |
StringBuilder strSQL = new StringBuilder();
|
|
428 |
strSQL.Append(DetailDB.CreatePrimarykeyString(m_ConstructionCode));
|
|
429 |
strSQL.Append(" And (");
|
423 |
430 |
int i = 0;
|
424 |
431 |
foreach (int Comp in ClsCommonCosts.s_BiddingCode)
|
425 |
432 |
{
|
426 |
|
if (i != 0) strSQL += " Or";
|
427 |
|
strSQL += string.Format(" ComponentCode = {0}", Comp);
|
|
433 |
if (i != 0) strSQL.Append(" Or");
|
|
434 |
strSQL.AppendFormat(" ComponentCode = {0}", Comp);
|
428 |
435 |
i++;
|
429 |
436 |
}
|
430 |
|
strSQL += ")";
|
431 |
|
if (!DetailDB.SelectAction(strSQL, ref DetailList)) return;
|
|
437 |
strSQL.Append(")");
|
|
438 |
if (!DetailDB.SelectAction(strSQL.ToString(), ref DetailList)) return;
|
432 |
439 |
// データがあれば公共工事
|
433 |
440 |
if (DetailList.Count > 0) m_PublicConstruction = true;
|
434 |
441 |
}
|
... | ... | |
441 |
448 |
DetailDB.close(); DetailDB = null;
|
442 |
449 |
}
|
443 |
450 |
}
|
444 |
|
|
445 |
451 |
#endregion
|
446 |
452 |
|
447 |
453 |
#region 明細データをグリッドにセットする
|
... | ... | |
882 |
888 |
IOEstimateBudgetDetail DetailDB = new IOEstimateBudgetDetail();
|
883 |
889 |
try
|
884 |
890 |
{
|
885 |
|
string strSQL = string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
886 |
|
strSQL += " ORDER BY GROUPCOUNT, LINECOUNT";
|
|
891 |
StringBuilder strSQL = new StringBuilder();
|
|
892 |
strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
|
893 |
strSQL.Append(" ORDER BY GROUPCOUNT, LINECOUNT");
|
887 |
894 |
|
888 |
895 |
m_DetailDataList.Clear();
|
889 |
|
if (!DetailDB.SelectAction(strSQL, ref m_DetailDataList)) return false;
|
|
896 |
if (!DetailDB.SelectAction(strSQL.ToString(), ref m_DetailDataList)) return false;
|
890 |
897 |
// データ無は処理しない
|
891 |
898 |
if (m_DetailDataList.Count == 0) return true;
|
892 |
899 |
|
... | ... | |
998 |
1005 |
IOEstimateDataDetail DetailDB = new IOEstimateDataDetail();
|
999 |
1006 |
try
|
1000 |
1007 |
{
|
1001 |
|
string strSQL = "SELECT B.COMPANYNAME, C.COMPONENTNAME, SUM(A.LINETOTAL), A.COMPANYCODE, A.COMPONENTCODE, D.ITEMCODE, D.ITEMNAME";
|
1002 |
|
strSQL += " FROM ESTIMATEDATADETAIL A";
|
1003 |
|
strSQL += " LEFT JOIN SUBCONTRACTORMASTER B ON A.COMPANYCODE = B.COMPANYCODE";
|
1004 |
|
strSQL += " LEFT JOIN COMPONENTMASTER C ON A.COMPONENTCODE = C.COMPONENTCODE";
|
1005 |
|
strSQL += " LEFT JOIN CONSTRUCTIONITEMMASTER D ON A.ITEMCODE = D.ITEMCODE";
|
1006 |
|
strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode); // 対象工事のみ
|
1007 |
|
strSQL += string.Format(" And A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費以外を対象にする
|
1008 |
|
strSQL += " And A.MYEXPENSESFLG = 0"; // 経費を除外する
|
1009 |
|
strSQL += " And (A.COMPANYCODE != 0";
|
1010 |
|
strSQL += string.Format(" And A.COMPANYCODE != {0})", CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key); // 自社施工・会社割当無を除外する
|
1011 |
|
strSQL += " GROUP BY B.COMPANYNAME, C.COMPONENTNAME, D.ITEMNAME, A.COMPANYCODE, A.COMPONENTCODE, D.ITEMCODE";
|
1012 |
|
strSQL += " ORDER BY B.COMPANYNAME, C.COMPONENTNAME, D.ITEMNAME";
|
|
1008 |
StringBuilder strSQL = new StringBuilder();
|
|
1009 |
strSQL.Append("SELECT");
|
|
1010 |
strSQL.Append(" ifnull(B.COMPANYNAME,'不 明'),");
|
|
1011 |
strSQL.Append(" C.COMPONENTNAME,");
|
|
1012 |
strSQL.Append(" SUM(A.LINETOTAL),");
|
|
1013 |
strSQL.Append(" A.COMPANYCODE,");
|
|
1014 |
strSQL.Append(" A.COMPONENTCODE,");
|
|
1015 |
strSQL.Append(" D.ITEMCODE,");
|
|
1016 |
strSQL.Append(" D.ITEMNAME");
|
|
1017 |
strSQL.Append(" FROM ESTIMATEDATADETAIL A");
|
|
1018 |
strSQL.Append(" LEFT JOIN SUBCONTRACTORMASTER B ON A.COMPANYCODE = B.COMPANYCODE");
|
|
1019 |
strSQL.Append(" LEFT JOIN COMPONENTMASTER C ON A.COMPONENTCODE = C.COMPONENTCODE");
|
|
1020 |
strSQL.Append(" LEFT JOIN CONSTRUCTIONITEMMASTER D ON A.ITEMCODE = D.ITEMCODE");
|
|
1021 |
strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode); // 対象工事のみ
|
|
1022 |
strSQL.AppendFormat(" And A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費以外を対象にする
|
|
1023 |
strSQL.Append(" And A.MYEXPENSESFLG = 0"); // 経費を除外する
|
|
1024 |
//strSQL.Append(" And (A.COMPANYCODE != 0");
|
|
1025 |
strSQL.AppendFormat(" And A.COMPANYCODE != {0}",
|
|
1026 |
CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key); // 自社施工・会社割当無を除外する
|
|
1027 |
strSQL.AppendFormat(" And ((A.DataType = {0} And A.InputFlg = {1})",
|
|
1028 |
(int)CommonDefine.TabCotegory.Item,
|
|
1029 |
(int)CommonDefine.DirectInput.Input);
|
|
1030 |
strSQL.AppendFormat(" Or (A.DataType = {0} And A.LineTotal != 0))",
|
|
1031 |
(int)CommonDefine.TabCotegory.Spec);
|
|
1032 |
|
|
1033 |
strSQL.Append(" GROUP BY B.COMPANYNAME, C.COMPONENTNAME, D.ITEMNAME, A.COMPANYCODE, A.COMPONENTCODE, D.ITEMCODE");
|
|
1034 |
strSQL.Append(" ORDER BY B.COMPANYNAME, C.COMPONENTNAME, D.ITEMNAME");
|
1013 |
1035 |
ArrayList arList = new ArrayList();
|
1014 |
|
if (!DetailDB.ExecuteReader(strSQL, ref arList)) return;
|
|
1036 |
if (!DetailDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
|
1015 |
1037 |
// データ無は処理しない
|
1016 |
1038 |
if (arList.Count == 0) return;
|
1017 |
1039 |
|
... | ... | |
1132 |
1154 |
IOEstimateDataDetail DetailDB = new IOEstimateDataDetail();
|
1133 |
1155 |
try
|
1134 |
1156 |
{
|
1135 |
|
string strSQL = "SELECT B.COMPONENTNAME,A.ITEMNAME,SUM(A.LINETOTAL),A.COMPONENTCODE,A.ITEMCODE";
|
1136 |
|
strSQL += " FROM ESTIMATEDATADETAIL A, COMPONENTMASTER B";
|
1137 |
|
strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode); // 対象工事のみ
|
1138 |
|
strSQL += string.Format(" AND A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費以外を対象にする
|
1139 |
|
strSQL += " And A.MYEXPENSESFLG = 0"; // 経費を除外する
|
1140 |
|
strSQL += string.Format(" And A.COMPANYCODE = {0}",
|
1141 |
|
CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key); // 自社施工を除外する
|
1142 |
|
strSQL += " And A.COMPONENTCODE = B.COMPONENTCODE";
|
1143 |
|
strSQL += " GROUP BY B.COMPONENTNAME, A.COMPONENTCODE, A.ITEMNAME, A.ITEMCODE, A.PageCount";
|
1144 |
|
strSQL += " ORDER BY A.COMPONENTCODE, A.ITEMCODE, A.PAGECOUNT";
|
1145 |
|
//strSQL += " GROUP BY B.COMPONENTNAME, A.COMPONENTCODE, A.ITEMNAME, A.ITEMCODE, A.PageCount, A.LineCount";
|
1146 |
|
//strSQL += " ORDER BY A.COMPONENTCODE, A.ITEMCODE, A.PAGECOUNT, A.LINECOUNT";
|
|
1157 |
StringBuilder strSQL = new StringBuilder();
|
|
1158 |
strSQL.Append("SELECT B.COMPONENTNAME,A.ITEMNAME,SUM(A.LINETOTAL),A.COMPONENTCODE,A.ITEMCODE");
|
|
1159 |
strSQL.Append(" FROM ESTIMATEDATADETAIL A, COMPONENTMASTER B");
|
|
1160 |
strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode); // 対象工事のみ
|
|
1161 |
strSQL.AppendFormat(" AND A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費以外を対象にする
|
|
1162 |
strSQL.Append(" And A.MYEXPENSESFLG = 0"); // 経費を除外する
|
|
1163 |
strSQL.AppendFormat(" And A.COMPANYCODE = {0}",
|
|
1164 |
CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key); // 自社施工を除外する
|
|
1165 |
strSQL.Append(" And A.COMPONENTCODE = B.COMPONENTCODE");
|
|
1166 |
strSQL.Append(" GROUP BY B.COMPONENTNAME, A.COMPONENTCODE, A.ITEMNAME, A.ITEMCODE, A.PageCount");
|
|
1167 |
strSQL.Append(" ORDER BY A.COMPONENTCODE, A.ITEMCODE, A.PAGECOUNT");
|
1147 |
1168 |
ArrayList arList = new ArrayList();
|
1148 |
|
if (!DetailDB.ExecuteReader(strSQL, ref arList)) return;
|
|
1169 |
if (!DetailDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
|
1149 |
1170 |
// データ無は処理しない
|
1150 |
1171 |
if (arList.Count == 0) return;
|
1151 |
1172 |
|
... | ... | |
1217 |
1238 |
IOMConstructionItem ItemDB = new IOMConstructionItem();
|
1218 |
1239 |
try
|
1219 |
1240 |
{
|
1220 |
|
string strSQL = string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
1221 |
|
strSQL += string.Format(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費を対象にする
|
1222 |
|
strSQL += " AND COMPANYCODE != 0"; // 会社割当のあるものを対象
|
1223 |
|
strSQL += " ORDER BY PageCount, LineCount";
|
|
1241 |
StringBuilder strSQL = new StringBuilder();
|
|
1242 |
strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
|
1243 |
strSQL.AppendFormat(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費を対象にする
|
|
1244 |
strSQL.Append(" AND COMPANYCODE != 0"); // 会社割当のあるものを対象
|
|
1245 |
strSQL.Append(" ORDER BY PageCount, LineCount");
|
1224 |
1246 |
|
1225 |
1247 |
List<EstimateDataDetail> DetailList = new List<EstimateDataDetail>();
|
1226 |
|
if (!DetailDB.SelectAction(strSQL, ref DetailList)) return;
|
|
1248 |
if (!DetailDB.SelectAction(strSQL.ToString(), ref DetailList)) return;
|
1227 |
1249 |
|
1228 |
1250 |
// データ無は処理しない
|
1229 |
1251 |
if (DetailList.Count == 0) return;
|
... | ... | |
1285 |
1307 |
SetPublicCommonTempFix();
|
1286 |
1308 |
|
1287 |
1309 |
// ----- 積み上げ共通仮設費
|
1288 |
|
string strSQL = string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
1289 |
|
strSQL += string.Format(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費を対象にする
|
1290 |
|
strSQL += string.Format(" AND ITEMCODE = {0}", ClsCommonCosts.s_PileUpCommonTempory); // 積み上げ共通仮設費を対象とする
|
1291 |
|
strSQL += " AND COMPANYCODE != 0"; // 会社割当のあるものを対象
|
1292 |
|
strSQL += " ORDER BY PageCount, LineCount"; // 見積入力と同じ並びにする
|
|
1310 |
StringBuilder strSQL = new StringBuilder();
|
|
1311 |
strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
|
1312 |
strSQL.AppendFormat(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費を対象にする
|
|
1313 |
strSQL.AppendFormat(" AND ITEMCODE = {0}", ClsCommonCosts.s_PileUpCommonTempory); // 積み上げ共通仮設費を対象とする
|
|
1314 |
strSQL.Append(" AND COMPANYCODE != 0"); // 会社割当のあるものを対象
|
|
1315 |
strSQL.Append(" ORDER BY PageCount, LineCount"); // 見積入力と同じ並びにする
|
1293 |
1316 |
List<EstimateDataDetail> DetailList = new List<EstimateDataDetail>();
|
1294 |
|
if (!DetailDB.SelectAction(strSQL, ref DetailList)) return;
|
|
1317 |
if (!DetailDB.SelectAction(strSQL.ToString(), ref DetailList)) return;
|
1295 |
1318 |
|
1296 |
1319 |
InsertBlankLine(1);
|
1297 |
1320 |
// 積み上げ共通仮設費タイトルセット
|
... | ... | |
1402 |
1425 |
dgv.Rows[m_CommonItemLine].Cells[(int)DispGridColumn.NegotiationPrice].ReadOnly = true;
|
1403 |
1426 |
|
1404 |
1427 |
// ----- 明細項目をセットする
|
1405 |
|
string strSQL = "SELECT A.LARGECODE, A.MIDDLECODE, B.LARGENAME, C.MIDDLENAME, C.COMMENTTEXT, C.DISPLAYORDER, IFNULL(D.TOTAL, 0)";
|
1406 |
|
strSQL += " FROM COMMONCOSTLINKMS A";
|
|
1428 |
StringBuilder strSQL = new StringBuilder();
|
|
1429 |
strSQL.Append("SELECT A.LARGECODE, A.MIDDLECODE, B.LARGENAME, C.MIDDLENAME, C.COMMENTTEXT, C.DISPLAYORDER, IFNULL(D.TOTAL, 0)");
|
|
1430 |
strSQL.Append(" FROM COMMONCOSTLINKMS A");
|
1407 |
1431 |
|
1408 |
|
strSQL += " LEFT JOIN (SELECT E.COMPONENTCODE, E.ITEMCODE, SUM(E.LINETOTAL) TOTAL FROM ESTIMATEDATADETAIL E";
|
1409 |
|
strSQL += string.Format(" WHERE E.CONSTRUCTIONCODE = {0} GROUP BY E.COMPONENTCODE, E.ITEMCODE) D ON A.ITEMCODE = D.ITEMCODE", m_ConstructionCode);
|
|
1432 |
strSQL.Append(" LEFT JOIN (SELECT E.COMPONENTCODE, E.ITEMCODE, SUM(E.LINETOTAL) TOTAL FROM ESTIMATEDATADETAIL E");
|
|
1433 |
strSQL.AppendFormat(" WHERE E.CONSTRUCTIONCODE = {0} GROUP BY E.COMPONENTCODE, E.ITEMCODE) D ON A.ITEMCODE = D.ITEMCODE", m_ConstructionCode);
|
1410 |
1434 |
|
1411 |
|
strSQL += " , COMMONCOSTLARGE B, COMMONCOSTMIDDLE C";
|
|
1435 |
strSQL.Append(" , COMMONCOSTLARGE B, COMMONCOSTMIDDLE C");
|
1412 |
1436 |
|
1413 |
|
strSQL += string.Format(" WHERE A.LARGECODE = {0}", ClsCommonCosts.s_CommunityCompCode);
|
1414 |
|
strSQL += " AND A.LARGECODE = B.LARGECODE";
|
1415 |
|
strSQL += " AND A.LARGECODE = C.LARGECODE";
|
1416 |
|
strSQL += " AND A.MIDDLECODE = C.MIDDLECODE";
|
1417 |
|
strSQL += " GROUP BY A.LARGECODE, A.MIDDLECODE, B.LARGENAME, C.MIDDLENAME, C.COMMENTTEXT, C.DISPLAYORDER, IFNULL(D.TOTAL, 0)";
|
1418 |
|
strSQL += " ORDER BY C.DISPLAYORDER";
|
|
1437 |
strSQL.AppendFormat(" WHERE A.LARGECODE = {0}", ClsCommonCosts.s_CommunityCompCode);
|
|
1438 |
strSQL.Append(" AND A.LARGECODE = B.LARGECODE");
|
|
1439 |
strSQL.Append(" AND A.LARGECODE = C.LARGECODE");
|
|
1440 |
strSQL.Append(" AND A.MIDDLECODE = C.MIDDLECODE");
|
|
1441 |
strSQL.Append(" GROUP BY A.LARGECODE, A.MIDDLECODE, B.LARGENAME, C.MIDDLENAME, C.COMMENTTEXT, C.DISPLAYORDER, IFNULL(D.TOTAL, 0)");
|
|
1442 |
strSQL.Append(" ORDER BY C.DISPLAYORDER");
|
1419 |
1443 |
|
1420 |
1444 |
ArrayList LinkList = new ArrayList();
|
1421 |
|
if (!LinkMSDB.ExecuteReader(strSQL, ref LinkList)) return;
|
|
1445 |
if (!LinkMSDB.ExecuteReader(strSQL.ToString(), ref LinkList)) return;
|
1422 |
1446 |
if (LinkList.Count == 0) return;
|
1423 |
1447 |
|
1424 |
1448 |
// 金額のセット
|
... | ... | |
1507 |
1531 |
IOMComponent CompDB = new IOMComponent();
|
1508 |
1532 |
try
|
1509 |
1533 |
{
|
1510 |
|
string strSQL = "SELECT COMPONENTCODE, ITEMNAME, SPECNAME, PRICEVALUE, FIXEDITEMCODE";
|
1511 |
|
strSQL += " FROM ESTIMATEDATA";
|
1512 |
|
strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
1513 |
|
strSQL += string.Format(" AND (COMPONENTCODE <> {0}", ClsCommonCosts.s_MaterialDisposal);
|
1514 |
|
strSQL += string.Format(" AND COMPONENTCODE <> {0}", ClsCommonCosts.s_FieldManagementCompCode);
|
1515 |
|
strSQL += string.Format(" AND COMPONENTCODE <> {0})", ClsCommonCosts.s_NormalManagementCompCode);
|
1516 |
|
strSQL += string.Format(" AND InputFlg = {0}", (int)CommonDefine.DirectInput.Input);
|
1517 |
|
strSQL += " ORDER BY LineCount";
|
|
1534 |
StringBuilder strSQL = new StringBuilder();
|
|
1535 |
strSQL.Append("SELECT COMPONENTCODE, ITEMNAME, SPECNAME, PRICEVALUE, FIXEDITEMCODE");
|
|
1536 |
strSQL.Append(" FROM ESTIMATEDATA");
|
|
1537 |
strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
|
1538 |
strSQL.AppendFormat(" AND (COMPONENTCODE <> {0}", ClsCommonCosts.s_MaterialDisposal);
|
|
1539 |
strSQL.AppendFormat(" AND COMPONENTCODE <> {0}", ClsCommonCosts.s_FieldManagementCompCode);
|
|
1540 |
strSQL.AppendFormat(" AND COMPONENTCODE <> {0})", ClsCommonCosts.s_NormalManagementCompCode);
|
|
1541 |
strSQL.AppendFormat(" AND InputFlg = {0}", (int)CommonDefine.DirectInput.Input);
|
|
1542 |
strSQL.Append(" ORDER BY LineCount");
|
1518 |
1543 |
|
1519 |
1544 |
ArrayList arList = new ArrayList();
|
1520 |
|
if (!esDB.ExecuteReader(strSQL, ref arList)) return;
|
|
1545 |
if (!esDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
|
1521 |
1546 |
|
1522 |
1547 |
// データ無は処理しない
|
1523 |
1548 |
if (arList.Count == 0) return;
|
... | ... | |
1584 |
1609 |
IOEstimateData esDB = new IOEstimateData();
|
1585 |
1610 |
try
|
1586 |
1611 |
{
|
1587 |
|
string strSQL = "SELECT COMPONENTCODE, ITEMNAME, SPECNAME, PRICEVALUE, FIXEDITEMCODE";
|
1588 |
|
strSQL += " FROM ESTIMATEDATA";
|
1589 |
|
strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
1590 |
|
strSQL += string.Format(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_MaterialDisposal);
|
1591 |
|
strSQL += " ORDER BY COMPONENTCODE";
|
|
1612 |
StringBuilder strSQL = new StringBuilder();
|
|
1613 |
strSQL.Append("SELECT COMPONENTCODE, ITEMNAME, SPECNAME, PRICEVALUE, FIXEDITEMCODE");
|
|
1614 |
strSQL.Append(" FROM ESTIMATEDATA");
|
|
1615 |
strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
|
1616 |
strSQL.AppendFormat(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_MaterialDisposal);
|
|
1617 |
strSQL.Append(" ORDER BY COMPONENTCODE");
|
1592 |
1618 |
|
1593 |
1619 |
ArrayList arList = new ArrayList();
|
1594 |
|
if (!esDB.ExecuteReader(strSQL, ref arList)) return;
|
|
1620 |
if (!esDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
|
1595 |
1621 |
|
1596 |
1622 |
// データ無は処理しない
|
1597 |
1623 |
if (arList.Count == 0) return;
|
... | ... | |
1767 |
1793 |
|
1768 |
1794 |
// 現場管理費明細
|
1769 |
1795 |
EstimateData DataRec = new EstimateData();
|
1770 |
|
string strSQL = DataDB.CreatePrimarykeyString(m_ConstructionCode);
|
1771 |
|
strSQL += string.Format(" AND ComponentCode = {0}", ClsCommonCosts.s_FieldManagementCompCode);
|
1772 |
|
DataDB.SelectAction(strSQL, ref DataRec);
|
|
1796 |
StringBuilder strSQL = new StringBuilder();
|
|
1797 |
strSQL.Append(DataDB.CreatePrimarykeyString(m_ConstructionCode));
|
|
1798 |
strSQL.AppendFormat(" AND ComponentCode = {0}", ClsCommonCosts.s_FieldManagementCompCode);
|
|
1799 |
DataDB.SelectAction(strSQL.ToString(), ref DataRec);
|
1773 |
1800 |
|
1774 |
1801 |
EstimateBudgetDetail DetailRec = new EstimateBudgetDetail();
|
1775 |
1802 |
DetailRec.GroupCount = (int)GroupName_EstimateBudget.FieldManage; // グループ番号
|
... | ... | |
1868 |
1895 |
|
1869 |
1896 |
// 一般管理費明細
|
1870 |
1897 |
EstimateData DataRec = new EstimateData();
|
1871 |
|
string strSQL = DataDB.CreatePrimarykeyString(m_ConstructionCode);
|
1872 |
|
strSQL += string.Format(" AND ComponentCode = {0}", ClsCommonCosts.s_NormalManagementCompCode);
|
1873 |
|
DataDB.SelectAction(strSQL, ref DataRec);
|
|
1898 |
StringBuilder strSQL = new StringBuilder();
|
|
1899 |
strSQL.Append(DataDB.CreatePrimarykeyString(m_ConstructionCode));
|
|
1900 |
strSQL.AppendFormat(" AND ComponentCode = {0}", ClsCommonCosts.s_NormalManagementCompCode);
|
|
1901 |
DataDB.SelectAction(strSQL.ToString(), ref DataRec);
|
1874 |
1902 |
|
1875 |
1903 |
EstimateBudgetDetail DetailRec = new EstimateBudgetDetail();
|
1876 |
1904 |
DetailRec.GroupCount = (int)GroupName_EstimateBudget.UsualManage; // グループ番号
|
... | ... | |
3204 |
3232 |
foreach (int[] wrkData in m_ChangeOutSourceList)
|
3205 |
3233 |
{
|
3206 |
3234 |
// 積算見積データ更新
|
3207 |
|
string strSQL = string.Format("UPDATE EstimateDataDetail SET CompanyCode = {0}", wrkData[1]); // 協力会社コード
|
3208 |
|
strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
3209 |
|
strSQL += string.Format(" AND COMPANYCODE = {0}", wrkData[0]);
|
|
3235 |
StringBuilder strSQL = new StringBuilder();
|
|
3236 |
strSQL.AppendFormat("UPDATE EstimateDataDetail SET CompanyCode = {0}", wrkData[1]); // 協力会社コード
|
|
3237 |
strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
|
|
3238 |
strSQL.AppendFormat(" AND COMPANYCODE = {0}", wrkData[0]);
|
3210 |
3239 |
|
3211 |
|
if (!DetailDB.ExecuteNonQuery(strSQL, false))
|
|
3240 |
if (!DetailDB.ExecuteNonQuery(strSQL.ToString(), false))
|
3212 |
3241 |
{
|
3213 |
3242 |
MessageBox.Show("積算予算書明細データ:協力会社コード更新に失敗しました。",
|
3214 |
3243 |
"登録エラー",
|
... | ... | |
3235 |
3264 |
private bool EstimateLinkCheck()
|
3236 |
3265 |
{
|
3237 |
3266 |
IOProcessApproval ProcAppDB = new IOProcessApproval();
|
|
3267 |
IOEstimateDataDetail DetailDB = new IOEstimateDataDetail();
|
3238 |
3268 |
try
|
3239 |
3269 |
{
|
3240 |
3270 |
// 積算見積の申請が承認されているかをチェックする
|
... | ... | |
3250 |
3280 |
if (ProcAppRec.ApprovalStatus == (int)CommonDefine.ApprovalStatus.Approval) return true;
|
3251 |
3281 |
}
|
3252 |
3282 |
|
3253 |
|
// 積算見積入力を見えないように表示して割付チェックを行う
|
3254 |
|
object sender = new object();
|
3255 |
|
EventArgs e = new EventArgs();
|
3256 |
|
ProcessExecute_EstimateInput(sender, e);
|
3257 |
|
|
3258 |
|
int ProcessNo = (int)ClsExcute.ProcessExecuteNo.EstimateInput;
|
3259 |
|
FrmEstimateInput frm = (FrmEstimateInput)ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle;
|
3260 |
|
frm.Hide();
|
3261 |
|
if (!frm.LinkBudgetPetition)
|
|
3283 |
// 業社割付のチェック
|
|
3284 |
strSQL.Clear();
|
|
3285 |
strSQL.Append("SELECT");
|
|
3286 |
strSQL.Append(" count(*)");
|
|
3287 |
strSQL.Append(" FROM ESTIMATEDATADETAIL A");
|
|
3288 |
strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode); // 対象工事のみ
|
|
3289 |
strSQL.AppendFormat(" And A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費以外を対象にする
|
|
3290 |
strSQL.Append(" And A.MYEXPENSESFLG = 0"); // 経費を除外する
|
|
3291 |
strSQL.AppendFormat(" And A.COMPANYCODE != {0}",
|
|
3292 |
CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key); // 自社施工・会社割当無を除外する
|
|
3293 |
strSQL.AppendFormat(" And ((A.DataType = {0} And A.InputFlg = {1} And A.CompanyCode = 0 And A.LineTotal != 0)",
|
|
3294 |
(int)CommonDefine.TabCotegory.Item,
|
|
3295 |
(int)CommonDefine.DirectInput.Input);
|
|
3296 |
strSQL.AppendFormat(" Or (A.DataType = {0} And A.CompanyCode = 0 And A.LineTotal != 0))",
|
|
3297 |
(int)CommonDefine.TabCotegory.Spec);
|
|
3298 |
ArrayList arList = new ArrayList();
|
|
3299 |
DetailDB.ExecuteReader(strSQL.ToString(), ref arList);
|
|
3300 |
object[] ObjRec = (object[])arList[0];
|
|
3301 |
if (CommonMotions.cnvInt(ObjRec[0]) != 0)
|
3262 |
3302 |
{
|
|
3303 |
// エラー時、積算見積入力を表示
|
|
3304 |
EstimateInputErrorDisp();
|
3263 |
3305 |
return false;
|
3264 |
3306 |
}
|
3265 |
3307 |
|
... | ... | |
3273 |
3315 |
finally
|
3274 |
3316 |
{
|
3275 |
3317 |
ProcAppDB.close(); ProcAppDB = null;
|
|
3318 |
DetailDB.close(); DetailDB = null;
|
3276 |
3319 |
}
|
3277 |
3320 |
}
|
3278 |
3321 |
#endregion
|
|
3322 |
|
|
3323 |
#region 見積予算書エラー表示
|
|
3324 |
/// <summary>
|
|
3325 |
/// 見積予算書エラー表示
|
|
3326 |
/// </summary>
|
|
3327 |
private void EstimateInputErrorDisp()
|
|
3328 |
{
|
|
3329 |
try
|
|
3330 |
{
|
|
3331 |
int ProcessNo = (int)ClsExcute.ProcessExecuteNo.EstimateInput;
|
|
3332 |
// 積算見積書入力起動
|
|
3333 |
FrmEstimateInput frm = new FrmEstimateInput();
|
|
3334 |
ClsExcute.SubFormHandleList[ProcessNo].ProcessNo = s_CurrentProcessNo;
|
|
3335 |
ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle = (Form)frm;
|
|
3336 |
frm.ConstructionCode = m_ConstructionCode;
|
|
3337 |
frm.EditLock = m_EditLock;
|
|
3338 |
frm.SubForm = true;
|
|
3339 |
frm.ShowInTaskbar = true;
|
|
3340 |
|
|
3341 |
// クロースドハンドラをこちらで定義する
|
|
3342 |
frm.FormClosed += new FormClosedEventHandler(FrmEstimateInputClosed);
|
|
3343 |
frm.Show();
|
|
3344 |
bool bErr = frm.LinkBudgetPetition;
|
|
3345 |
}
|
|
3346 |
catch (Exception ex)
|
|
3347 |
{
|
|
3348 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
|
3349 |
}
|
|
3350 |
}
|
|
3351 |
#endregion
|
3279 |
3352 |
}
|
3280 |
3353 |
}
|