リビジョン 312
日時更新処理、更新時キーをカラム番号より年月に変更
parse使用箇所修正
請求まとめ修正中
工事情報ヘッダー部最大化時の表示位置変更
branches/src/DataCheckExcute/DataCheckExcute/Common/Process/ClsChangeLedgerData.cs | ||
---|---|---|
495 | 495 |
{ |
496 | 496 |
// キー作成 |
497 | 497 |
StringBuilder strSQL = new StringBuilder(); |
498 |
strSQL.Append(LedgerExDB.CreatePrimarykeyString(ConstrCode, GroupCount, LineCount, ColumnCount)); |
|
498 |
//strSQL.Append(LedgerExDB.CreatePrimarykeyString(ConstrCode, GroupCount, LineCount, ColumnCount)); |
|
499 |
strSQL.Append(LedgerExDB.CreatePrimarykeyString(ConstrCode, GroupCount, LineCount)); |
|
499 | 500 |
strSQL.AppendFormat(" AND DATE(TargetMonth) = '{0}'", ColumnDate.ToShortDateString()); |
500 | 501 |
|
501 | 502 |
// データ読込み |
branches/src/DataCheckExcute/DataCheckExcute/Forms/DataEntry/ConstructionLedger/FrmConstructionLedger.cs | ||
---|---|---|
117 | 117 |
public enum GridColumn |
118 | 118 |
{ |
119 | 119 |
/// <summary> |
120 |
/// ?? |
|
120 |
/// 0:??
|
|
121 | 121 |
/// </summary> |
122 | 122 |
No = 0, |
123 | 123 |
/// <summary> |
124 |
/// ???t???O |
|
124 |
/// 1:???t???O
|
|
125 | 125 |
/// </summary> |
126 | 126 |
FixFlg, |
127 | 127 |
/// <summary> |
128 |
/// ?O???[?v???
|
|
128 |
/// 2:?????s???
|
|
129 | 129 |
/// </summary> |
130 |
DataLineCount, |
|
131 |
/// <summary> |
|
132 |
/// 3:?O???[?v??? |
|
133 |
/// </summary> |
|
130 | 134 |
GroupCount, |
131 | 135 |
/// <summary> |
132 |
/// ?\???L?[ |
|
136 |
/// 4:?\???L?[
|
|
133 | 137 |
/// </summary> |
134 | 138 |
ComponentCode, |
135 | 139 |
/// <summary> |
136 |
/// ?H??L?[ |
|
140 |
/// 5:?H??L?[
|
|
137 | 141 |
/// </summary> |
138 | 142 |
ItemCode, |
139 | 143 |
/// <summary> |
140 |
/// ??????? |
|
144 |
/// 6:???????
|
|
141 | 145 |
/// </summary> |
142 | 146 |
ItemName, |
143 | 147 |
/// <summary> |
144 |
/// ????? |
|
148 |
/// 7:?????
|
|
145 | 149 |
/// </summary> |
146 | 150 |
TextName, |
147 | 151 |
/// <summary> |
148 |
/// ??????R?[?h?^?C?v |
|
152 |
/// 8:??????R?[?h?^?C?v
|
|
149 | 153 |
/// </summary> |
150 | 154 |
CompanyType, |
151 | 155 |
/// <summary> |
152 |
/// ??????R?[?h |
|
156 |
/// 9:??????R?[?h
|
|
153 | 157 |
/// </summary> |
154 | 158 |
CompanyCode, |
155 | 159 |
/// <summary> |
156 |
/// ????????? |
|
160 |
/// 10:?????????
|
|
157 | 161 |
/// </summary> |
158 | 162 |
CompanyName, |
159 | 163 |
/// <summary> |
160 |
/// ?\????z |
|
164 |
/// 11:?\????z
|
|
161 | 165 |
/// </summary> |
162 | 166 |
EstimatePrice, |
163 | 167 |
/// <summary> |
164 |
/// ???s???z |
|
168 |
/// 12:???s???z
|
|
165 | 169 |
/// </summary> |
166 | 170 |
ExecPrice, |
167 | 171 |
/// <summary> |
168 |
/// ?\???? |
|
172 |
/// 13:?\????
|
|
169 | 173 |
/// </summary> |
170 | 174 |
Percent, |
171 | 175 |
/// <summary> |
172 |
/// ?^?C?g???s?t???O |
|
176 |
/// 14:?^?C?g???s?t???O
|
|
173 | 177 |
/// </summary> |
174 | 178 |
TitleFlg, |
175 | 179 |
/// <summary> |
176 |
/// ?g?[?^???s?t???O |
|
180 |
/// 15:?g?[?^???s?t???O
|
|
177 | 181 |
/// </summary> |
178 | 182 |
TotalFlg, |
179 | 183 |
/// <summary> |
180 |
/// ??s?t???O |
|
184 |
/// 16:??s?t???O
|
|
181 | 185 |
/// </summary> |
182 | 186 |
BlankFlg, |
183 | 187 |
/// <summary> |
184 |
/// ???????t???O |
|
188 |
/// 17:???????t???O
|
|
185 | 189 |
/// </summary> |
186 | 190 |
IndependentFlg, |
187 | 191 |
/// <summary> |
188 |
/// ?]??????t???O |
|
192 |
/// 18:?]??????t???O
|
|
189 | 193 |
/// </summary> |
190 | 194 |
ChildFlg, |
191 | 195 |
/// <summary> |
192 |
/// ?????H???t???O |
|
196 |
/// 19:?????H???t???O
|
|
193 | 197 |
/// </summary> |
194 | 198 |
FluctuationFlg, |
195 | 199 |
/// <summary> |
196 |
/// ???^?U???? |
|
200 |
/// 20:???^?U????
|
|
197 | 201 |
/// </summary> |
198 | 202 |
SalaryFlg, |
199 | 203 |
/// <summary> |
200 |
/// ???^?U?????? |
|
204 |
/// 21:???^?U??????
|
|
201 | 205 |
/// </summary> |
202 | 206 |
SalaryDays, |
203 | 207 |
/// <summary> |
204 |
/// ?S?????t???O |
|
208 |
/// 22:?S?????t???O
|
|
205 | 209 |
/// </summary> |
206 | 210 |
OperatingFlg, |
207 | 211 |
/// <summary> |
208 |
/// ???H????? |
|
212 |
/// 23:???H?????
|
|
209 | 213 |
/// </summary> |
210 | 214 |
SourceCode, |
211 | 215 |
/// <summary> |
212 |
/// ?H??????^?C?g?? |
|
216 |
/// 24:?H??????^?C?g??
|
|
213 | 217 |
/// </summary> |
214 | 218 |
JoinTitleFlg, |
215 | 219 |
/// <summary> |
216 |
/// ?o?^?????z???^ |
|
220 |
/// 25:?o?^?????z???^
|
|
217 | 221 |
/// </summary> |
218 | 222 |
SalaryOnRegist, |
219 | 223 |
/// <summary> |
220 |
/// ?????????s?t???O |
|
224 |
/// 26:?????????s?t???O
|
|
221 | 225 |
/// </summary> |
222 | 226 |
PurchaseOrderFlg, |
223 | 227 |
/// <summary> |
224 |
/// ?x?????z1?J????
|
|
228 |
/// 27:??????
|
|
225 | 229 |
/// </summary> |
230 |
DetailNo, |
|
231 |
/// <summary> |
|
232 |
/// 28:?x?????z1?J???? |
|
233 |
/// </summary> |
|
226 | 234 |
Payment, |
227 | 235 |
} |
228 | 236 |
|
branches/src/ProcessManagement/ProcessManagement/Common/CommonMotions.cs | ||
---|---|---|
2714 | 2714 |
} |
2715 | 2715 |
else |
2716 | 2716 |
{ |
2717 |
strSQL.AppendFormat(" ((A1.years = {0} AND A2.month IN(", dtStart.Year.ToString("0000")); |
|
2718 |
for (int i = dtStart.Month; i <= 12; i++) |
|
2717 |
strSQL.Append(" ("); |
|
2718 |
|
|
2719 |
for (int iYear = dtStart.Year; iYear <= dtLast.Year; iYear++) |
|
2719 | 2720 |
{ |
2720 |
if (i != dtStart.Month) strSQL.Append(", "); |
|
2721 |
strSQL.AppendFormat("{0} ", i); |
|
2721 |
// 先頭以外はORを追加する |
|
2722 |
if (iYear != dtStart.Year) strSQL.AppendFormat(" OR"); |
|
2723 |
|
|
2724 |
strSQL.AppendFormat(" (A1.years = {0}", iYear.ToString("0000")); |
|
2725 |
strSQL.Append(" AND A2.month IN ("); |
|
2726 |
|
|
2727 |
if (iYear == dtStart.Year) |
|
2728 |
{ // 先頭年 |
|
2729 |
for (int i = dtStart.Month; i <= 12; i++) |
|
2730 |
{ |
|
2731 |
if (i != dtStart.Month) strSQL.Append(", "); |
|
2732 |
strSQL.AppendFormat("{0} ", i); |
|
2733 |
} |
|
2734 |
} |
|
2735 |
else if (iYear == dtLast.Year) |
|
2736 |
{ // 最終年 |
|
2737 |
for (int i = 1; i <= dtLast.Month; i++) |
|
2738 |
{ |
|
2739 |
if (i != 1) strSQL.Append(", "); |
|
2740 |
strSQL.AppendFormat("{0} ", i); |
|
2741 |
} |
|
2742 |
} |
|
2743 |
else |
|
2744 |
{ // 以外の年 |
|
2745 |
for (int i = 1; i <= 12; i++) |
|
2746 |
{ |
|
2747 |
if (i != 1) strSQL.Append(", "); |
|
2748 |
strSQL.AppendFormat("{0} ", i); |
|
2749 |
} |
|
2750 |
} |
|
2751 |
strSQL.Append("))"); |
|
2722 | 2752 |
} |
2723 |
strSQL.Append("))"); |
|
2724 |
strSQL.AppendFormat(" OR (A1.years = {0} AND A2.month IN(", dtLast.Year.ToString("0000")); |
|
2725 |
for (int i = 1; i <= dtLast.Month; i++) |
|
2726 |
{ |
|
2727 |
if (i != 1) strSQL.Append(", "); |
|
2728 |
strSQL.AppendFormat("{0} ", i); |
|
2729 |
} |
|
2730 |
strSQL.Append(")))"); |
|
2753 |
strSQL.Append(")"); |
|
2731 | 2754 |
} |
2732 | 2755 |
|
2733 | 2756 |
strSQL.Append(" AND DATE(CONCAT(A1.years, '/', A2.month, '/', A3.days)) IS NOT NULL"); |
branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs | ||
---|---|---|
14 | 14 |
/// <summary> |
15 | 15 |
/// 本体バージョン |
16 | 16 |
/// </summary> |
17 |
public static int s_SystemVersion = 128;
|
|
17 |
public static int s_SystemVersion = 130;
|
|
18 | 18 |
|
19 | 19 |
/// <summary> |
20 | 20 |
/// コピー・環境バージョン |
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeLedgerData.cs | ||
---|---|---|
1050 | 1050 |
{ |
1051 | 1051 |
// 行番号をセットする |
1052 | 1052 |
ExcuteRec.LineCount = CommonMotions.cnvInt(objRec[2]); |
1053 |
DetailRec.LineCount = ExcuteRec.LineCount; |
|
1053 | 1054 |
// 実行データも存在する場合 |
1054 | 1055 |
if (CommonMotions.cnvInt(objRec[3]) != 0) |
1055 | 1056 |
{ |
... | ... | |
1057 | 1058 |
} |
1058 | 1059 |
} |
1059 | 1060 |
|
1060 |
|
|
1061 | 1061 |
if (bExists) |
1062 | 1062 |
{ // データ存在時は支払金額更新 |
1063 | 1063 |
if (!ExecDB.UpdateFeild(ExcuteRec.ConstructionCode, |
... | ... | |
1080 | 1080 |
strSQL.AppendFormat(" And DetailCount = {0}", DetailRec.DetailCount); |
1081 | 1081 |
|
1082 | 1082 |
// データがない場合は新規行番号を取得する |
1083 |
ExcuteRec.LineCount = DetailDB.SelectMaxLineCount(strSQL.ToString(), false); |
|
1083 |
ExcuteRec.LineCount = DetailDB.SelectMaxLineCount(strSQL.ToString(), false) + 1;
|
|
1084 | 1084 |
DetailRec.LineCount = ExcuteRec.LineCount; |
1085 | 1085 |
|
1086 | 1086 |
// 明細データも実行データも存在しない |
1087 | 1087 |
if (ExecList.Count < 1) |
1088 | 1088 |
{ |
1089 | 1089 |
// データがない場合は新規明細番号を取得する |
1090 |
DetailRec.DetailCount = DetailDB.SelectMaxDetailCount(strSQL.ToString(), false); |
|
1090 |
DetailRec.DetailCount = DetailDB.SelectMaxDetailCount(strSQL.ToString(), false) + 1;
|
|
1091 | 1091 |
|
1092 | 1092 |
// 明細データ新規作成 |
1093 | 1093 |
if (!DetailDB.InsertAction(DetailRec, false)) |
... | ... | |
1139 | 1139 |
} |
1140 | 1140 |
} |
1141 | 1141 |
#endregion |
1142 |
|
|
1143 |
#region 工事詳細台帳支払いデータ登録(手間・業者支払用) |
|
1144 |
/// <summary> |
|
1145 |
/// 工事詳細台帳支払いデータ登録(手間・業者支払用) |
|
1146 |
/// </summary> |
|
1147 |
/// <param name="EntryList"></param> |
|
1148 |
/// <returns></returns> |
|
1149 |
public static bool EntryExecuteData(IOConstructionLedgerDetail DetailDB |
|
1150 |
, IOConstructionLedgerExcute ExecDB |
|
1151 |
, ConstructionLedgerDetail DetailRec |
|
1152 |
, ConstructionLedgerExcute ExcuteRec) |
|
1153 |
{ |
|
1154 |
try |
|
1155 |
{ |
|
1156 |
// 工事番号が0の場合は処理しない |
|
1157 |
if (ExcuteRec.ConstructionCode == 0) return false; |
|
1158 |
// グループ番号が0の場合は処理しない |
|
1159 |
if (ExcuteRec.GroupCount == 0) return false; |
|
1160 |
|
|
1161 |
// SQL作成 |
|
1162 |
StringBuilder strSQL = new StringBuilder(); |
|
1163 |
strSQL.Append("Select"); |
|
1164 |
strSQL.Append(" A.ConstructionCode"); |
|
1165 |
strSQL.Append(", A.GroupCount"); |
|
1166 |
strSQL.Append(", A.LineCount"); |
|
1167 |
strSQL.Append(", B.ColumnCount"); |
|
1168 |
strSQL.Append(", B.TargetMonth"); |
|
1169 |
strSQL.Append(" From"); |
|
1170 |
strSQL.Append(" constructionledgerdetail AS A"); |
|
1171 |
strSQL.Append(" Left Join constructionledgerexcute AS B"); |
|
1172 |
strSQL.Append(" On B.ConstructionCode = A.ConstructionCode"); |
|
1173 |
strSQL.Append(" And B.GroupCount = A.GroupCount"); |
|
1174 |
strSQL.Append(" And B.LineCount = A.LineCount"); |
|
1175 |
strSQL.AppendFormat(" And B.ColumnCount = {0}", ExcuteRec.ColumnCount); |
|
1176 |
|
|
1177 |
strSQL.AppendFormat(" Where A.ConstructionCode = {0}", ExcuteRec.ConstructionCode); |
|
1178 |
strSQL.AppendFormat(" And A.GroupCount = {0}", ExcuteRec.GroupCount); |
|
1179 |
strSQL.AppendFormat(" And A.DetailCount = {0}", DetailRec.DetailCount); |
|
1180 |
|
|
1181 |
ArrayList ExecList = new ArrayList(); |
|
1182 |
if (!ExecDB.ExecuteReader(strSQL.ToString(), ref ExecList, false)) return false; |
|
1183 |
|
|
1184 |
bool bExists = false; |
|
1185 |
object[] objRec = (object[])ExecList[0]; |
|
1186 |
// 明細データが存在して実行データも存在する場合 |
|
1187 |
if (ExecList.Count > 0) |
|
1188 |
{ |
|
1189 |
ExcuteRec.LineCount = CommonMotions.cnvInt(objRec[2]); |
|
1190 |
DetailRec.LineCount = ExcuteRec.LineCount; |
|
1191 |
if (CommonMotions.cnvInt(objRec[3]) != 0) |
|
1192 |
{ |
|
1193 |
bExists = true; |
|
1194 |
} |
|
1195 |
} |
|
1196 |
|
|
1197 |
if (bExists) |
|
1198 |
{ // データ存在時は支払金額更新 |
|
1199 |
if (!ExecDB.UpdateFeild(ExcuteRec.ConstructionCode, |
|
1200 |
ExcuteRec.GroupCount, |
|
1201 |
ExcuteRec.LineCount, |
|
1202 |
ExcuteRec.ColumnCount, |
|
1203 |
(int)IOConstructionLedgerExcute.TableColumn.PaymentAmount, |
|
1204 |
ExcuteRec.PaymentAmount, |
|
1205 |
false)) |
|
1206 |
{ |
|
1207 |
return false; |
|
1208 |
} |
|
1209 |
} |
|
1210 |
else |
|
1211 |
{ |
|
1212 |
// キー項目取得条件作成 |
|
1213 |
strSQL.Clear(); |
|
1214 |
strSQL.Append(DetailDB.CreatePrimarykeyString(ExcuteRec.ConstructionCode, ExcuteRec.GroupCount)); |
|
1215 |
|
|
1216 |
// データがない場合は新規行番号を取得する |
|
1217 |
ExcuteRec.LineCount = DetailDB.SelectMaxLineCount(strSQL.ToString(), false) + 1; |
|
1218 |
DetailRec.LineCount = ExcuteRec.LineCount; |
|
1219 |
|
|
1220 |
// 明細データも実行データも存在しない |
|
1221 |
if (ExecList.Count < 1) |
|
1222 |
{ |
|
1223 |
// データがない場合は新規明細番号を取得する |
|
1224 |
DetailRec.DetailCount = DetailDB.SelectMaxDetailCount(strSQL.ToString(), false) + 1; |
|
1225 |
|
|
1226 |
// 明細データ新規作成 |
|
1227 |
if (!DetailDB.InsertAction(DetailRec, false)) |
|
1228 |
{ |
|
1229 |
return false; |
|
1230 |
} |
|
1231 |
} |
|
1232 |
|
|
1233 |
// 実行データ新規作成 |
|
1234 |
if (!ExecDB.InsertAction(ExcuteRec, false)) |
|
1235 |
{ |
|
1236 |
return false; |
|
1237 |
} |
|
1238 |
} |
|
1239 |
|
|
1240 |
List<int> ConstrCodeList = new List<int>(); |
|
1241 |
// 更新対象リストへ追加 |
|
1242 |
ConstrCodeList.Add(ExcuteRec.ConstructionCode); |
|
1243 |
|
|
1244 |
// 台帳再計算 |
|
1245 |
if (!LedgerRecalculate(ExecDB, ConstrCodeList)) |
|
1246 |
{ |
|
1247 |
return false; |
|
1248 |
} |
|
1249 |
|
|
1250 |
return true; |
|
1251 |
} |
|
1252 |
catch (System.Exception ex) |
|
1253 |
{ |
|
1254 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
1255 |
return false; |
|
1256 |
} |
|
1257 |
} |
|
1258 |
#endregion |
|
1142 | 1259 |
// ↑↑ ** ----- インターフェース ----- ** |
1143 | 1260 |
} |
1144 | 1261 |
} |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOBillingDataDetail.cs | ||
---|---|---|
390 | 390 |
/// <returns></returns> |
391 | 391 |
public bool RowLock(int CompanyCode, int TargetDate, int SeqNo, int LineCount, bool bConnect = true) |
392 | 392 |
{ |
393 |
|
|
394 | 393 |
//インターフェース |
395 | 394 |
StringBuilder strcmd = new StringBuilder(); |
396 | 395 |
ArrayList arData = new ArrayList(); |
... | ... | |
414 | 413 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString()); |
415 | 414 |
return false; |
416 | 415 |
} |
416 |
} |
|
417 |
#endregion |
|
417 | 418 |
|
419 |
#region 業者請求明細データ最大行番号取得 |
|
420 |
/// <summary> |
|
421 |
/// 業者請求明細データの最大行番号を取得する |
|
422 |
/// </summary> |
|
423 |
/// <param name="AddSQLString"></param> |
|
424 |
/// <param name="bConnect"></param> |
|
425 |
/// <returns></returns> |
|
426 |
public int SelectMaxLineNo(IOBillingDataDetail IoBdD, string AddSQLString, bool bConnect = true) |
|
427 |
{ |
|
428 |
// インターフェース |
|
429 |
StringBuilder strcmd = new StringBuilder(); |
|
430 |
ArrayList arData = new ArrayList(); |
|
431 |
int iRet = 0; |
|
432 |
try |
|
433 |
{ |
|
434 |
// SQL作成 |
|
435 |
strcmd.AppendFormat("SELECT IFNULL(MAX(LineCount), 0) FROM BillingDataDetail {0}", AddSQLString); |
|
418 | 436 |
|
437 |
// SQL実行 |
|
438 |
if (!IoBdD.ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return iRet; |
|
439 |
|
|
440 |
// データセット |
|
441 |
foreach (object[] objwrk in arData) |
|
442 |
{ |
|
443 |
if (objwrk[0].ToString().Equals("null")) |
|
444 |
iRet = 0; |
|
445 |
else |
|
446 |
iRet = CommonMotions.cnvInt(objwrk[0]); |
|
447 |
} |
|
448 |
|
|
449 |
} |
|
450 |
catch (Exception ex) |
|
451 |
{ |
|
452 |
logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString()); |
|
453 |
} |
|
454 |
return iRet; |
|
419 | 455 |
} |
420 | 456 |
#endregion |
421 | 457 |
|
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentDataDetail.cs | ||
---|---|---|
144 | 144 |
strcmd.Clear(); |
145 | 145 |
strcmd.Append("INSERT INTO PaymentDataDetail"); |
146 | 146 |
|
147 |
strcmd.Append(" VALUES ("); |
|
147 |
strcmd.Append("("); |
|
148 |
bool bFirst = true; |
|
149 |
foreach (var gender in Enum.GetValues(typeof(NameColumn))) |
|
150 |
{ |
|
151 |
if (!bFirst) strcmd.Append(" ,"); |
|
152 |
strcmd.Append(gender.ToString()); |
|
153 |
bFirst = false; |
|
154 |
} |
|
155 |
strcmd.Append(") VALUES ("); |
|
148 | 156 |
|
149 | 157 |
strcmd.AppendFormat(" {0}", work.CompanyCode.ToString()); |
150 | 158 |
strcmd.AppendFormat(", {0}", work.TargetDate.ToString()); |
... | ... | |
447 | 455 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString()); |
448 | 456 |
return false; |
449 | 457 |
} |
450 |
|
|
451 |
|
|
452 | 458 |
} |
453 | 459 |
|
454 | 460 |
|
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfo.designer.cs | ||
---|---|---|
3616 | 3616 |
// |
3617 | 3617 |
// groupBoxEx1 |
3618 | 3618 |
// |
3619 |
this.groupBoxEx1.Anchor = System.Windows.Forms.AnchorStyles.Top; |
|
3619 | 3620 |
this.groupBoxEx1.BorderColor = System.Drawing.Color.White; |
3620 | 3621 |
this.groupBoxEx1.Controls.Add(this.btnApprovalList); |
3621 | 3622 |
this.groupBoxEx1.Controls.Add(this.rdbStatusHikitugiFlg); |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs | ||
---|---|---|
896 | 896 |
try |
897 | 897 |
{ |
898 | 898 |
// ?????f?[?^??? |
899 |
strSQL.Append("SELECT A.MAINCONSTRUCTIONCODE"); |
|
900 |
strSQL.Append(", B.ORDERERSDIVISION"); |
|
901 |
strSQL.Append(", B.ORDERERSCODE"); |
|
902 |
strSQL.Append(", B.TARGETDATE"); |
|
903 |
strSQL.Append(", DATE_FORMAT(B.CONFIRMATIONDATE, '%Y/%m/%d') AS DEPOSITDATE"); |
|
904 |
strSQL.Append(", DATE_FORMAT(B.CONFIRMATIONDATE, '%Y/%m/%d') AS CONFIRMATIONDATE"); |
|
905 |
strSQL.Append(", B.DEPOSITAMOUNT"); |
|
906 |
strSQL.Append(", B.DIFFERENCEAMOUNT"); |
|
907 |
strSQL.Append(" FROM requestdatadetail AS A, depositdatadetail AS B"); |
|
908 |
strSQL.AppendFormat(" WHERE A.MAINCONSTRUCTIONCODE = {0}", ConstrCode); |
|
909 |
strSQL.Append(" AND B.REQUESTNO = A.REQUESTNO"); |
|
899 |
|
|
900 |
strSQL.Append("SELECT"); |
|
901 |
strSQL.Append(" A.MAINCONSTRUCTIONCODE"); |
|
902 |
strSQL.Append(" , B.ORDERERSDIVISION"); |
|
903 |
strSQL.Append(" , B.ORDERERSCODE"); |
|
904 |
strSQL.Append(" , B.TARGETDATE"); |
|
905 |
strSQL.Append(" , DATE_FORMAT(B.CONFIRMATIONDATE, '%Y/%m/%d') AS DEPOSITDATE"); |
|
906 |
strSQL.Append(" , DATE_FORMAT(B.CONFIRMATIONDATE, '%Y/%m/%d') AS CONFIRMATIONDATE"); |
|
907 |
strSQL.Append(" , B.DEPOSITAMOUNT"); |
|
908 |
strSQL.Append(" , B.DIFFERENCEAMOUNT"); |
|
909 |
strSQL.Append(" FROM"); |
|
910 |
strSQL.Append(" (SELECT"); |
|
911 |
strSQL.Append(" A1.MAINCONSTRUCTIONCODE AS MAINCONSTRUCTIONCODE"); |
|
912 |
strSQL.Append(" , A1.REQUESTNO AS REQUESTNO"); |
|
913 |
strSQL.Append(" , sum(A1.REQUESTAMOUNT) AS REQUESTAMOUNT"); |
|
914 |
strSQL.Append(" FROM"); |
|
915 |
strSQL.Append(" requestdatadetail AS A1"); |
|
916 |
strSQL.Append(" WHERE"); |
|
917 |
strSQL.AppendFormat(" A1.MAINCONSTRUCTIONCODE = {0}", ConstrCode); |
|
918 |
strSQL.Append(" ) AS A"); |
|
919 |
strSQL.Append(" , depositdatadetail AS B"); |
|
920 |
strSQL.Append(" WHERE B.REQUESTNO = A.REQUESTNO"); |
|
910 | 921 |
} |
911 | 922 |
catch (Exception ex) |
912 | 923 |
{ |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionLedger/FrmConstructionLedgerAuxiliary.cs | ||
---|---|---|
6455 | 6455 |
switch (GroupNo) |
6456 | 6456 |
{ |
6457 | 6457 |
// 指導員費用 |
6458 |
case (int)FrmConstructionBudget.DataGroup.InstructorCosts:
|
|
6458 |
case (int)DataGroup.Instructor:
|
|
6459 | 6459 |
nSalaryFlg = BudgetRec.I_SalaryFlg; |
6460 | 6460 |
nSalaryDays = BudgetRec.I_SalaryDays; |
6461 | 6461 |
break; |
6462 | 6462 |
// 副担当者給与費用 |
6463 |
case (int)FrmConstructionBudget.DataGroup.AssistantCosts:
|
|
6463 |
case (int)DataGroup.Assistant:
|
|
6464 | 6464 |
nSalaryFlg = BudgetRec.A_SalaryFlg; |
6465 | 6465 |
nSalaryDays = BudgetRec.A_SalaryDays; |
6466 | 6466 |
break; |
6467 | 6467 |
// 担当者給与費用 |
6468 |
case (int)FrmConstructionBudget.DataGroup.PayrollExpenses:
|
|
6468 |
case (int)DataGroup.Payroll:
|
|
6469 | 6469 |
nSalaryFlg = BudgetRec.SalaryFlg; |
6470 | 6470 |
nSalaryDays = BudgetRec.SalaryDays; |
6471 | 6471 |
break; |
... | ... | |
6482 | 6482 |
DataGridViewRow RowData = dgv.Rows[TargetLine]; |
6483 | 6483 |
|
6484 | 6484 |
RowData.Cells[(int)GridColumn.SalaryFlg].Value = nSalaryFlg; |
6485 |
RowData.Cells[(int)GridColumn.SalaryDays].Value = nSalaryDays; |
|
6485 |
if (nSalaryFlg == (int)CommonDefine.SalaryDevision.DaysInput) |
|
6486 |
RowData.Cells[(int)GridColumn.SalaryDays].Value = nSalaryDays + CommonMotions.cnvInt(RowData.Cells[(int)GridColumn.SalaryDays].Value); |
|
6487 |
else |
|
6488 |
RowData.Cells[(int)GridColumn.SalaryDays].Value = ""; |
|
6489 |
|
|
6486 | 6490 |
RowData.Cells[(int)GridColumn.SourceCode].Value = m_AddingConstrCode; |
6487 | 6491 |
|
6488 | 6492 |
int EstimatePrice = CommonMotions.cnvInt(RowData.Cells[(int)GridColumn.EstimatePrice].Value) + (int)DetailRec.EstimatePrice; |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Material/MaterialCountEntry/FrmMaterialCountEntry.cs | ||
---|---|---|
325 | 325 |
} |
326 | 326 |
|
327 | 327 |
//割り当て可能チェック |
328 |
if (int.Parse(lblRentCount.Text) < int.Parse(txtHaki.Text))
|
|
328 |
if (CommonMotions.cnvInt(lblRentCount.Text) < CommonMotions.cnvInt(txtHaki.Text))
|
|
329 | 329 |
{ |
330 | 330 |
sError = "割当可能数を超えて破棄できません。"; |
331 | 331 |
bRet = false; |
... | ... | |
624 | 624 |
return; |
625 | 625 |
} |
626 | 626 |
|
627 |
if (txtTuika.Text.Length > 0 && int.Parse(txtTuika.Text) > 0)
|
|
627 |
if (txtTuika.Text.Length > 0 && CommonMotions.cnvInt(txtTuika.Text) > 0)
|
|
628 | 628 |
{ |
629 |
if (int.Parse(lblRentCount.Text) < int.Parse(txtHaki.Text))
|
|
629 |
if (CommonMotions.cnvInt(lblRentCount.Text) < CommonMotions.cnvInt(txtHaki.Text))
|
|
630 | 630 |
{ |
631 | 631 |
MessageBox.Show("割当可能数を超えて破棄できません。", "データ確認" |
632 | 632 |
, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
... | ... | |
653 | 653 |
return; |
654 | 654 |
} |
655 | 655 |
|
656 |
if (txtHaki.Text.Length > 0 && int.Parse(txtHaki.Text) > 0)
|
|
656 |
if (txtHaki.Text.Length > 0 && CommonMotions.cnvInt(txtHaki.Text) > 0)
|
|
657 | 657 |
{ |
658 |
if (int.Parse(lblRentCount.Text) < int.Parse(txtHaki.Text))
|
|
658 |
if (CommonMotions.cnvInt(lblRentCount.Text) < CommonMotions.cnvInt(txtHaki.Text))
|
|
659 | 659 |
{ |
660 | 660 |
MessageBox.Show("割当可能数を超えて破棄できません。", "データ確認" |
661 | 661 |
, MessageBoxButtons.OK, MessageBoxIcon.Warning); |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/FrmEntryDeposit.cs | ||
---|---|---|
765 | 765 |
TargetDate = Dlist[i].targetDate.ToString(), |
766 | 766 |
SeqNo = (int)dgv1.Rows[i].Cells[(int)DispColumn.seqNo].Value, |
767 | 767 |
BusinessPeriod = CommonMotions.SystemMasterData.BusinessPeriod, |
768 |
DepositDate = DateTime.Parse(Dlist[i].depositDate),
|
|
768 |
DepositDate = CommonMotions.cnvDate(Dlist[i].depositDate),
|
|
769 | 769 |
DepositAmount = Dlist[i].depositAmountCash + Dlist[i].depositAmountBill, |
770 | 770 |
DepositAmountCash = Dlist[i].depositAmountCash, |
771 | 771 |
DepositAmountBill = Dlist[i].depositAmountBill, |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/FrmRegField.cs | ||
---|---|---|
132 | 132 |
{ |
133 | 133 |
foreach (DataGridViewRow r in m_HtGridRowConstructionCode.Values) |
134 | 134 |
{ |
135 |
if (int.Parse(r.Cells[(int)ColumnIndex.ConstructionCode].Value.ToString()) == nConstructionCode)
|
|
135 |
if (CommonMotions.cnvInt(r.Cells[(int)ColumnIndex.ConstructionCode].Value) == nConstructionCode)
|
|
136 | 136 |
{ |
137 | 137 |
return true; |
138 | 138 |
} |
... | ... | |
153 | 153 |
|
154 | 154 |
foreach (DataGridViewRow r in m_HtGridRowConstructionCode.Values) |
155 | 155 |
{ |
156 |
int wrk = int.Parse(r.Cells[(int)ColumnIndex.LineCount].Value.ToString());
|
|
156 |
int wrk = CommonMotions.cnvInt(r.Cells[(int)ColumnIndex.LineCount].Value);
|
|
157 | 157 |
|
158 | 158 |
if( wrk == -1 ){ |
159 | 159 |
continue; |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestEntry/FrmEntryReqSelOrderer.cs | ||
---|---|---|
201 | 201 |
if (cbReqMonth.Items.Count > 0) |
202 | 202 |
{ |
203 | 203 |
cbReqMonth.SelectedValue = int.Parse(DateTime.Now.ToString("yyyyMM")); |
204 |
nReqMonth = int.Parse(cbReqMonth.SelectedValue.ToString());
|
|
204 |
nReqMonth = CommonMotions.cnvInt(cbReqMonth.SelectedValue);
|
|
205 | 205 |
|
206 | 206 |
// 請求データの取得 |
207 | 207 |
GetRequestData( nReqMonth ); |
... | ... | |
230 | 230 |
{ |
231 | 231 |
if (r.Cells[4].Value != null) |
232 | 232 |
{ |
233 |
nOrderersDivision = int.Parse(r.Cells[4].Value.ToString());
|
|
234 |
nOrderersCode = int.Parse(r.Cells[5].Value.ToString());
|
|
235 |
strOrderersName = r.Cells[6].Value.ToString();
|
|
233 |
nOrderersDivision = CommonMotions.cnvInt(r.Cells[4].Value);
|
|
234 |
nOrderersCode = CommonMotions.cnvInt(r.Cells[5].Value);
|
|
235 |
strOrderersName = CommonMotions.cnvString(r.Cells[6].Value);
|
|
236 | 236 |
|
237 | 237 |
break; |
238 | 238 |
} |
... | ... | |
247 | 247 |
FrmEntryReqSelRequest frmEntry = new FrmEntryReqSelRequest(); |
248 | 248 |
|
249 | 249 |
frmEntry.EditFlg = true; |
250 |
frmEntry.RequestMonth = int.Parse(cbReqMonth.SelectedValue.ToString());
|
|
250 |
frmEntry.RequestMonth = CommonMotions.cnvInt(cbReqMonth.SelectedValue);
|
|
251 | 251 |
frmEntry.OrderersDivision = nOrderersDivision; |
252 | 252 |
frmEntry.OrderersCode = nOrderersCode; |
253 | 253 |
frmEntry.OrderersName = strOrderersName; |
... | ... | |
298 | 298 |
private void cbReqMonth_SelectedIndexChanged(object sender, EventArgs e) |
299 | 299 |
{ |
300 | 300 |
// 請求月コンボから請求月を取得 |
301 |
int nReqMonth = int.Parse(cbReqMonth.SelectedValue.ToString());
|
|
301 |
int nReqMonth = CommonMotions.cnvInt(cbReqMonth.SelectedValue);
|
|
302 | 302 |
|
303 | 303 |
// 請求データの取得 |
304 | 304 |
GetRequestData(nReqMonth); |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestEntry/FrmEntryReqSelRequest.cs | ||
---|---|---|
156 | 156 |
#region [全選択]ボタン押下 |
157 | 157 |
private void btnAllSelect_Click(object sender, EventArgs e) |
158 | 158 |
{ |
159 |
int nInvoiceNo = int.Parse(cbCreateDate.SelectedValue.ToString());
|
|
159 |
int nInvoiceNo = CommonMotions.cnvInt(cbCreateDate.SelectedValue);
|
|
160 | 160 |
|
161 | 161 |
dgv1.CellContentClick -= dgv1_CellContentClick; |
162 | 162 |
dgv1.CellContentDoubleClick -= dgv1_CellContentDoubleClick; |
... | ... | |
175 | 175 |
dgv1[0, i].Value = true; |
176 | 176 |
} |
177 | 177 |
// 請求書が紐づいていても選択されている請求書のものはON |
178 |
else if (int.Parse(dgv1[5, i].Value.ToString()) == nInvoiceNo)
|
|
178 |
else if (CommonMotions.cnvInt(dgv1[5, i].Value) == nInvoiceNo)
|
|
179 | 179 |
{ |
180 | 180 |
dgv1[0, i].Value = true; |
181 | 181 |
} |
... | ... | |
193 | 193 |
#region [全選択解除]ボタン押下 |
194 | 194 |
private void btnAllUnselect_Click(object sender, EventArgs e) |
195 | 195 |
{ |
196 |
int nInvoiceNo = int.Parse(cbCreateDate.SelectedValue.ToString());
|
|
196 |
int nInvoiceNo = CommonMotions.cnvInt(cbCreateDate.SelectedValue);
|
|
197 | 197 |
|
198 | 198 |
for (int i = 1; i < dgv1.Rows.Count; i++) |
199 | 199 |
{ |
... | ... | |
209 | 209 |
dgv1[0, i].Value = false; |
210 | 210 |
} |
211 | 211 |
// 請求書が紐づいていても選択されていない請求書のものはOFF |
212 |
else if (int.Parse(dgv1[5, i].Value.ToString()) != nInvoiceNo)
|
|
212 |
else if (CommonMotions.cnvInt(dgv1[5, i].Value) != nInvoiceNo)
|
|
213 | 213 |
{ |
214 | 214 |
dgv1[0, i].Value = false; |
215 | 215 |
} |
... | ... | |
227 | 227 |
return; |
228 | 228 |
} |
229 | 229 |
|
230 |
int nInvoiceNo = int.Parse(cbCreateDate.SelectedValue.ToString());
|
|
230 |
int nInvoiceNo = CommonMotions.cnvInt(cbCreateDate.SelectedValue);
|
|
231 | 231 |
|
232 | 232 |
// 請求書データの削除 |
233 | 233 |
if (DeleteInvoiceData(nInvoiceNo) == false) |
... | ... | |
252 | 252 |
} |
253 | 253 |
|
254 | 254 |
// 削除対象の設計書データが紐づいている場合 |
255 |
if ((dgv1[5, i].Value != null) && (int.Parse(dgv1[5, i].Value.ToString()) == nInvoiceNo))
|
|
255 |
if ((dgv1[5, i].Value != null) && (CommonMotions.cnvInt(dgv1[5, i].Value) == nInvoiceNo))
|
|
256 | 256 |
{ |
257 | 257 |
dgv1[5, i].Value = null; |
258 | 258 |
dgv1[3, i].Value = null; |
... | ... | |
331 | 331 |
#region 作成日コンボの選択変更 |
332 | 332 |
private void cbCreateDate_SelectedIndexChanged(object sender, EventArgs e) |
333 | 333 |
{ |
334 |
int nInvoiceNo = int.Parse(cbCreateDate.SelectedValue.ToString());
|
|
334 |
int nInvoiceNo = CommonMotions.cnvInt(cbCreateDate.SelectedValue);
|
|
335 | 335 |
|
336 | 336 |
if (m_nOldSelectedValue == nInvoiceNo) |
337 | 337 |
{ |
... | ... | |
383 | 383 |
else |
384 | 384 |
{ |
385 | 385 |
// 請求書が選択された場合は該当設計書のみON |
386 |
if ((dgv1[5, i].Value != null) && (int.Parse(dgv1[5, i].Value.ToString()) == nInvoiceNo))
|
|
386 |
if ((dgv1[5, i].Value != null) && (CommonMotions.cnvInt(dgv1[5, i].Value) == nInvoiceNo))
|
|
387 | 387 |
{ |
388 | 388 |
dgv1[0, i].Value = true; |
389 | 389 |
dgv1[0, i].ReadOnly = true; |
... | ... | |
441 | 441 |
|
442 | 442 |
if (dgv1[2, i].Value != null) |
443 | 443 |
{ |
444 |
val = long.Parse(dgv1[2, i].Value.ToString().Replace(",", string.Empty));
|
|
444 |
val = CommonMotions.cnvLong(dgv1[2, i].Value.ToString().Replace(",", string.Empty));
|
|
445 | 445 |
} |
446 | 446 |
else |
447 | 447 |
{ |
... | ... | |
703 | 703 |
#region 作成チェック |
704 | 704 |
private int CheckGenerate(ref string msg) |
705 | 705 |
{ |
706 |
int nInvoiceNo = int.Parse(cbCreateDate.SelectedValue.ToString());
|
|
706 |
int nInvoiceNo = CommonMotions.cnvInt(cbCreateDate.SelectedValue);
|
|
707 | 707 |
|
708 |
int nSelect = int.Parse(lbSelect.Text.ToString());
|
|
708 |
int nSelect = CommonMotions.cnvInt(lbSelect.Text);
|
|
709 | 709 |
int nRet = (int)CheckState.Ok; |
710 | 710 |
|
711 | 711 |
// 選択なし |
... | ... | |
733 | 733 |
continue; |
734 | 734 |
} |
735 | 735 |
|
736 |
if (int.Parse(dgv1[5, i].Value.ToString()) != nInvoiceNo)
|
|
736 |
if (CommonMotions.cnvInt(dgv1[5, i].Value) != nInvoiceNo)
|
|
737 | 737 |
{ |
738 | 738 |
nRet = (int)CheckState.Warning; |
739 | 739 |
break; |
... | ... | |
788 | 788 |
|
789 | 789 |
private int EntryData() |
790 | 790 |
{ |
791 |
int nInvoiceNo = int.Parse(cbCreateDate.SelectedValue.ToString());
|
|
791 |
int nInvoiceNo = CommonMotions.cnvInt(cbCreateDate.SelectedValue);
|
|
792 | 792 |
|
793 | 793 |
List<RequestHead> lstReqHead = new List<RequestHead>(); |
794 | 794 |
|
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInput/FrmRequestInput.cs | ||
---|---|---|
657 | 657 |
if (dgv1[(int)ColumnName.ConstructionType, trow].Value != null) |
658 | 658 |
{ |
659 | 659 |
// 該当行が本工事の場合は編集可能領域 |
660 |
if (int.Parse(dgv1[(int)ColumnName.DgvKind, trow].Value.ToString()) == (int)dgvKind.BodyMainConstruction)
|
|
660 |
if (CommonMotions.cnvInt(dgv1[(int)ColumnName.DgvKind, trow].Value) == (int)dgvKind.BodyMainConstruction)
|
|
661 | 661 |
{ |
662 | 662 |
m_bDirty = true; |
663 | 663 |
} |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/Request/RequestInput/FrmRequestInputAuxiliary.cs | ||
---|---|---|
137 | 137 |
/// <summary> |
138 | 138 |
/// 請求工事の工事基本情報明細リスト |
139 | 139 |
/// </summary> |
140 |
// private List<ConstructionBaseInfoDetail> m_BaseConstructionBaseInfoDetail = new List<ConstructionBaseInfoDetail>(); |
|
140 |
// private List<ConstructionBaseInfoDetail> m_BaseConstructionBaseInfoDetail = new List<ConstructionBaseInfoDetail>();
|
|
141 | 141 |
|
142 | 142 |
//private Dictionary<int, ConstructionBaseInfoDetail> m_ConstructionBaseInfoDetail = new Dictionary<int, ConstructionBaseInfoDetail>(); |
143 | 143 |
|
... | ... | |
162 | 162 |
private List<DepositDataDetail> m_lstDepDataDetail = new List<DepositDataDetail>(); |
163 | 163 |
private List<DateTime> m_lstDepositDate = new List<DateTime>(); |
164 | 164 |
private List<int> m_lstDepositState = new List<int>(); |
165 |
|
|
165 |
|
|
166 | 166 |
/// <summary> |
167 | 167 |
/// 請求工事の工事基本情報 |
168 | 168 |
/// </summary> |
... | ... | |
240 | 240 |
|
241 | 241 |
|
242 | 242 |
for (int i = (int)ColumnName.Request02; i < (int)ColumnName.Balance; i++) |
243 |
|
|
244 | 243 |
{ |
245 | 244 |
dgv1.Columns[i].Visible = false; |
246 | 245 |
} |
... | ... | |
400 | 399 |
lUnpaid = CommonMotions.cnvLong(dgv1[tcol, (int)HeaderRowIndex.UnpaidAmount].Value); |
401 | 400 |
} |
402 | 401 |
|
403 |
for (i = (int)HeaderRowIndex.UnpaidAmount+1; i <= m_nMaxRowNo; i += 2)
|
|
402 |
for (i = (int)HeaderRowIndex.UnpaidAmount + 1; i <= m_nMaxRowNo; i += 2)
|
|
404 | 403 |
{ |
405 | 404 |
if (dgv1[(int)ColumnName.ConstructionCode, i].Value == null) |
406 | 405 |
{ |
... | ... | |
600 | 599 |
{ |
601 | 600 |
try |
602 | 601 |
{ |
603 |
long n = long.Parse(str);
|
|
602 |
long n = CommonMotions.cnvLong(str);
|
|
604 | 603 |
|
605 | 604 |
if (n >= 0) |
606 | 605 |
{ |
... | ... | |
673 | 672 |
|
674 | 673 |
msg = "起動に失敗しました。"; |
675 | 674 |
|
676 |
try{ |
|
675 |
try |
|
676 |
{ |
|
677 | 677 |
// 工事基本情報の取得 |
678 | 678 |
ConstructionBaseInfo Info = new ConstructionBaseInfo(); |
679 | 679 |
sql = ioInfo.CreatePrimarykeyString(m_ConstructionCode); |
... | ... | |
713 | 713 |
} |
714 | 714 |
} |
715 | 715 |
// 結合子工事の場合 |
716 |
else if( Info.JoinFlg == (int)ConstructionBaseInfo.JoinFlgDef.JoinChildren)
|
|
716 |
else if (Info.JoinFlg == (int)ConstructionBaseInfo.JoinFlgDef.JoinChildren)
|
|
717 | 717 |
{ |
718 | 718 |
/////////////////////////////////////////// |
719 | 719 |
// 親工事で請求済か確認 |
... | ... | |
811 | 811 |
return (int)CheckResult.ErrorStatus; |
812 | 812 |
} |
813 | 813 |
|
814 |
nBalance = CommonMotions.cnvInt(dgv1[(int)ColumnName.Balance, 2].Value);
|
|
814 |
nBalance = CommonMotions.cnvInt(dgv1[(int)ColumnName.Balance, 2].Value); |
|
815 | 815 |
// 請求残が存在する場合 |
816 |
if( nBalance > 0 )
|
|
816 |
if (nBalance > 0)
|
|
817 | 817 |
{ |
818 | 818 |
return (int)CheckResult.WarningUnmatch; |
819 | 819 |
} |
... | ... | |
821 | 821 |
|
822 | 822 |
nBalance = CommonMotions.cnvInt(dgv1[(int)ColumnName.Balance, 2].Value); |
823 | 823 |
// 請求残がマイナスの場合 |
824 |
if( nBalance < 0 )
|
|
824 |
if (nBalance < 0)
|
|
825 | 825 |
{ |
826 | 826 |
return (int)CheckResult.WarningOver; |
827 | 827 |
} |
... | ... | |
846 | 846 |
/// <summary> |
847 | 847 |
/// エラー表示セット |
848 | 848 |
/// </summary> |
849 |
private void SetErrorIndicate( List<int>lstErrorConstructionCode)
|
|
849 |
private void SetErrorIndicate(List<int> lstErrorConstructionCode)
|
|
850 | 850 |
{ |
851 |
foreach( int nMainConstrucitionCode in lstErrorConstructionCode)
|
|
851 |
foreach (int nMainConstrucitionCode in lstErrorConstructionCode)
|
|
852 | 852 |
{ |
853 | 853 |
for (int i = 6; i <= m_nMaxRowNo; i += 2) |
854 | 854 |
{ |
855 |
int nConstructionCode = int.Parse(dgv1[(int)ColumnName.ConstructionCode, i].Value.ToString());
|
|
855 |
int nConstructionCode = CommonMotions.cnvInt(dgv1[(int)ColumnName.ConstructionCode, i].Value);
|
|
856 | 856 |
if (nConstructionCode == nMainConstrucitionCode) |
857 | 857 |
{ |
858 | 858 |
dgv1[(int)ColumnName.ConstructionName, i].Style.BackColor = Color.Red; |
... | ... | |
862 | 862 |
} |
863 | 863 |
} |
864 | 864 |
|
865 |
return ;
|
|
865 |
return; |
|
866 | 866 |
} |
867 | 867 |
#endregion |
868 | 868 |
|
... | ... | |
876 | 876 |
|
877 | 877 |
for (int i = 6; i <= m_nMaxRowNo; i += 2) |
878 | 878 |
{ |
879 |
if ( nColor == 0)
|
|
879 |
if (nColor == 0) |
|
880 | 880 |
{ |
881 | 881 |
dgv1[(int)ColumnName.ConstructionName, i].Style.BackColor = Color.White; |
882 | 882 |
|
... | ... | |
915 | 915 |
} |
916 | 916 |
else |
917 | 917 |
{ |
918 |
RequestHead ReqHead = m_lstRequestHead[m_nMaxOrderNo-1];
|
|
918 |
RequestHead ReqHead = m_lstRequestHead[m_nMaxOrderNo - 1];
|
|
919 | 919 |
|
920 | 920 |
// 請求年月と請求金額合計を退避(詳細台帳反映用) |
921 | 921 |
m_nOldRequestMonth = ReqHead.RequestMonth; |
... | ... | |
946 | 946 |
GetApprovalMaster(m_BaseConstructionBaseInfo.ConstructionPersonCode, ref m_dicApprovalMaster); |
947 | 947 |
|
948 | 948 |
// 承認データの取得 |
949 |
GetProcessApproval( m_ConstructionCode, ref m_dicProcessApproval );
|
|
949 |
GetProcessApproval(m_ConstructionCode, ref m_dicProcessApproval);
|
|
950 | 950 |
|
951 | 951 |
} |
952 | 952 |
#endregion |
... | ... | |
1010 | 1010 |
|
1011 | 1011 |
// 請求ヘッダを取得 |
1012 | 1012 |
strSQL = ioReqHead.CreateSubkeyString(m_ConstructionCode); |
1013 |
strSQL += " Order by OrderNo Asc " ;
|
|
1013 |
strSQL += " Order by OrderNo Asc "; |
|
1014 | 1014 |
if (ioReqHead.SelectAction(strSQL, ref m_lstRequestHead) == false) |
1015 | 1015 |
{ |
1016 | 1016 |
return; |
... | ... | |
1023 | 1023 |
} |
1024 | 1024 |
|
1025 | 1025 |
// 最新の請求Noおよび受付番号を確保 |
1026 |
m_nRequestNo = m_lstRequestHead[m_lstRequestHead.Count-1].RequestNo;
|
|
1027 |
m_nMaxOrderNo = m_lstRequestHead[m_lstRequestHead.Count-1].OrderNo;
|
|
1026 |
m_nRequestNo = m_lstRequestHead[m_lstRequestHead.Count - 1].RequestNo;
|
|
1027 |
m_nMaxOrderNo = m_lstRequestHead[m_lstRequestHead.Count - 1].OrderNo;
|
|
1028 | 1028 |
|
1029 | 1029 |
// 請求ヘッダレコード分ループ |
1030 | 1030 |
foreach (RequestHead ReqHead in m_lstRequestHead) |
... | ... | |
1046 | 1046 |
return; |
1047 | 1047 |
} |
1048 | 1048 |
|
1049 |
if( lstData.Count == 0){ |
|
1049 |
if (lstData.Count == 0) |
|
1050 |
{ |
|
1050 | 1051 |
return; |
1051 | 1052 |
} |
1052 | 1053 |
|
... | ... | |
1054 | 1055 |
Dictionary<int, RequestData> dicData = new Dictionary<int, RequestData>(); |
1055 | 1056 |
|
1056 | 1057 |
// 請求データ明細リスト辞書(キー:本工事番号)の構築 |
1057 |
Dictionary<int, List<RequestDataDetail>> dicDetail = new Dictionary<int, List<RequestDataDetail>>();
|
|
1058 |
Dictionary<int, List<RequestDataDetail>> dicDetail = new Dictionary<int, List<RequestDataDetail>>(); |
|
1058 | 1059 |
|
1059 |
foreach( RequestData ReqData in lstData)
|
|
1060 |
foreach (RequestData ReqData in lstData)
|
|
1060 | 1061 |
{ |
1061 | 1062 |
dicData.Add(ReqData.MainConstructionCode, ReqData); |
1062 |
|
|
1063 |
|
|
1063 | 1064 |
List<RequestDataDetail> lstDetail = new List<RequestDataDetail>(); |
1064 | 1065 |
|
1065 | 1066 |
// 請求データ明細の取得 |
... | ... | |
1070 | 1071 |
return; |
1071 | 1072 |
} |
1072 | 1073 |
|
1073 |
if( lstDetail.Count == 0){ |
|
1074 |
if (lstDetail.Count == 0) |
|
1075 |
{ |
|
1074 | 1076 |
return; |
1075 | 1077 |
} |
1076 | 1078 |
|
1077 |
dicDetail.Add(ReqData.MainConstructionCode, lstDetail);
|
|
1078 |
|
|
1079 |
dicDetail.Add(ReqData.MainConstructionCode, lstDetail); |
|
1080 |
|
|
1079 | 1081 |
} |
1080 | 1082 |
|
1081 | 1083 |
m_lstRequestData.Add(dicData); |
... | ... | |
1140 | 1142 |
{ |
1141 | 1143 |
return; |
1142 | 1144 |
} |
1143 |
|
|
1144 |
Dictionary<int,RequestData> dicDataWork = new Dictionary<int,RequestData>();
|
|
1145 |
|
|
1146 |
Dictionary<int, RequestData> dicDataWork = new Dictionary<int, RequestData>();
|
|
1145 | 1147 |
foreach (RequestData ReqData in lstDataWork) |
1146 | 1148 |
{ |
1147 | 1149 |
dicDataWork.Add(ReqData.MainConstructionCode, ReqData); |
... | ... | |
1220 | 1222 |
ReqDetailMain.ConstructionKind = 0; |
1221 | 1223 |
} |
1222 | 1224 |
lstDetail.Add(ReqDetailMain); |
1223 |
|
|
1225 |
|
|
1224 | 1226 |
foreach (int nConstructionCode in lstConstructionCode) |
1225 | 1227 |
{ |
1226 | 1228 |
RequestDataDetail ReqDetailSub = null; |
... | ... | |
1241 | 1243 |
dicString = new Dictionary<int, string>(); |
1242 | 1244 |
GetConstructionBaseInfoDetail(nConstructionCode, ref dicString); |
1243 | 1245 |
|
1244 |
if( dicString.TryGetValue((int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName, out str) == true ){ |
|
1246 |
if (dicString.TryGetValue((int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName, out str) == true) |
|
1247 |
{ |
|
1245 | 1248 |
AddConstructionString(nConstructionCode, str); |
1246 | 1249 |
} |
1247 | 1250 |
|
1248 |
lstDetail.Add(ReqDetailSub);
|
|
1251 |
lstDetail.Add(ReqDetailSub); |
|
1249 | 1252 |
} |
1250 | 1253 |
|
1251 |
dicDetail.Add( nMainConstructonCode, lstDetail);
|
|
1254 |
dicDetail.Add(nMainConstructonCode, lstDetail); |
|
1252 | 1255 |
|
1253 | 1256 |
} |
1254 | 1257 |
|
... | ... | |
1282 | 1285 |
{ |
1283 | 1286 |
RequestHead ReqHead = m_lstRequestHead[i]; |
1284 | 1287 |
|
1285 |
List<DepositDataDetail> lstDepDetail = new List<DepositDataDetail>() ;
|
|
1288 |
List<DepositDataDetail> lstDepDetail = new List<DepositDataDetail>(); |
|
1286 | 1289 |
|
1287 |
GetDepositDataDetail( ReqHead.RequestNo, ref lstDepDetail);
|
|
1290 |
GetDepositDataDetail(ReqHead.RequestNo, ref lstDepDetail); |
|
1288 | 1291 |
|
1289 | 1292 |
DepositDataDetail DepDetail = null; |
1290 | 1293 |
int nDepositState = (int)DepositState.None; |
... | ... | |
1299 | 1302 |
} |
1300 | 1303 |
|
1301 | 1304 |
DepositData DepData = new DepositData(); |
1302 |
GetDepositData(DepDetail.OrderersDivision, DepDetail.OrderersCode, DepDetail.TargetDate,DepDetail.RequestNo, ref DepData); |
|
1305 |
GetDepositData(DepDetail.OrderersDivision, DepDetail.OrderersCode, DepDetail.TargetDate, DepDetail.RequestNo, ref DepData);
|
|
1303 | 1306 |
dtDeposit = DepData.DepositDate; |
1304 | 1307 |
|
1305 | 1308 |
} |
... | ... | |
1330 | 1333 |
|
1331 | 1334 |
// 請求データの生成 |
1332 | 1335 |
CreateRequestData(); |
1333 |
|
|
1336 |
|
|
1334 | 1337 |
// 請求データ明細の生成 |
1335 | 1338 |
CreateRequestDataDetail(); |
1336 | 1339 |
} |
... | ... | |
1602 | 1605 |
lAmount = CommonMotions.cnvLong(dgv1[tcol, trow].Value); |
1603 | 1606 |
lPriceTotal += lAmount; |
1604 | 1607 |
|
1605 |
lAmount = CommonMotions.cnvLong(dgv1[tcol, trow+1].Value);
|
|
1608 |
lAmount = CommonMotions.cnvLong(dgv1[tcol, trow + 1].Value);
|
|
1606 | 1609 |
lTaxTotal += lAmount; |
1607 | 1610 |
|
1608 | 1611 |
trow += 2; |
... | ... | |
1613 | 1616 |
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
1614 | 1617 |
|
1615 | 1618 |
// 請求合計の設定 |
1616 |
// setAmount(tcol, (int)HeaderRowIndex.RequestTotalAmount, lPriceTotal + lTaxTotal); |
|
1619 |
// setAmount(tcol, (int)HeaderRowIndex.RequestTotalAmount, lPriceTotal + lTaxTotal);
|
|
1617 | 1620 |
// 請求金額の設定 |
1618 | 1621 |
setAmount(tcol, (int)HeaderRowIndex.RequestAmount, lPriceTotal); |
1619 | 1622 |
// 消費税の設定 |
... | ... | |
1640 | 1643 |
// 最終承認済ではない場合は未入金行は編集可 |
1641 | 1644 |
if (m_lstOrderState[i] != (int)ApprovalState.End) |
1642 | 1645 |
{ |
1643 |
dgv1[tcol, trow].ReadOnly = (m_bEdit == true ? (false):(true));
|
|
1646 |
dgv1[tcol, trow].ReadOnly = (m_bEdit == true ? (false) : (true));
|
|
1644 | 1647 |
} |
1645 | 1648 |
|
1646 | 1649 |
trow = (int)HeaderRowIndex.UnpaidAmount + 1; |
... | ... | |
1669 | 1672 |
|
1670 | 1673 |
setAmount(tcol, (int)HeaderRowIndex.RequestTotalAmount, lPriceTotal + lTaxTotal + ReqHead.UnpaidAmount); |
1671 | 1674 |
setAmount(tcol, (int)HeaderRowIndex.RequestAmount, lPriceTotal); |
1672 |
setAmount(tcol, (int)HeaderRowIndex.TaxAmount, lTaxTotal);
|
|
1675 |
setAmount(tcol, (int)HeaderRowIndex.TaxAmount, lTaxTotal); |
|
1673 | 1676 |
} |
1674 | 1677 |
} |
1675 | 1678 |
#endregion |
... | ... | |
1687 | 1690 |
Dictionary<int, List<RequestDataDetail>> dicDetail = m_lstRequestDataDetail[m_nMaxOrderNo - 1]; |
1688 | 1691 |
|
1689 | 1692 |
List<int> lstKey = new List<int>(dicDetail.Keys); |
1690 |
|
|
1691 |
foreach( int nConstructionCode in lstKey )
|
|
1693 |
|
|
1694 |
foreach (int nConstructionCode in lstKey)
|
|
1692 | 1695 |
{ |
1693 | 1696 |
List<RequestDataDetail> lst = null; |
1694 | 1697 |
if (dicDetail.TryGetValue(nConstructionCode, out lst) == false) |
... | ... | |
1745 | 1748 |
if (trow > 13) |
1746 | 1749 |
{ |
1747 | 1750 |
dgv1.Rows[trow].Visible = true; |
1748 |
dgv1.Rows[trow+1].Visible = true;
|
|
1751 |
dgv1.Rows[trow + 1].Visible = true;
|
|
1749 | 1752 |
} |
1750 | 1753 |
|
1751 | 1754 |
// 税抜受注決定金額 |
... | ... | |
1895 | 1898 |
else |
1896 | 1899 |
{ |
1897 | 1900 |
// 請求月と承認状態の設定 |
1898 |
SetRequestMonthAndApprovalState(i+1, 0, nState);
|
|
1901 |
SetRequestMonthAndApprovalState(i + 1, 0, nState);
|
|
1899 | 1902 |
} |
1900 | 1903 |
|
1901 | 1904 |
m_lstOrderState.Add(nState); |
1902 | 1905 |
|
1903 |
while(true){ |
|
1906 |
while (true) |
|
1907 |
{ |
|
1904 | 1908 |
if (dgv1[(int)ColumnName.ConstructionCode, trow].Value == null) |
1905 | 1909 |
{ |
1906 | 1910 |
break; |
... | ... | |
1908 | 1912 |
|
1909 | 1913 |
string str = dgv1[(int)ColumnName.ConstructionCode, trow].Value.ToString(); |
1910 | 1914 |
|
1911 |
int key = int.Parse(str);
|
|
1915 |
int key = CommonMotions.cnvInt(str);
|
|
1912 | 1916 |
|
1913 | 1917 |
List<RequestDataDetail> lst = null; |
1914 | 1918 |
|
... | ... | |
1990 | 1994 |
yyyymm = 0; |
1991 | 1995 |
now_yyyymm = 0; |
1992 | 1996 |
|
1993 |
for (int i = m_nMaxOrderNo-1; i>=0; i--)
|
|
1997 |
for (int i = m_nMaxOrderNo - 1; i >= 0; i--)
|
|
1994 | 1998 |
{ |
1995 | 1999 |
// 請求ヘッダの取得 |
1996 | 2000 |
ReqHead = m_lstRequestHead[i]; |
... | ... | |
1999 | 2003 |
nState = m_lstOrderState[i]; |
2000 | 2004 |
|
2001 | 2005 |
// 最終承認済以外は対象外 |
2002 |
if(nState != (int)ApprovalState.End){ |
|
2006 |
if (nState != (int)ApprovalState.End) |
|
2007 |
{ |
|
2003 | 2008 |
continue; |
2004 | 2009 |
} |
2005 | 2010 |
|
... | ... | |
2018 | 2023 |
{ |
2019 | 2024 |
DateTime wk = dt.AddMonths(i); |
2020 | 2025 |
|
2021 |
key = int.Parse(wk.ToString("yyyyMM"));
|
|
2026 |
key = CommonMotions.cnvInt(wk.ToString("yyyyMM"));
|
|
2022 | 2027 |
|
2023 |
if(i==0)
|
|
2028 |
if (i == 0)
|
|
2024 | 2029 |
{ |
2025 | 2030 |
now_yyyymm = key; |
2026 | 2031 |
} |
... | ... | |
2043 | 2048 |
ComboBoxAction.InitDataSetCombBox(cbReqMonth, lst, false); |
2044 | 2049 |
|
2045 | 2050 |
// 最新の請求ヘッダ、受付状態の取得 |
2046 |
ReqHead = m_lstRequestHead[m_nMaxOrderNo-1];
|
|
2047 |
nState = m_lstOrderState[m_nMaxOrderNo-1];
|
|
2051 |
ReqHead = m_lstRequestHead[m_nMaxOrderNo - 1];
|
|
2052 |
nState = m_lstOrderState[m_nMaxOrderNo - 1];
|
|
2048 | 2053 |
|
2049 | 2054 |
if (ReqHead.RequestNo != 0) |
2050 | 2055 |
{ |
... | ... | |
2086 | 2091 |
|
2087 | 2092 |
if (pap.SeqNo == 1) |
2088 | 2093 |
{ |
2089 |
if( nState < (int)ApprovalState.Apply){ |
|
2090 |
nState = (int)ApprovalState.Apply; |
|
2094 |
if (nState < (int)ApprovalState.Apply) |
|
2095 |
{ |
|
2096 |
nState = (int)ApprovalState.Apply; |
|
2091 | 2097 |
} |
2092 | 2098 |
continue; |
2093 | 2099 |
} |
... | ... | |
2173 | 2179 |
|
2174 | 2180 |
return true; |
2175 | 2181 |
} |
2176 |
|
|
2182 |
|
|
2177 | 2183 |
// 未入金が残っている場合 |
2178 | 2184 |
if (m_lUnpaidAmount > 0) |
2179 | 2185 |
{ |
... | ... | |
2211 | 2217 |
int ret = (int)EditType.NotEdit; |
2212 | 2218 |
|
2213 | 2219 |
// 列チェック(工事名と対象回目以外、コメント以外の列は編集対象外 |
2214 |
if ((tcol != (int)ColumnName.ConstructionName) && (tcol != m_nMaxOrderNo + (int)ColumnName.Sum) && (tcol != (int)ColumnName.Comment))
|
|
2220 |
if ((tcol != (int)ColumnName.ConstructionName) && (tcol != m_nMaxOrderNo + (int)ColumnName.Sum) && (tcol != (int)ColumnName.Comment)) |
|
2215 | 2221 |
{ |
2216 | 2222 |
return ret; |
2217 | 2223 |
} |
... | ... | |
2251 | 2257 |
} |
2252 | 2258 |
|
2253 | 2259 |
// dgv区分がボディ(本工事)の場合 |
2254 |
if (int.Parse(dgv1[(int)ColumnName.DgvKind, trow].Value.ToString()) == (int)dgvKind.BodyMainConstruction)
|
|
2260 |
if (CommonMotions.cnvInt(dgv1[(int)ColumnName.DgvKind, trow].Value) == (int)dgvKind.BodyMainConstruction)
|
|
2255 | 2261 |
{ |
2256 | 2262 |
return type; |
2257 | 2263 |
} |
... | ... | |
2341 | 2347 |
break; |
2342 | 2348 |
} |
2343 | 2349 |
|
2344 |
if (int.Parse(dgv1[(int)ColumnName.DgvKind, trow].Value.ToString()) == (int)dgvKind.BodyMainConstruction)
|
|
2350 |
if (CommonMotions.cnvInt(dgv1[(int)ColumnName.DgvKind, trow].Value) == (int)dgvKind.BodyMainConstruction)
|
|
2345 | 2351 |
{ |
2346 | 2352 |
// コメントを初期化 |
2347 | 2353 |
dgv1[comcol, trow].Value = ""; |
... | ... | |
2510 | 2516 |
/// </summary> |
2511 | 2517 |
private void SetDispData() |
2512 | 2518 |
{ |
2513 |
// 請求ヘッダ反映 |
|
2514 |
SetRequestHead(); |
|
2519 |
try |
|
2520 |
{ |
|
2521 |
// 請求ヘッダ反映 |
|
2522 |
SetRequestHead(); |
|
2515 | 2523 |
|
2516 |
// 請求データ、請求データ明細の反映 |
|
2517 |
SetRequestData(); |
|
2524 |
// 請求データ、請求データ明細の反映 |
|
2525 |
SetRequestData(); |
|
2526 |
} |
|
2527 |
catch (Exception ex) |
|
2528 |
{ |
|
2529 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
2530 |
} |
|
2518 | 2531 |
|
2519 | 2532 |
return; |
2520 | 2533 |
} |
... | ... | |
2526 | 2539 |
/// </summary> |
2527 | 2540 |
private void SetRequestHead() |
2528 | 2541 |
{ |
2529 |
int tcol = m_nMaxOrderNo + (int)ColumnName.Sum; |
|
2542 |
try |
|
2543 |
{ |
|
2544 |
int tcol = m_nMaxOrderNo + (int)ColumnName.Sum; |
|
2530 | 2545 |
|
2531 |
// 請求ヘッダ取得 |
|
2532 |
RequestHead ReqHead = m_lstRequestHead[m_nMaxOrderNo - 1]; |
|
2546 |
// 請求ヘッダ取得
|
|
2547 |
RequestHead ReqHead = m_lstRequestHead[m_nMaxOrderNo - 1];
|
|
2533 | 2548 |
|
2534 |
ReqHead.ReqConstructionCode = m_ConstructionCode; // 請求工事番号 |
|
2535 |
ReqHead.OrderNo = m_nMaxOrderNo; // 受付番号 |
|
2536 |
ReqHead.OrderersName = txtOrderer.Text.Trim(); // 請求先名 |
|
2537 |
ReqHead.RequestMonth = int.Parse(cbReqMonth.SelectedValue.ToString()); // 請求月
|
|
2538 |
ReqHead.ReqConstructionName = dgv1[(int)ColumnName.ConstructionName, 0].Value.ToString(); // 請求件名 |
|
2549 |
ReqHead.ReqConstructionCode = m_ConstructionCode; // 請求工事番号
|
|
2550 |
ReqHead.OrderNo = m_nMaxOrderNo; // 受付番号
|
|
2551 |
ReqHead.OrderersName = txtOrderer.Text.Trim(); // 請求先名
|
|
2552 |
ReqHead.RequestMonth = CommonMotions.cnvInt(cbReqMonth.SelectedValue); // 請求月
|
|
2553 |
ReqHead.ReqConstructionName = dgv1[(int)ColumnName.ConstructionName, 0].Value.ToString(); // 請求件名
|
|
2539 | 2554 |
|
2540 |
ReqHead.RequestTotalAmount = CommonMotions.cnvLong(dgv1[tcol, 2].Value); // 請求金額合計 |
|
2541 |
ReqHead.RequestAmount = CommonMotions.cnvLong(dgv1[tcol, 3].Value); // 請求金額 |
|
2542 |
ReqHead.TaxAmount = CommonMotions.cnvLong(dgv1[tcol, 4].Value); // 消費税 |
|
2543 |
ReqHead.UnpaidAmount = CommonMotions.cnvLong(dgv1[tcol, 5].Value); // 未入金 |
|
2555 |
ReqHead.RequestTotalAmount = CommonMotions.cnvLong(dgv1[tcol, 2].Value); // 請求金額合計 |
|
2556 |
ReqHead.RequestAmount = CommonMotions.cnvLong(dgv1[tcol, 3].Value); // 請求金額 |
|
2557 |
ReqHead.TaxAmount = CommonMotions.cnvLong(dgv1[tcol, 4].Value); // 消費税 |
|
2558 |
ReqHead.UnpaidAmount = CommonMotions.cnvLong(dgv1[tcol, 5].Value); // 未入金 |
|
2559 |
} |
|
2560 |
catch (Exception ex) |
|
2561 |
{ |
|
2562 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
2563 |
} |
|
2544 | 2564 |
|
2545 | 2565 |
return; |
2546 | 2566 |
} |
... | ... | |
2561 | 2581 |
int nIndex = 0; |
2562 | 2582 |
int nMainConstructionCode; |
2563 | 2583 |
|
2564 |
RequestData ReqData = null ;
|
|
2584 |
RequestData ReqData = null; |
|
2565 | 2585 |
List<RequestDataDetail> lstDetail = null; |
2566 |
|
|
2567 |
long[] lAmounts = new long[] { 0,0,0,0,0,0,0 } ; |
|
2568 | 2586 |
|
2587 |
long[] lAmounts = new long[] { 0, 0, 0, 0, 0, 0, 0 }; |
|
2588 |
|
|
2569 | 2589 |
long lRequestTotal = 0; |
2570 | 2590 |
long lTaxTotal = 0; |
2571 | 2591 |
long lContractAmount = 0; |
... | ... | |
2578 | 2598 |
break; |
2579 | 2599 |
} |
2580 | 2600 |
|
2581 |
int nKind = int.Parse(dgv1[(int)ColumnName.DgvKind, trow].Value.ToString());
|
|
2601 |
int nKind = CommonMotions.cnvInt(dgv1[(int)ColumnName.DgvKind, trow].Value);
|
|
2582 | 2602 |
|
2583 | 2603 |
// 区分がボディ(本工事)の場合 |
2584 | 2604 |
if (nKind == (int)dgvKind.BodyMainConstruction) |
... | ... | |
2603 | 2623 |
lTaxTotal = 0; |
2604 | 2624 |
} |
2605 | 2625 |
|
2606 |
nMainConstructionCode = int.Parse(dgv1[(int)ColumnName.ConstructionCode, trow].Value.ToString());
|
|
2626 |
nMainConstructionCode = CommonMotions.cnvInt(dgv1[(int)ColumnName.ConstructionCode, trow].Value);
|
|
2607 | 2627 |
|
2608 | 2628 |
dicData.TryGetValue(nMainConstructionCode, out ReqData); |
2609 | 2629 |
dicDetail.TryGetValue(nMainConstructionCode, out lstDetail); |
... | ... | |
2636 | 2656 |
// 増減工事が6個未満( |
2637 | 2657 |
if (lstDetail.Count < 8) |
2638 | 2658 |
{ |
2639 |
lAmounts[nIndex] = lAmount;
|
|
2659 |
lAmounts[nIndex] = lAmount; |
|
2640 | 2660 |
} |
2641 | 2661 |
else |
2642 | 2662 |
{ |
... | ... | |
2659 | 2679 |
|
2660 | 2680 |
// 請求データ、消費税は請求データ用に合算していく |
2661 | 2681 |
lRequestTotal += lAmount; |
2662 |
lTaxTotal += lTax;
|
|
2682 |
lTaxTotal += lTax; |
|
2663 | 2683 |
|
2664 | 2684 |
// 行は2行ずつ加算 |
2665 | 2685 |
trow += 2; |
... | ... | |
2696 | 2716 |
{ |
2697 | 2717 |
int nContractAmount = 0; |
2698 | 2718 |
|
2699 |
Dictionary<int, List<RequestDataDetail>> dicDataDetail = m_lstRequestDataDetail[m_nMaxOrderNo-1];
|
|
2719 |
Dictionary<int, List<RequestDataDetail>> dicDataDetail = m_lstRequestDataDetail[m_nMaxOrderNo - 1];
|
|
2700 | 2720 |
|
2701 | 2721 |
List<RequestDataDetail> lstReqDetail = null; |
2702 | 2722 |
if (dicDataDetail.TryGetValue(nMainConstructionCode, out lstReqDetail) == false) |
... | ... | |
2726 | 2746 |
long lPaidAmount = 0; |
2727 | 2747 |
RequestData ReqData = null; |
2728 | 2748 |
|
2729 |
if( m_nMaxOrderNo > 1 ){ |
|
2749 |
if (m_nMaxOrderNo > 1) |
|
2750 |
{ |
|
2730 | 2751 |
// 直前の請求データをみればよい |
2731 |
Dictionary<int, RequestData> dicData = m_lstRequestData[m_nMaxOrderNo-2];
|
|
2752 |
Dictionary<int, RequestData> dicData = m_lstRequestData[m_nMaxOrderNo - 2];
|
|
2732 | 2753 |
|
2733 | 2754 |
if (dicData.TryGetValue(MainConstructionCode, out ReqData) == true) |
2734 | 2755 |
{ |
... | ... | |
2768 | 2789 |
|
2769 | 2790 |
RequestHead ReqHead = m_lstRequestHead[m_nMaxOrderNo - 1]; |
2770 | 2791 |
|
2771 |
try{ |
|
2792 |
try |
|
2793 |
{ |
|
2772 | 2794 |
string sql; |
2773 | 2795 |
|
2774 | 2796 |
nRequestNo = ReqHead.RequestNo; |
... | ... | |
2832 | 2854 |
{ |
2833 | 2855 |
// 請求ヘッダの更新 |
2834 | 2856 |
sql = ioReqHead.CreatePrimarykeyString(nRequestNo); |
2835 |
if( ioReqHead.UpdateAction(sql, ReqHead) == false){ |
|
2857 |
if (ioReqHead.UpdateAction(sql, ReqHead) == false) |
|
2858 |
{ |
|
2836 | 2859 |
ioReqHead.rollback(); |
2837 | 2860 |
ioReqData.rollback(); |
2838 | 2861 |
ioReqDetail.rollback(); |
... | ... | |
2867 | 2890 |
{ |
2868 | 2891 |
// 請求ヘッダの追加 |
2869 | 2892 |
ReqHead.RequestNo = nRequestNo; |
2870 |
if(ioReqHead.InsertAction(ReqHead) == false){ |
|
2893 |
if (ioReqHead.InsertAction(ReqHead) == false) |
|
2894 |
{ |
|
2871 | 2895 |
ioReqHead.rollback(); |
2872 | 2896 |
ioReqData.rollback(); |
2873 | 2897 |
ioReqDetail.rollback(); |
... | ... | |
3004 | 3028 |
/// </summary> |
3005 | 3029 |
private bool UpdateRequestAmount(ref IOConstructionLedgerExcute ioLdgExcute, RequestHead ReqHead) |
3006 | 3030 |
{ |
3007 |
string sql = "" ;
|
|
3031 |
string sql = ""; |
|
3008 | 3032 |
|
3009 | 3033 |
IOConstructionLedgerDetail ioLdgDetail = new IOConstructionLedgerDetail(); |
3010 | 3034 |
List<ConstructionLedgerDetail> lstDetail = new List<ConstructionLedgerDetail>(); |
... | ... | |
3012 | 3036 |
try |
3013 | 3037 |
{ |
3014 | 3038 |
// 請求金額の行番号を取得 |
3015 |
sql = ioLdgDetail.CreatePrimarykeyString(m_nLeaderConstructionCode,(int)FrmConstructionLedger.DataGroup.BillingAmount); |
|
3039 |
sql = ioLdgDetail.CreatePrimarykeyString(m_nLeaderConstructionCode, (int)FrmConstructionLedger.DataGroup.BillingAmount);
|
|
3016 | 3040 |
if (ioLdgDetail.SelectAction(sql, ref lstDetail) == false) |
3017 | 3041 |
{ |
3018 | 3042 |
return false; |
... | ... | |
3033 | 3057 |
List<ConstructionLedgerExcute> lstExcute = new List<ConstructionLedgerExcute>(); |
3034 | 3058 |
|
3035 | 3059 |
// 旧請求年月が指定されている場合は、一旦旧請求金額を差し引く |
3036 |
if( m_nOldRequestMonth != 0)
|
|
3060 |
if (m_nOldRequestMonth != 0)
|
|
3037 | 3061 |
{ |
3038 | 3062 |
yyyy = CommonMotions.cnvTruncate((double)m_nOldRequestMonth / 100); |
3039 | 3063 |
mm = m_nOldRequestMonth % 100; |
3040 | 3064 |
|
3041 |
dt = new DateTime( yyyy, mm, 1);
|
|
3065 |
dt = new DateTime(yyyy, mm, 1); |
|
3042 | 3066 |
|
3043 | 3067 |
sql = ioLdgExcute.CreatePrimarykeyString(m_nLeaderConstructionCode, lstDetail[0].GroupCount, lstDetail[0].LineCount); |
3044 | 3068 |
sql += string.Format(" AND DATE(TargetMonth) = STR_TO_DATE('{0}', '%Y%m%d') ", dt.ToString("yyyyMMdd")); |
... | ... | |
3049 | 3073 |
} |
3050 | 3074 |
|
3051 | 3075 |
// 旧請求年月があってレコードなしはありえない |
3052 |
if(lstExcute.Count == 0) |
|
3076 |
if (lstExcute.Count == 0)
|
|
3053 | 3077 |
{ |
3054 | 3078 |
return false; |
3055 | 3079 |
} |
... | ... | |
3058 | 3082 |
|
3059 | 3083 |
// 請求金額から旧請求金額を差し引いた金額で更新 |
3060 | 3084 |
LdgExcute.PaymentAmount -= (double)m_lOldRequestAmount; |
3061 |
sql = ioLdgExcute.CreatePrimarykeyString( LdgExcute.ConstructionCode, LdgExcute.GroupCount, LdgExcute.LineCount, LdgExcute.ColumnCount);
|
|
3062 |
if( ioLdgExcute.UpdateAction(sql, LdgExcute) == false)
|
|
3085 |
sql = ioLdgExcute.CreatePrimarykeyString(LdgExcute.ConstructionCode, LdgExcute.GroupCount, LdgExcute.LineCount, LdgExcute.ColumnCount); |
|
3086 |
if (ioLdgExcute.UpdateAction(sql, LdgExcute) == false)
|
|
3063 | 3087 |
{ |
3064 | 3088 |
return false; |
3065 | 3089 |
} |
... | ... | |
3071 | 3095 |
// 請求ヘッダより請求月を求める |
3072 | 3096 |
yyyy = CommonMotions.cnvTruncate((double)ReqHead.RequestMonth / 100); |
3073 | 3097 |
mm = ReqHead.RequestMonth % 100; |
3074 |
dt = new DateTime( yyyy, mm, 1);
|
|
3098 |
dt = new DateTime(yyyy, mm, 1); |
|
3075 | 3099 |
|
3076 | 3100 |
// 当該月の請求金額のレコードがあるか取得してみる |
3077 | 3101 |
sql = ioLdgExcute.CreatePrimarykeyString(m_nLeaderConstructionCode, lstDetail[0].GroupCount, lstDetail[0].LineCount); |
他の形式にエクスポート: Unified diff