リビジョン 48
自動更新マージ、工事結合修正版
trunk/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs | ||
---|---|---|
1565 | 1565 |
|
1566 | 1566 |
#region 工事詳細台帳明細:注文書発行フラグ |
1567 | 1567 |
/// <summary> |
1568 |
/// 工事詳細台帳明細:注文書発行フラグ
|
|
1568 |
/// 工事詳細台帳明細:注文書データ作成フラグ
|
|
1569 | 1569 |
/// </summary> |
1570 | 1570 |
public enum PurchaseOrderFlg |
1571 | 1571 |
{ |
... | ... | |
1574 | 1574 |
/// </summary> |
1575 | 1575 |
NoCreate = 0, |
1576 | 1576 |
/// <summary> |
1577 |
/// 作成中
|
|
1577 |
/// 作成済
|
|
1578 | 1578 |
/// </summary> |
1579 | 1579 |
Making = 1, |
1580 | 1580 |
/// <summary> |
1581 | 1581 |
/// 作成しない |
1582 | 1582 |
/// </summary> |
1583 |
NoMakeData = 9,
|
|
1583 |
NotMakingData = 9,
|
|
1584 | 1584 |
} |
1585 | 1585 |
#endregion |
1586 | 1586 |
|
trunk/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs | ||
---|---|---|
14 | 14 |
/// <summary> |
15 | 15 |
/// 本体バージョン |
16 | 16 |
/// </summary> |
17 |
public static int s_SystemVersion = 2;
|
|
17 |
public static int s_SystemVersion = 1;
|
|
18 | 18 |
|
19 | 19 |
/// <summary> |
20 | 20 |
/// コピー・環境バージョン |
21 | 21 |
/// </summary> |
22 |
public static int s_UpDateCopyVersion = 2;
|
|
22 |
public static int s_UpDateCopyVersion = 1;
|
|
23 | 23 |
} |
24 | 24 |
} |
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsCreateLedgerData.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.ComponentModel; |
|
4 |
using System.Data; |
|
5 |
using System.Drawing; |
|
6 |
using System.Linq; |
|
7 |
using System.Text; |
|
8 |
using System.Windows.Forms; |
|
9 |
using System.Collections; |
|
10 |
using System.Diagnostics; |
|
11 |
|
|
12 |
using log4net; |
|
13 |
using log4net.Appender; |
|
14 |
using log4net.Repository.Hierarchy; |
|
15 |
|
|
16 |
using ProcessManagement.Common; |
|
17 |
using ProcessManagement.DB.IOAccess; |
|
18 |
using ProcessManagement.DataModel; |
|
19 |
using ProcessManagement.Forms.Master; |
|
20 |
using ProcessManagement.Forms.DataEntry; |
|
21 |
using ProcessManagement.Forms.ControlsAction; |
|
22 |
using ProcessManagement.Forms.SubForms; |
|
23 |
|
|
24 |
//*----------------------- 工事詳細台帳データ引込クラス -----------------------* |
|
25 |
// 2016/05/31 Ver1.0.0.0 Create Source |
|
26 |
// |
|
27 |
// |
|
28 |
// |
|
29 |
//*----------------------------------------------------------------------------* |
|
30 |
namespace ProcessManagement.Common |
|
31 |
{ |
|
32 |
//*--------------------- 経費データを工事詳細台帳データ引込む -----------------* |
|
33 |
// 2015/08/12 Ver1.0.0.0 Create Source |
|
34 |
// |
|
35 |
// |
|
36 |
// |
|
37 |
//*----------------------------------------------------------------------------* |
|
38 |
/// <summary> |
|
39 |
/// 経費データを工事詳細台帳データ引込む |
|
40 |
/// </summary> |
|
41 |
public static class ClsCreateLedgerData |
|
42 |
{ |
|
43 |
#region ログ定義 |
|
44 |
/// <summary> |
|
45 |
/// log4netログを使用する |
|
46 |
/// </summary> |
|
47 |
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
|
48 |
#endregion |
|
49 |
|
|
50 |
#region 定数 |
|
51 |
|
|
52 |
#endregion |
|
53 |
|
|
54 |
#region 変数 |
|
55 |
/// <summary> |
|
56 |
/// 工事施工台帳支払い実績先頭カラム数 |
|
57 |
/// </summary> |
|
58 |
private static int m_LedgerColumnCount = 0; |
|
59 |
#endregion |
|
60 |
|
|
61 |
#region 対象月の工事詳細台帳実行データを作成する |
|
62 |
/// <summary> |
|
63 |
/// 対象月の工事詳細台帳実行データを作成する |
|
64 |
/// </summary> |
|
65 |
/// <param name="PersonCode">担当者コード</param> |
|
66 |
/// <param name="TargetMonth">対象年月</param> |
|
67 |
/// <returns></returns> |
|
68 |
public static bool MakeLedgerData(int PersonCode, string TargetMonth) |
|
69 |
{ |
|
70 |
IOCostDataOfPerson CostDB = new IOCostDataOfPerson(); |
|
71 |
IOConstructionLedger LedgerDB = new IOConstructionLedger(); |
|
72 |
IOConstructionLedgerDetail LedgerDetailDB = new IOConstructionLedgerDetail(); |
|
73 |
IOConstructionLedgerExcute LedgerExcuteDB = new IOConstructionLedgerExcute(); |
|
74 |
try |
|
75 |
{ |
|
76 |
// 一括処理で登録を行う |
|
77 |
CostDB.connect(); |
|
78 |
LedgerDB.connect(); |
|
79 |
LedgerDetailDB.connect(); |
|
80 |
LedgerExcuteDB.connect(); LedgerExcuteDB.beginTran(); |
|
81 |
|
|
82 |
// 詳細台帳よりグリッドのカラムを取得する |
|
83 |
GetLedgerColumnCount(); |
|
84 |
|
|
85 |
// 対象をまず削除する |
|
86 |
string strDelSQL = "DELETE CONSTRUCTIONLEDGEREXCUTE"; |
|
87 |
strDelSQL += " WHERE CONSTRUCTIONCODE IN"; |
|
88 |
strDelSQL += " (SELECT CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO"; |
|
89 |
strDelSQL += string.Format(" WHERE (SALESPERSONCODE = {0} OR CONSTRUCTIONPERSONCODE = {0} OR CONSTRSUBPERSONCODE = {0} OR CONSTRUCTIONINSTRUCTOR = {0}))", PersonCode); |
|
90 |
strDelSQL += string.Format(" AND GROUPCOUNT IN ({0}, {1}, {2}, {3}, {4})" |
|
91 |
, GetConstructionLedgerGroupNo((int)CommonDefine.CostDataNo.Transport) |
|
92 |
, GetConstructionLedgerGroupNo((int)CommonDefine.CostDataNo.Purchase) |
|
93 |
, GetConstructionLedgerGroupNo((int)CommonDefine.CostDataNo.Lease) |
|
94 |
, GetConstructionLedgerGroupNo((int)CommonDefine.CostDataNo.StoragePlace) |
|
95 |
, GetConstructionLedgerGroupNo((int)CommonDefine.CostDataNo.Lodging)); |
|
96 |
strDelSQL += string.Format(" AND TARGETMONTH = TO_DATE('{0}','YYYY/MM/DD')", (TargetMonth + "/01")); |
|
97 |
LedgerExcuteDB.ExecuteNonQuery(strDelSQL, false); |
|
98 |
|
|
99 |
for (int i = (int)CommonDefine.CostDataNo.Transport; i <= (int)CommonDefine.CostDataNo.Lodging; i++) |
|
100 |
{ |
|
101 |
string strSQL = "SELECT CONSTRUCTIONCODE, DATATYPE, TO_CHAR(ACTIONDATE,'YYYY/MM'), SUM(ENTRYPRICE) FROM COSTDATAOFPERSON"; |
|
102 |
strSQL += String.Format(" WHERE TO_CHAR(ACTIONDATE,'YYYY/MM') = '{0}'", TargetMonth); |
|
103 |
strSQL += String.Format(" AND DATATYPE = {0}", i); |
|
104 |
strSQL += " AND CONSTRUCTIONCODE IN (SELECT CONSTRUCTIONCODE FROM CONSTRUCTIONBASEINFO"; |
|
105 |
strSQL += string.Format(" WHERE (SALESPERSONCODE = {0} OR CONSTRUCTIONPERSONCODE = {0} OR CONSTRSUBPERSONCODE = {0} OR CONSTRUCTIONINSTRUCTOR = {0}))", PersonCode); |
|
106 |
strSQL += " GROUP BY CONSTRUCTIONCODE, DATATYPE, TO_CHAR(ACTIONDATE,'YYYY/MM')"; |
|
107 |
strSQL += " ORDER BY CONSTRUCTIONCODE, DATATYPE"; |
|
108 |
ArrayList arList = new ArrayList(); |
|
109 |
if (!CostDB.ExecuteReader(strSQL, ref arList, false)) continue; |
|
110 |
if (arList.Count == 0) continue; |
|
111 |
|
|
112 |
foreach (object[] wrkrec in arList) |
|
113 |
{ |
|
114 |
|
|
115 |
// 支払金額 |
|
116 |
int PaymentPrice = CommonMotions.cnvInt(wrkrec[3]); |
|
117 |
// 支払金額無は処理しない |
|
118 |
if (PaymentPrice == 0) continue; |
|
119 |
|
|
120 |
// 工事番号 |
|
121 |
int ConstructionCode = CommonMotions.cnvInt(wrkrec[0]); |
|
122 |
|
|
123 |
// グループ番号 |
|
124 |
int DataType = i; |
|
125 |
int GroupNo = GetConstructionLedgerGroupNo(DataType); |
|
126 |
|
|
127 |
// 工事詳細台帳よりデータの行・列を取得する |
|
128 |
int LineCnt = 0; |
|
129 |
int ColCnt = 0; |
|
130 |
// 台帳が無ければ処理しない |
|
131 |
if (!SearchTatgetConstructionLedger(LedgerDB, LedgerDetailDB, ConstructionCode, GroupNo, TargetMonth, ref LineCnt, ref ColCnt)) continue; |
|
132 |
|
|
133 |
ConstructionLedgerExcute excRec = new ConstructionLedgerExcute(); |
|
134 |
// データ編集 |
|
135 |
excRec.ConstructionCode = ConstructionCode; |
|
136 |
excRec.GroupCount = GroupNo; |
|
137 |
excRec.LineCount = LineCnt; |
|
138 |
excRec.ColumnCount = ColCnt; |
|
139 |
excRec.PaymentAmount = PaymentPrice; |
|
140 |
excRec.TargetMonth = CommonMotions.cnvDate(TargetMonth + "/01"); |
|
141 |
|
|
142 |
if (!LedgerExcuteDB.InsertAction(excRec, false)) |
|
143 |
{ |
|
144 |
LedgerExcuteDB.rollback(); |
|
145 |
return false; |
|
146 |
} |
|
147 |
} |
|
148 |
} |
|
149 |
// DBコミット |
|
150 |
LedgerExcuteDB.commit(); |
|
151 |
|
|
152 |
return true; |
|
153 |
} |
|
154 |
catch (System.Exception ex) |
|
155 |
{ |
|
156 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
157 |
LedgerExcuteDB.rollback(); |
|
158 |
return false; |
|
159 |
} |
|
160 |
finally |
|
161 |
{ |
|
162 |
CostDB.close(); CostDB = null; |
|
163 |
LedgerDB.close(); LedgerDB = null; |
|
164 |
LedgerDetailDB.close(); LedgerDetailDB = null; |
|
165 |
LedgerExcuteDB.close(); LedgerExcuteDB = null; |
|
166 |
} |
|
167 |
} |
|
168 |
#endregion |
|
169 |
|
|
170 |
#region 工事詳細台帳より対象データを探して実行データの行番号・列番号を返す |
|
171 |
/// <summary> |
|
172 |
/// 工事詳細台帳より対象データを探して実行データの行番号・列番号を返す |
|
173 |
/// </summary> |
|
174 |
/// <returns></returns> |
|
175 |
private static bool SearchTatgetConstructionLedger(IOConstructionLedger LedgerDB, IOConstructionLedgerDetail LedgerDetailDB |
|
176 |
,int ConstructionCode, int GroupNo, string TargetMonth, ref int LineCnt, ref int ColCnt) |
|
177 |
{ |
|
178 |
try |
|
179 |
{ |
|
180 |
// 台帳データよりカラム数を取得する |
|
181 |
string strLedger = LedgerDB.CreatePrimarykeyString(ConstructionCode); |
|
182 |
ConstructionLedger LedgerRec = new ConstructionLedger(); |
|
183 |
if (!LedgerDB.SelectAction(strLedger, ref LedgerRec, false)) return false; |
|
184 |
|
|
185 |
// 現在の処理年月をDateTime型に変換する |
|
186 |
DateTime NowDates = CommonMotions.cnvDate(TargetMonth + "/01"); |
|
187 |
// 経過月数を取得する |
|
188 |
int DiffMonth = NowDates.Month - LedgerRec.ConstructionStart.Month; |
|
189 |
|
|
190 |
// 列番号取得 |
|
191 |
ColCnt = m_LedgerColumnCount + DiffMonth; |
|
192 |
|
|
193 |
// 工事詳細台帳明細データ読込み |
|
194 |
string strSQL = LedgerDetailDB.CreatePrimarykeyString(ConstructionCode, GroupNo); |
|
195 |
List<ConstructionLedgerDetail> DetailList = new List<ConstructionLedgerDetail>(); |
|
196 |
if (!LedgerDetailDB.SelectAction(strSQL, ref DetailList, false)) return false; |
|
197 |
// 行番号取得 |
|
198 |
LineCnt = DetailList[0].LineCount; |
|
199 |
|
|
200 |
return true; |
|
201 |
} |
|
202 |
catch (System.Exception ex) |
|
203 |
{ |
|
204 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
205 |
return false; |
|
206 |
} |
|
207 |
} |
|
208 |
#endregion |
|
209 |
|
|
210 |
#region 工事台帳のグループ番号を取得する |
|
211 |
/// <summary> |
|
212 |
/// 工事台帳のグループ番号を取得する |
|
213 |
/// </summary> |
|
214 |
/// <param name="TargetData"></param> |
|
215 |
/// <returns></returns> |
|
216 |
public static int GetConstructionLedgerGroupNo(int TargetData) |
|
217 |
{ |
|
218 |
int GroupNo = 0; |
|
219 |
// 工事台帳のグループ番号を取得する |
|
220 |
switch (TargetData) |
|
221 |
{ |
|
222 |
case (int)CommonDefine.CostDataNo.Transport: |
|
223 |
// 交通費(通行料・電車代) |
|
224 |
GroupNo = (int)GroupName_ConstructionLedger.TransportationCosts; |
|
225 |
break; |
|
226 |
case (int)CommonDefine.CostDataNo.Purchase: |
|
227 |
// 購入品 |
|
228 |
GroupNo = (int)GroupName_ConstructionLedger.PurchaseCosts; |
|
229 |
break; |
|
230 |
case (int)CommonDefine.CostDataNo.Lease: |
|
231 |
// 車両リース代 |
|
232 |
GroupNo = (int)GroupName_ConstructionLedger.VehicleLeaseFee; |
|
233 |
break; |
|
234 |
case (int)CommonDefine.CostDataNo.StoragePlace: |
|
235 |
// 駐車場・資材置き場 |
|
236 |
GroupNo = (int)GroupName_ConstructionLedger.ParkingCosts; |
|
237 |
break; |
|
238 |
case (int)CommonDefine.CostDataNo.Lodging: |
|
239 |
// 宿泊費 |
|
240 |
GroupNo = (int)GroupName_ConstructionLedger.RoomChargeCosts; |
|
241 |
break; |
|
242 |
} |
|
243 |
return GroupNo; |
|
244 |
} |
|
245 |
#endregion |
|
246 |
|
|
247 |
#region 工事詳細台帳より支払金額グリッドの先頭カラム数を取得する |
|
248 |
/// <summary> |
|
249 |
/// 工事詳細台帳より支払金額グリッドの先頭カラム数を取得する |
|
250 |
/// </summary> |
|
251 |
private static void GetLedgerColumnCount() |
|
252 |
{ |
|
253 |
FrmConstructionLedger frm = new FrmConstructionLedger(); |
|
254 |
try |
|
255 |
{ |
|
256 |
m_LedgerColumnCount = frm.GetGridColumsCount - 1; |
|
257 |
} |
|
258 |
catch (System.Exception ex) |
|
259 |
{ |
|
260 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
261 |
} |
|
262 |
finally |
|
263 |
{ |
|
264 |
frm.Dispose(); frm = null; |
|
265 |
} |
|
266 |
} |
|
267 |
#endregion |
|
268 |
|
|
269 |
#region 個人毎経費データから工事詳細台帳の工事毎のデータ再計算更新処理 |
|
270 |
/// <summary> |
|
271 |
/// 個人毎経費データから工事詳細台帳の工事毎のデータ再計算更新処理 |
|
272 |
/// </summary> |
|
273 |
/// <param name="PersonCode"></param> |
|
274 |
/// <param name="TargetMonth"></param> |
|
275 |
/// <returns></returns> |
|
276 |
public static bool UpdateRecalLedgerDataFromTAndPCost(int PersonCode, string TargetMonth) |
|
277 |
{ |
|
278 |
IOCostDataOfPerson CostDB = new IOCostDataOfPerson(); |
|
279 |
FrmConstructionLedger frm = new FrmConstructionLedger(); |
|
280 |
try |
|
281 |
{ |
|
282 |
string strSQL = "SELECT PERSONCODE, TO_CHAR(ACTIONDATE,'YYYY/MM'), CONSTRUCTIONCODE FROM COSTDATAOFPERSON"; |
|
283 |
strSQL += String.Format(" WHERE PERSONCODE = {0} AND TO_CHAR(ACTIONDATE,'YYYY/MM') = '{1}'", PersonCode, TargetMonth); |
|
284 |
strSQL += " GROUP BY PERSONCODE, TO_CHAR(ACTIONDATE,'YYYY/MM'), CONSTRUCTIONCODE"; |
|
285 |
strSQL += " ORDER BY CONSTRUCTIONCODE"; |
|
286 |
|
|
287 |
ArrayList arList = new ArrayList(); |
|
288 |
if (!CostDB.ExecuteReader(strSQL, ref arList)) return false; |
|
289 |
if (arList.Count == 0) return true; |
|
290 |
|
|
291 |
bool bInit = true; |
|
292 |
foreach (object[] wrkobj in arList) |
|
293 |
{ |
|
294 |
int ConstructionCode = CommonMotions.cnvInt(wrkobj[2]); |
|
295 |
// 工事番号が存在しないデータは更新にしない |
|
296 |
if (ConstructionCode == 0) continue; |
|
297 |
|
|
298 |
// 工事コードのセット |
|
299 |
frm.ConstructionCode = ConstructionCode; |
|
300 |
|
|
301 |
if (bInit) |
|
302 |
{ |
|
303 |
// 見えない画面を出す |
|
304 |
frm.Show(); |
|
305 |
// フォーム非表示 |
|
306 |
frm.Visible = false; |
|
307 |
bInit = false; |
|
308 |
} |
|
309 |
// 再計算処理 |
|
310 |
bool bret = frm.RecalculateLedger; |
|
311 |
} |
|
312 |
|
|
313 |
// 画面を閉じる |
|
314 |
frm.Close(); |
|
315 |
} |
|
316 |
catch (System.Exception ex) |
|
317 |
{ |
|
318 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
319 |
return false; |
|
320 |
} |
|
321 |
finally |
|
322 |
{ |
|
323 |
CostDB.close(); CostDB = null; |
|
324 |
frm.Dispose(); frm = null; |
|
325 |
} |
|
326 |
return true; |
|
327 |
} |
|
328 |
#endregion |
|
329 |
|
|
330 |
#region 工事詳細台帳データを新規作成する |
|
331 |
/// <summary> |
|
332 |
/// 工事詳細台帳データを新規作成する |
|
333 |
/// </summary> |
|
334 |
/// <param name="ConstructionCode"></param> |
|
335 |
/// <returns></returns> |
|
336 |
public static bool MakingLedgerData(int ConstructionCode) |
|
337 |
{ |
|
338 |
IOConstructionLedger LedgerDB = new IOConstructionLedger(); |
|
339 |
FrmConstructionLedger frm = new FrmConstructionLedger(); |
|
340 |
try |
|
341 |
{ |
|
342 |
// 工事番号が存在しないデータは更新しない |
|
343 |
if (ConstructionCode == 0) return false; |
|
344 |
|
|
345 |
// 工事詳細台帳データが既にあれば作成しない |
|
346 |
string strExists = LedgerDB.CreatePrimarykeyString(ConstructionCode); |
|
347 |
List<ConstructionLedger> LedgerList = new List<ConstructionLedger>(); |
|
348 |
LedgerDB.SelectAction(strExists, ref LedgerList); |
|
349 |
if (LedgerList.Count > 0) return true; |
|
350 |
|
|
351 |
// 工事コードのセット |
|
352 |
frm.ConstructionCode = ConstructionCode; |
|
353 |
|
|
354 |
// 見えない画面を出す |
|
355 |
frm.WindowState = FormWindowState.Minimized; |
|
356 |
frm.Show(); |
|
357 |
// フォーム非表示 |
|
358 |
frm.Visible = false; |
|
359 |
|
|
360 |
// データ作成処理 |
|
361 |
if (!frm.SaveLedgerData) |
|
362 |
{ |
|
363 |
frm.Close(); // 画面を閉じる |
|
364 |
return false; |
|
365 |
} |
|
366 |
|
|
367 |
// 画面を閉じる |
|
368 |
frm.Close(); |
|
369 |
|
|
370 |
return true; |
|
371 |
} |
|
372 |
catch (System.Exception ex) |
|
373 |
{ |
|
374 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
375 |
return false; |
|
376 |
} |
|
377 |
finally |
|
378 |
{ |
|
379 |
frm.Dispose(); frm = null; |
|
380 |
LedgerDB.close(); LedgerDB = null; |
|
381 |
} |
|
382 |
} |
|
383 |
#endregion |
|
384 |
|
|
385 |
#region 工事詳細台帳データに増減データを追加する |
|
386 |
/// <summary> |
|
387 |
/// 工事詳細台帳データに増減データを追加する |
|
388 |
/// </summary> |
|
389 |
/// <param name="ConstructionCode"></param> |
|
390 |
/// <returns></returns> |
|
391 |
public static bool AddingLedgerData(int ConstructionCode) |
|
392 |
{ |
|
393 |
IOConstructionLink LinkDB = new IOConstructionLink(); |
|
394 |
IOConstructionLedger LedgerDB = new IOConstructionLedger(); |
|
395 |
FrmConstructionLedger frm = new FrmConstructionLedger(); |
|
396 |
try |
|
397 |
{ |
|
398 |
|
|
399 |
// 工事番号が存在しないデータは更新しない |
|
400 |
if (ConstructionCode == 0) return false; |
|
401 |
|
|
402 |
// 親の工事を探す |
|
403 |
string strParent = string.Format(" WHERE FluctuationCode = {0}", ConstructionCode); |
|
404 |
ConstructionLink LinkRec = new ConstructionLink(); |
|
405 |
if (!LinkDB.SelectAction(strParent, ref LinkRec)) return false; |
|
406 |
|
|
407 |
// 工事詳細台帳データが無い場合は処理しない |
|
408 |
string strExists = LedgerDB.CreatePrimarykeyString(LinkRec.ConstructionCode); |
|
409 |
ConstructionLedger LedgerList = new ConstructionLedger(); |
|
410 |
if (!LedgerDB.SelectAction(strExists, ref LedgerList)) return false; |
|
411 |
|
|
412 |
// 工事コードのセット |
|
413 |
frm.ConstructionCode = LinkRec.ConstructionCode; |
|
414 |
|
|
415 |
// 見えない画面を出す |
|
416 |
frm.WindowState = FormWindowState.Minimized; |
|
417 |
frm.Show(); |
|
418 |
// フォーム非表示 |
|
419 |
frm.Visible = false; |
|
420 |
|
|
421 |
// データを追加する |
|
422 |
frm.AddingConstrCode = ConstructionCode; |
|
423 |
if (!frm.AddDataLedger) |
|
424 |
{ |
|
425 |
frm.Close(); // 画面を閉じる |
|
426 |
return false; |
|
427 |
} |
|
428 |
|
|
429 |
// データ作成処理 |
|
430 |
if (!frm.SaveLedgerData) |
|
431 |
{ |
|
432 |
frm.Close(); // 画面を閉じる |
|
433 |
return false; |
|
434 |
} |
|
435 |
|
|
436 |
// 画面を閉じる |
|
437 |
frm.Close(); |
|
438 |
|
|
439 |
return true; |
|
440 |
} |
|
441 |
catch (System.Exception ex) |
|
442 |
{ |
|
443 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
444 |
return false; |
|
445 |
} |
|
446 |
finally |
|
447 |
{ |
|
448 |
frm.Dispose(); frm = null; |
|
449 |
LedgerDB.close(); LedgerDB = null; |
|
450 |
LinkDB.close(); LinkDB = null; |
|
451 |
} |
|
452 |
} |
|
453 |
#endregion |
|
454 |
} |
|
455 |
} |
trunk/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs | ||
---|---|---|
1003 | 1003 |
|
1004 | 1004 |
// パラメータセット |
1005 | 1005 |
frm.ConstructionCode = CurrentPara.IntExecParameter[0]; |
1006 |
frm.OrderNo = CurrentPara.IntExecParameter[1]; |
|
1006 | 1007 |
|
1007 | 1008 |
// フォーム表示 |
1008 | 1009 |
frm.ShowDialog(); |
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODailyDataConstruction.cs | ||
---|---|---|
254 | 254 |
} |
255 | 255 |
#endregion |
256 | 256 |
|
257 |
#region 1項目更新処理 |
|
258 |
/// <summary> |
|
259 |
/// 1項目の更新を行う |
|
260 |
/// </summary> |
|
261 |
/// <param name="ConstructionCode"></param> |
|
262 |
/// <param name="FeildNo"></param> |
|
263 |
/// <param name="value"></param> |
|
264 |
/// <param name="bConnect"></param> |
|
265 |
/// <returns></returns> |
|
266 |
public bool UpdateFeild(int PersonCode, DateTime DailyDataDate, int ConstructionCode, int FeildNo, object value, bool bConnect = true) |
|
267 |
{ |
|
268 |
string strcmd = ""; |
|
269 |
try |
|
270 |
{ |
|
271 |
strcmd = "UPDATE DailyDataConstruction"; |
|
272 |
|
|
273 |
strcmd += " SET"; |
|
274 |
switch (FeildNo) |
|
275 |
{ |
|
276 |
case (int)DataColumn.PersonCode: |
|
277 |
strcmd += string.Format(" PersonCode = {0}", ((int)value).ToString()); |
|
278 |
break; |
|
279 |
case (int)DataColumn.DailyDataDate: |
|
280 |
strcmd += string.Format(" DailyDataDate = TO_DATE('{0}','YYYY/MM/DD')", ((DateTime)value).ToShortDateString()); |
|
281 |
break; |
|
282 |
case (int)DataColumn.ConstructionCode: |
|
283 |
strcmd += string.Format(" ConstructionCode = {0}", ((int)value).ToString()); |
|
284 |
break; |
|
285 |
case (int)DataColumn.Weather: |
|
286 |
strcmd += string.Format(" Weather = '{0}'", value.ToString()); |
|
287 |
break; |
|
288 |
} |
|
289 |
|
|
290 |
strcmd += ", UpdateDate = TO_DATE(TO_CHAR(sysdate,'YYYY/MM/DD HH24:MI:SS'),'YYYY/MM/DD HH24:MI:SS')"; |
|
291 |
strcmd += CreatePrimarykeyString(PersonCode, DailyDataDate, ConstructionCode); |
|
292 |
|
|
293 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
|
294 |
|
|
295 |
return true; |
|
296 |
} |
|
297 |
catch (Exception ex) |
|
298 |
{ |
|
299 |
logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd); |
|
300 |
return false; |
|
301 |
} |
|
302 |
} |
|
303 |
#endregion |
|
304 |
|
|
257 | 305 |
#region 削除処理 |
258 | 306 |
/// <summary> |
259 | 307 |
/// 担当者毎経費データ削除 |
trunk/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPurchaseOrder.cs | ||
---|---|---|
625 | 625 |
/// <param name="AddSQLString"></param> |
626 | 626 |
/// <param name="bConnect"></param> |
627 | 627 |
/// <returns></returns> |
628 |
public int SelectMaxConstructionCodeCount(string AddSQLString, bool bConnect = true)
|
|
628 |
public int SelectMaxSeqNoCount(string AddSQLString, bool bConnect = true)
|
|
629 | 629 |
{ |
630 | 630 |
//Oracle インターフェース |
631 | 631 |
string strcmd = ""; |
trunk/src/ProcessManagement/ProcessManagement/DataModel/DepartmentExpensesMaster.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
|
|
6 |
namespace ProcessManagement.DataModel |
|
7 |
{ |
|
8 |
/// <summary> |
|
9 |
/// 部署経費率マスタ |
|
10 |
/// </summary> |
|
11 |
public class DepartmentExpensesMaster |
|
12 |
{ |
|
13 |
#region メンバ変数 |
|
14 |
private int m_DepartmentCode = 0; // 工事種別コード |
|
15 |
private int m_NameCode = 0; // 経費区分コード |
|
16 |
private int m_DisplayOrder = 0; // 表示順 |
|
17 |
private double m_ExpensesRatio = 0; // 経費率 |
|
18 |
private int m_DeleteFlg = 0; // 削除フラグ |
|
19 |
private DateTime m_EntryDate = DateTime.Now; // 登録日付 |
|
20 |
private DateTime m_UpdateDate = DateTime.Now; // 更新日付 |
|
21 |
#endregion |
|
22 |
|
|
23 |
#region コンストラクタ |
|
24 |
#endregion |
|
25 |
|
|
26 |
#region プロパティ |
|
27 |
/// <summary> |
|
28 |
/// 区分コード |
|
29 |
/// </summary> |
|
30 |
public int DepartmentCode |
|
31 |
{ |
|
32 |
get { return m_DepartmentCode; } |
|
33 |
set { m_DepartmentCode = value; } |
|
34 |
} |
|
35 |
/// <summary> |
|
36 |
/// 名称コード |
|
37 |
/// </summary> |
|
38 |
public int NameCode |
|
39 |
{ |
|
40 |
get { return m_NameCode; } |
|
41 |
set { m_NameCode = value; } |
|
42 |
} |
|
43 |
/// <summary> |
|
44 |
/// 表示順 |
|
45 |
/// </summary> |
|
46 |
public int DisplayOrder |
|
47 |
{ |
|
48 |
get { return m_DisplayOrder; } |
|
49 |
set { m_DisplayOrder = value; } |
|
50 |
} |
|
51 |
/// <summary> |
|
52 |
/// 経費率 |
|
53 |
/// </summary> |
|
54 |
public double ExpensesRatio |
|
55 |
{ |
|
56 |
get { return m_ExpensesRatio; } |
|
57 |
set { m_ExpensesRatio = value; } |
|
58 |
} |
|
59 |
/// <summary> |
|
60 |
/// 削除フラグ |
|
61 |
/// </summary> |
|
62 |
public int DeleteFlg |
|
63 |
{ |
|
64 |
get { return m_DeleteFlg; } |
|
65 |
set { m_DeleteFlg = value; } |
|
66 |
} |
|
67 |
/// <summary> |
|
68 |
/// 登録日付 |
|
69 |
/// </summary> |
|
70 |
public DateTime EntryDate |
|
71 |
{ |
|
72 |
set { m_EntryDate = value; } |
|
73 |
get { return m_EntryDate; } |
|
74 |
} |
|
75 |
/// <summary> |
|
76 |
/// 更新日付 |
|
77 |
/// </summary> |
|
78 |
public DateTime UpdateDate |
|
79 |
{ |
|
80 |
set { m_UpdateDate = value; } |
|
81 |
get { return m_UpdateDate; } |
|
82 |
} |
|
83 |
#endregion |
|
84 |
} |
|
85 |
} |
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalScreen/FrmApprovalScreen.cs | ||
---|---|---|
567 | 567 |
// ??A?f?[?^???????? |
568 | 568 |
switch (m_ApprovalCode) |
569 | 569 |
{ |
570 |
// 1:??Z????????F |
|
570 | 571 |
case (int)ClsExcute.ApprovalListNo.EstimateApproval: |
571 |
// 1:??Z????????F
|
|
572 |
// 2:??Z?\?Z?????F
|
|
572 | 573 |
case (int)ClsExcute.ApprovalListNo.EstimateBudgetApproval: |
573 |
// 2:??Z?\?Z?????F
|
|
574 |
// 3:?H???\?Z?????F
|
|
574 | 575 |
case (int)ClsExcute.ApprovalListNo.ConstructionBudgetApproval: |
575 |
// 3:?H???\?Z?????F |
|
576 |
break; |
|
577 |
|
|
578 |
// 4:?????????F |
|
576 | 579 |
case (int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval: |
577 |
// 4:?????????F |
|
580 |
RemoveApprovalLinkDetail(); |
|
581 |
break; |
|
582 |
|
|
583 |
// 5:?????????F |
|
578 | 584 |
case (int)ClsExcute.ApprovalListNo.OrderBillingApproval: |
579 |
// 5:?????????F
|
|
585 |
// 6:?H??????F
|
|
580 | 586 |
case (int)ClsExcute.ApprovalListNo.DRConstructionApproval: |
581 |
// 6:?H??????F |
|
582 | 587 |
default: |
583 | 588 |
break; |
584 | 589 |
} |
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalScreen/FrmApprovalScreenAuxiliary.cs | ||
---|---|---|
1185 | 1185 |
} |
1186 | 1186 |
} |
1187 | 1187 |
#endregion |
1188 |
|
|
1189 |
#region 承認データと注文書データのリンク情報を削除する |
|
1190 |
/// <summary> |
|
1191 |
/// 承認データと注文書データのリンク情報を削除する |
|
1192 |
/// </summary> |
|
1193 |
private void RemoveApprovalLinkDetail() |
|
1194 |
{ |
|
1195 |
IOProcessApprovalDetail DetailDB = new IOProcessApprovalDetail(); |
|
1196 |
try |
|
1197 |
{ |
|
1198 |
DetailDB.connect(); DetailDB.beginTran(); |
|
1199 |
|
|
1200 |
string strSQL = DetailDB.CreatePrimarykeyString(m_ConstructionCode, m_ApprovalCode, m_OrderNo); |
|
1201 |
DetailDB.DeleteAction(strSQL, false); |
|
1202 |
|
|
1203 |
DetailDB.commit(); |
|
1204 |
} |
|
1205 |
catch (Exception ex) |
|
1206 |
{ |
|
1207 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
1208 |
} |
|
1209 |
finally |
|
1210 |
{ |
|
1211 |
DetailDB.close(); DetailDB = null; |
|
1212 |
} |
|
1213 |
} |
|
1214 |
#endregion |
|
1188 | 1215 |
} |
1189 | 1216 |
} |
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionList.cs | ||
---|---|---|
48 | 48 |
PrintOutFlg, |
49 | 49 |
ConstructionPeriod, |
50 | 50 |
ConstructionCode, |
51 |
OrderNo, |
|
51 | 52 |
} |
52 | 53 |
|
53 | 54 |
#endregion |
... | ... | |
177 | 178 |
} |
178 | 179 |
#endregion |
179 | 180 |
|
180 |
#region ?I???{?^?? |
|
181 |
/// <summary> |
|
182 |
/// ?H???I???{?^?????? |
|
183 |
/// </summary> |
|
184 |
/// <param name="sender"></param> |
|
185 |
/// <param name="e"></param> |
|
186 |
private void btnDataSelect_Click(object sender, EventArgs e) |
|
187 |
{ |
|
188 |
// ?f?[?^?????????????? |
|
189 |
if (dgvMaster.RowCount == 0) return; |
|
190 |
if (CommonMotions.chkCellBlank(dgvMaster.CurrentRow.Cells[(int)DispColumn.ConstructionName].Value)) return; |
|
191 |
|
|
192 |
// ?e?????N?? |
|
193 |
SubProcessExecute(CommonMotions.cnvIntFromStringCode(dgvMaster.CurrentRow.Cells[(int)DispColumn.ConstructionCode].Value.ToString(), "-")); |
|
194 |
} |
|
195 |
#endregion |
|
196 |
|
|
197 | 181 |
#region ?X?V?{?^?? |
198 | 182 |
/// <summary> |
199 | 183 |
/// ?f?[?^?X?V?{?^?????? |
... | ... | |
247 | 231 |
if (CommonMotions.chkCellBlank(dgvMaster.CurrentRow.Cells[(int)DispColumn.ConstructionName].Value)) return; |
248 | 232 |
|
249 | 233 |
// ?e?????N?? |
250 |
SubProcessExecute(CommonMotions.cnvIntFromStringCode(dgvMaster.CurrentRow.Cells[(int)DispColumn.ConstructionCode].Value.ToString(), "-")); |
|
234 |
int ConstrCode = CommonMotions.cnvIntFromStringCode(dgvMaster.CurrentRow.Cells[(int)DispColumn.ConstructionCode].Value.ToString(), "-"); |
|
235 |
int OrderNo = CommonMotions.cnvInt(dgvMaster.CurrentRow.Cells[(int)DispColumn.OrderNo].Value); |
|
236 |
SubProcessExecute(ConstrCode, OrderNo); |
|
251 | 237 |
} |
252 | 238 |
#endregion |
253 | 239 |
|
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionList.designer.cs | ||
---|---|---|
41 | 41 |
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle(); |
42 | 42 |
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle(); |
43 | 43 |
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = new System.Windows.Forms.DataGridViewCellStyle(); |
44 |
this.btnDataSelect = new System.Windows.Forms.Button(); |
|
45 | 44 |
this.btnDataEntry = new System.Windows.Forms.Button(); |
46 | 45 |
this.btnEnd = new System.Windows.Forms.Button(); |
47 | 46 |
this.label1 = new System.Windows.Forms.Label(); |
... | ... | |
70 | 69 |
this.Column8 = new System.Windows.Forms.DataGridViewTextBoxColumn(); |
71 | 70 |
this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn(); |
72 | 71 |
this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn(); |
72 |
this.Column11 = new System.Windows.Forms.DataGridViewTextBoxColumn(); |
|
73 | 73 |
this.groupBox1.SuspendLayout(); |
74 | 74 |
((System.ComponentModel.ISupportInitialize)(this.numUDConstPro)).BeginInit(); |
75 | 75 |
((System.ComponentModel.ISupportInitialize)(this.dgvMaster)).BeginInit(); |
76 | 76 |
this.SuspendLayout(); |
77 | 77 |
// |
78 |
// btnDataSelect |
|
79 |
// |
|
80 |
this.btnDataSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); |
|
81 |
this.btnDataSelect.BackColor = System.Drawing.Color.Green; |
|
82 |
this.btnDataSelect.ForeColor = System.Drawing.Color.White; |
|
83 |
this.btnDataSelect.Location = new System.Drawing.Point(10, 619); |
|
84 |
this.btnDataSelect.Name = "btnDataSelect"; |
|
85 |
this.btnDataSelect.Size = new System.Drawing.Size(120, 30); |
|
86 |
this.btnDataSelect.TabIndex = 6; |
|
87 |
this.btnDataSelect.Text = "工事を選択"; |
|
88 |
this.btnDataSelect.UseVisualStyleBackColor = false; |
|
89 |
this.btnDataSelect.Visible = false; |
|
90 |
this.btnDataSelect.Click += new System.EventHandler(this.btnDataSelect_Click); |
|
91 |
// |
|
92 | 78 |
// btnDataEntry |
93 | 79 |
// |
94 | 80 |
this.btnDataEntry.Anchor = System.Windows.Forms.AnchorStyles.Bottom; |
... | ... | |
351 | 337 |
this.Column7, |
352 | 338 |
this.Column8, |
353 | 339 |
this.Column3, |
354 |
this.Column2}); |
|
340 |
this.Column2, |
|
341 |
this.Column11}); |
|
355 | 342 |
dataGridViewCellStyle13.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; |
356 | 343 |
dataGridViewCellStyle13.BackColor = System.Drawing.SystemColors.Window; |
357 | 344 |
dataGridViewCellStyle13.Font = new System.Drawing.Font("MS 明朝", 11.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(128))); |
... | ... | |
490 | 477 |
this.Column2.Visible = false; |
491 | 478 |
this.Column2.Width = 5; |
492 | 479 |
// |
480 |
// Column11 |
|
481 |
// |
|
482 |
this.Column11.Frozen = true; |
|
483 |
this.Column11.HeaderText = "申請受付番号"; |
|
484 |
this.Column11.Name = "Column11"; |
|
485 |
this.Column11.ReadOnly = true; |
|
486 |
this.Column11.Resizable = System.Windows.Forms.DataGridViewTriState.False; |
|
487 |
this.Column11.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; |
|
488 |
this.Column11.Visible = false; |
|
489 |
this.Column11.Width = 5; |
|
490 |
// |
|
493 | 491 |
// FrmConstructionList |
494 | 492 |
// |
495 | 493 |
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); |
... | ... | |
501 | 499 |
this.Controls.Add(this.lblProcessTitil); |
502 | 500 |
this.Controls.Add(this.groupBox1); |
503 | 501 |
this.Controls.Add(this.label1); |
504 |
this.Controls.Add(this.btnDataSelect); |
|
505 | 502 |
this.Controls.Add(this.btnDataUpDate); |
506 | 503 |
this.Controls.Add(this.btnDataEntry); |
507 | 504 |
this.Controls.Add(this.btnEnd); |
... | ... | |
527 | 524 |
|
528 | 525 |
#endregion |
529 | 526 |
|
530 |
private System.Windows.Forms.Button btnDataSelect; |
|
531 | 527 |
private System.Windows.Forms.Button btnDataEntry; |
532 | 528 |
private System.Windows.Forms.Button btnEnd; |
533 | 529 |
private System.Windows.Forms.Label label1; |
... | ... | |
544 | 540 |
private System.Windows.Forms.NumericUpDown numUDConstPro; |
545 | 541 |
private System.Windows.Forms.Label label5; |
546 | 542 |
private System.Windows.Forms.Label label7; |
543 |
private System.Windows.Forms.RadioButton radioButton2; |
|
544 |
private System.Windows.Forms.RadioButton radioButton1; |
|
547 | 545 |
private System.Windows.Forms.DataGridViewTextBoxColumn Column1; |
548 | 546 |
private System.Windows.Forms.DataGridViewTextBoxColumn Column9; |
549 | 547 |
private System.Windows.Forms.DataGridViewTextBoxColumn Column5; |
... | ... | |
554 | 552 |
private System.Windows.Forms.DataGridViewTextBoxColumn Column8; |
555 | 553 |
private System.Windows.Forms.DataGridViewTextBoxColumn Column3; |
556 | 554 |
private System.Windows.Forms.DataGridViewTextBoxColumn Column2; |
557 |
private System.Windows.Forms.RadioButton radioButton2; |
|
558 |
private System.Windows.Forms.RadioButton radioButton1; |
|
555 |
private System.Windows.Forms.DataGridViewTextBoxColumn Column11; |
|
559 | 556 |
} |
560 | 557 |
} |
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionList.resx | ||
---|---|---|
147 | 147 |
<metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
148 | 148 |
<value>True</value> |
149 | 149 |
</metadata> |
150 |
<metadata name="Column11.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> |
|
151 |
<value>True</value> |
|
152 |
</metadata> |
|
150 | 153 |
</root> |
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstractionList/FrmConstructionListAuxiliary.cs | ||
---|---|---|
93 | 93 |
CONSTMANDISPORDER, |
94 | 94 |
CONSTDEPDISPORDER, |
95 | 95 |
PRINTOUTDATE, |
96 |
ORDERNO, |
|
96 | 97 |
} |
97 | 98 |
#endregion |
98 | 99 |
|
... | ... | |
109 | 110 |
/// ?H???????N??????v???Z?X?I?????? |
110 | 111 |
/// </summary> |
111 | 112 |
/// <param name="para_ConstructionCode"></param> |
112 |
private void SubProcessExecute(int para_ConstructionCode = 0) |
|
113 |
private void SubProcessExecute(int para_ConstructionCode = 0, int para_OrderNo = 0)
|
|
113 | 114 |
{ |
114 | 115 |
IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo(); |
115 | 116 |
try |
... | ... | |
146 | 147 |
NowPoint = ClsExcute.NextProcess(m_ExecuteFlg); |
147 | 148 |
// ?I???H??????Z?b?g |
148 | 149 |
ClsExcute.ProcControlPara[NowPoint].IntExecParameter.Add(para_ConstructionCode); |
150 |
// ????????????t??????Z?b?g???? |
|
151 |
if (m_ExecuteFlg == (int)ClsExcute.ProcessExecuteNo.PurchaseOrderPrint) |
|
152 |
{ |
|
153 |
ClsExcute.ProcControlPara[NowPoint].IntExecParameter.Add(para_OrderNo); |
|
154 |
} |
|
149 | 155 |
} |
150 | 156 |
catch (Exception ex) |
151 | 157 |
{ |
... | ... | |
721 | 727 |
|
722 | 728 |
string wrkFormat = string.Empty; |
723 | 729 |
for (int i = 0; i < (s_SQLPart1.Length - 1); i++) wrkFormat += s_SQLPart1[i]; |
724 |
wrkFormat += ", TO_CHAR(A2.PRINTOUTDATE, 'YYYY/MM/DD')"; |
|
730 |
wrkFormat += ", TO_CHAR(A2.PRINTOUTDATE, 'YYYY/MM/DD'), A1.ORDERNO";
|
|
725 | 731 |
for (int i = (s_SQLPart1.Length - 1); i < s_SQLPart1.Length; i++) wrkFormat += s_SQLPart1[i]; |
726 | 732 |
for (int i = 0; i < s_SQLPart2.Length; i++) wrkFormat += s_SQLPart2[i]; |
727 | 733 |
for (int i = 0; i < s_SQLPart3.Length; i++) wrkFormat += s_SQLPart3[i]; |
... | ... | |
816 | 822 |
/// </summary> |
817 | 823 |
/// <param name="AllCount"></param> |
818 | 824 |
/// <param name="PrintCount"></param> |
819 |
private void GetPrintCount(int TargetCode, ref int AllCount, ref int PrintCount)
|
|
825 |
private void GetPrintCount(IOPurchaseOrder OrderDB, int ParentCode, int SourceCode, ref int AllCount, ref int PrintCount)
|
|
820 | 826 |
{ |
821 |
IOPurchaseOrder OrderDB = new IOPurchaseOrder(); |
|
822 | 827 |
try |
823 | 828 |
{ |
824 | 829 |
string strSQL = "SELECT * FROM"; |
825 |
strSQL += string.Format(" (SELECT COUNT(*) FROM PURCHASEORDER A1 WHERE CONSTRUCTIONCODE = {0}) A,", TargetCode); |
|
826 |
strSQL += string.Format(" (SELECT COUNT(*) FROM PURCHASEORDER B1 WHERE CONSTRUCTIONCODE = {0} AND PRINTOUTDATE != TO_DATE('0001/01/01')) B", TargetCode); |
|
830 |
strSQL += " (SELECT COUNT(*) FROM CONSTRUCTIONLEDGERDETAIL A1"; |
|
831 |
strSQL += string.Format(" WHERE A1.CONSTRUCTIONCODE = {0}", ParentCode); |
|
832 |
strSQL += string.Format(" AND A1.SOURCECODE = {0}", SourceCode); |
|
833 |
strSQL += string.Format(" AND A1.GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts); |
|
834 |
strSQL += string.Format(" AND A1.PURCHASEORDERFLG <> {0} AND A1.COMPANYCODE > 0", (int)CommonDefine.PurchaseOrderFlg.NotMakingData); |
|
835 |
|
|
836 |
strSQL += " GROUP BY A1.COMPANYCODE"; |
|
837 |
strSQL += string.Format(" HAVING SUM(A1.EXECUTIONAMOUNT) >= {0}) A,", CommonDefine.s_PrintOutPrice); |
|
838 |
|
|
839 |
strSQL += " (SELECT COUNT(*) FROM PURCHASEORDER B1"; |
|
840 |
if (ParentCode == SourceCode) |
|
841 |
{ |
|
842 |
strSQL += string.Format(" WHERE B1.CONSTRUCTIONCODE = {0}", ParentCode); |
|
843 |
} |
|
844 |
else |
|
845 |
{ |
|
846 |
strSQL += string.Format(" WHERE B1.CONSTRUCTIONCODE = {0}", SourceCode); |
|
847 |
} |
|
848 |
strSQL += string.Format(" AND B1.PRINTOUTDATE != TO_DATE('{0}')) B", DateTime.MinValue.ToShortDateString()); |
|
849 |
|
|
827 | 850 |
ArrayList arList = new ArrayList(); |
828 | 851 |
if (!OrderDB.ExecuteReader(strSQL, ref arList)) return; |
829 | 852 |
|
853 |
//if (SourceCode == 2016027801) Debug.WriteLine(""); |
|
854 |
|
|
830 | 855 |
object[] objRec = (object[])arList[0]; |
831 |
AllCount = CommonMotions.cnvInt(objRec[0]);
|
|
856 |
AllCount = arList.Count;
|
|
832 | 857 |
PrintCount = CommonMotions.cnvInt(objRec[1]); |
833 | 858 |
} |
834 | 859 |
catch (Exception ex) |
835 | 860 |
{ |
836 | 861 |
logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message); |
837 | 862 |
} |
838 |
finally |
|
839 |
{ |
|
840 |
OrderDB.close(); OrderDB = null; |
|
841 |
} |
|
842 | 863 |
} |
843 | 864 |
#endregion |
844 | 865 |
|
... | ... | |
849 | 870 |
/// <param name="arData"></param> |
850 | 871 |
private void SetToGridData(ArrayList arData) |
851 | 872 |
{ |
873 |
IOPurchaseOrder OrderDB = new IOPurchaseOrder(); |
|
852 | 874 |
try |
853 | 875 |
{ |
854 | 876 |
DataGridView dgv = dgvMaster; |
... | ... | |
863 | 885 |
string[] strConstDepName = new string[2]; |
864 | 886 |
string[] strConstName = new string[2]; |
865 | 887 |
string strStatus = string.Empty; |
888 |
string strConstrName = string.Empty; |
|
866 | 889 |
int ConstrCode = 0; |
890 |
int ParentCode = 0; |
|
891 |
int OrderNo = 0; |
|
867 | 892 |
foreach (object[] objwrk in arData) |
868 | 893 |
{ |
869 | 894 |
FlgString = string.Empty; |
870 | 895 |
ConstrCode = CommonMotions.cnvInt(objwrk[(int)GetData.CONSTRUCTIONCODE]); |
896 |
strConstrName = CommonMotions.cnvString(objwrk[(int)GetData.CONSTRUCTIONNAME]); |
|
871 | 897 |
// ?N????????????? |
898 |
if (m_ExecuteFlg == (int)ClsExcute.ProcessExecuteNo.PurchaseOrderPrint) |
|
899 |
{ |
|
900 |
OrderNo = CommonMotions.cnvInt(objwrk[(int)GetData.ORDERNO]); |
|
901 |
strConstrName += string.Format(" ?\??{0}???", OrderNo); |
|
902 |
} |
|
872 | 903 |
switch (m_ExecuteFlg) |
873 | 904 |
{ |
874 | 905 |
case (int)ClsExcute.ProcessExecuteNo.PurchaseOrderEntry: |
875 | 906 |
case (int)ClsExcute.ProcessExecuteNo.PurchaseOrderPrint: |
876 | 907 |
// ??????????E???????????t???O???g?? |
877 |
//DateTime wrkDate = CommonMotions.cnvDate(objwrk[(int)GetData.PRINTOUTDATE]);
|
|
908 |
ParentCode = ClsProcessExist.GetParentConstrCode(ConstrCode);
|
|
878 | 909 |
int AllCount = 0; |
879 |
int PrintCount=0;
|
|
880 |
GetPrintCount(ConstrCode, ref AllCount, ref PrintCount); |
|
910 |
int PrintCount = 0;
|
|
911 |
GetPrintCount(OrderDB, ParentCode, ConstrCode, ref AllCount, ref PrintCount);
|
|
881 | 912 |
if (AllCount != 0 && AllCount == PrintCount) FlgString = "??"; |
882 | 913 |
break; |
883 | 914 |
default: |
884 | 915 |
break; |
885 | 916 |
} |
886 | 917 |
|
887 |
//strStatus = string.Empty; |
|
888 | 918 |
// ?X?e?[?^?X?t???O??????1?s?J???? |
889 | 919 |
if (StatusFlg != CommonMotions.cnvInt(objwrk[(int)GetData.CONSTRUCTIONSTATUSFLG])) |
890 | 920 |
{ |
... | ... | |
893 | 923 |
if (!initFlg) dgv.Rows.Add(1); |
894 | 924 |
initFlg = false; |
895 | 925 |
} |
896 |
//strSalesDepName[1] = string.Empty; |
|
897 |
//strSalesName[1] = string.Empty; |
|
898 |
//strConstDepName[1] = string.Empty; |
|
899 |
//strConstName[1] = string.Empty; |
|
900 | 926 |
|
901 | 927 |
if (!CommonMotions.cnvString(objwrk[(int)GetData.SALESDEPNAME]).Equals(strSalesDepName[0])) |
902 | 928 |
{ |
... | ... | |
924 | 950 |
, strSalesName[1] |
925 | 951 |
, strConstDepName[1] |
926 | 952 |
, strConstName[1] |
927 |
, CommonMotions.cnvString(objwrk[(int)GetData.CONSTRUCTIONNAME])
|
|
953 |
, strConstrName
|
|
928 | 954 |
, strStatus |
929 | 955 |
, FlgString |
930 | 956 |
, CommonMotions.cnvInt(objwrk[(int)GetData.CONSTRUCTIONPERIOD]) |
931 | 957 |
, CommonMotions.cnvStringCodeFromInt(ConstrCode, "-", 8) |
958 |
, OrderNo |
|
932 | 959 |
); |
933 | 960 |
|
934 | 961 |
} |
... | ... | |
937 | 964 |
{ |
938 | 965 |
logger.ErrorFormat("?V?X?e???G???[?F{0}?F{1}", CommonMotions.GetMethodName(), ex.Message); |
939 | 966 |
} |
967 |
finally |
|
968 |
{ |
|
969 |
OrderDB.close(); OrderDB = null; |
|
970 |
} |
|
940 | 971 |
} |
941 | 972 |
#endregion |
942 | 973 |
|
... | ... | |
1082 | 1113 |
// ?f?[?^???????{?^????\?? |
1083 | 1114 |
if (!m_DataAddtionButton) |
1084 | 1115 |
{ |
1085 |
btnDataSelect.Left = btnDataEntry.Left; |
|
1086 | 1116 |
btnDataEntry.Visible = false; |
1087 | 1117 |
} |
1088 | 1118 |
|
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBudget/FrmConstructionBudgetAuxiliary.cs | ||
---|---|---|
4788 | 4788 |
/// <summary> |
4789 | 4789 |
/// 経費再計算 |
4790 | 4790 |
/// </summary> |
4791 |
private void CalcExpenese() |
|
4792 |
{ |
|
4793 |
IOConstructionLedger LedgerDB = new IOConstructionLedger(); |
|
4794 |
IOConstructionLedgerDetail LedgerDDB = new IOConstructionLedgerDetail(); |
|
4795 |
IOConstructionLedgerExcute LedgerEDB = new IOConstructionLedgerExcute(); |
|
4796 |
FrmConstructionLedger frm = new FrmConstructionLedger(); |
|
4791 |
//private void CalcExpenese()
|
|
4792 |
//{
|
|
4793 |
//IOConstructionLedger LedgerDB = new IOConstructionLedger();
|
|
4794 |
//IOConstructionLedgerDetail LedgerDDB = new IOConstructionLedgerDetail();
|
|
4795 |
//IOConstructionLedgerExcute LedgerEDB = new IOConstructionLedgerExcute();
|
|
4796 |
//FrmConstructionLedger frm = new FrmConstructionLedger();
|
|
4797 | 4797 |
|
4798 |
try |
|
4799 |
{ |
|
4800 |
LedgerDB.connect(); LedgerDB.beginTran(); |
|
4801 |
LedgerDDB.connect();LedgerDDB.beginTran(); |
|
4802 |
LedgerEDB.connect(); LedgerEDB.beginTran(); |
|
4798 |
//try
|
|
4799 |
//{
|
|
4800 |
// LedgerDB.connect(); LedgerDB.beginTran();
|
|
4801 |
// LedgerDDB.connect();LedgerDDB.beginTran();
|
|
4802 |
// LedgerEDB.connect(); LedgerEDB.beginTran();
|
|
4803 | 4803 |
|
4804 |
// 経費率のセット |
|
4805 |
string strSQL1 = "SELECT A.CONSTRUCTIONCODE, E.DETAILSTRING, F.DEPARTMENTSTRING, A.LINECOUNT, A.FIRSTSTRING"; |
|
4806 |
strSQL1 += ", A.EXECUTIONAMOUNT, A.AMOUNTCONFIGRATE, B.CONSTRUCTIONPERIOD, C.DEPARTMENTCODE, D.NAMECODE"; |
|
4807 |
strSQL1 += ", D.EXPENSESRATIO, ROUND(B.ORDERSDECISIONPRICE * (A.AMOUNTCONFIGRATE / 100.0)), G.NAMESTRING"; |
|
4808 |
strSQL1 += " FROM CONSTRUCTIONLEDGERDETAIL A, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER C, DEPARTMENTEXPENSESMASTER D, CONSTRUCTIONBASEINFODETAIL E, DEPARTMENTMASTER F, DIVISIONMASTER G"; |
|
4809 |
strSQL1 += " WHERE A.CONSTRUCTIONCODE <> 2015043401"; |
|
4810 |
strSQL1 += " AND A.GROUPCOUNT = 1"; |
|
4811 |
strSQL1 += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE"; |
|
4812 |
strSQL1 += " AND B.CONSTRUCTIONPERIOD = 16"; |
|
4813 |
strSQL1 += " AND B.CONSTRUCTIONPERSONCODE = C.PERSONCODE"; |
|
4814 |
strSQL1 += " AND (C.DEPARTMENTCODE = D.DEPARTMENTCODE AND B.CONSTRUCTIONPERIOD = D.EXPENSESPERIOD AND D.DISPLAYORDER = (A.LINECOUNT - 1))"; |
|
4815 |
strSQL1 += " AND E.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE AND E.DETAILNO = 2"; |
|
4816 |
strSQL1 += " AND F.DEPARTMENTCODE = C.DEPARTMENTCODE"; |
|
4817 |
strSQL1 += " AND G.DIVISIONCODE = 3"; |
|
4818 |
strSQL1 += " AND G.NAMECODE = D.NAMECODE"; |
|
4819 |
strSQL1 += " ORDER BY A.CONSTRUCTIONCODE, A.LINECOUNT"; |
|
4820 |
ArrayList arList = new ArrayList(); |
|
4821 |
if (!LedgerDB.ExecuteReader(strSQL1, ref arList, false)) return; |
|
4822 |
foreach (object[] CurRec in arList) |
|
4823 |
{ |
|
4824 |
int CurConstrCode = CommonMotions.cnvInt(CurRec[(int)Read1Enum.CONSTRUCTIONCODE]); |
|
4825 |
int CurLineCnt = CommonMotions.cnvInt(CurRec[(int)Read1Enum.LINECOUNT]); |
|
4826 |
int CurCompnentCode = CommonMotions.cnvInt(CurRec[(int)Read1Enum.NAMECODE]); |
|
4827 |
double CurParcent = CommonMotions.cnvDouble(CurRec[(int)Read1Enum.EXPENSESRATIO]); |
|
4828 |
int CurValue = CommonMotions.cnvInt(CurRec[(int)Read1Enum.EXPENESE]); |
|
4829 |
string strValue = CommonMotions.cnvString(CurRec[(int)Read1Enum.EXPENESENAME]) + string.Format("({0}%)", CurParcent.ToString("0.00")); |
|
4830 |
// 項目名 |
|
4831 |
if (!LedgerDDB.UpdateFeild(CurConstrCode, (int)IOConstructionLedgerDetail.DataColumn.FirstString, strValue, 1, CurLineCnt, false)) |
|
4832 |
{ |
|
4833 |
LedgerDDB.rollback(); |
|
4834 |
return; |
|
4835 |
} |
|
4836 |
// 実行金額 |
|
4837 |
if (!LedgerDDB.UpdateFeild(CurConstrCode, (int)IOConstructionLedgerDetail.DataColumn.ExecutionAmount, CurValue, 1, CurLineCnt, false)) |
|
4838 |
{ |
|
4839 |
LedgerDDB.rollback(); |
|
4840 |
return; |
|
4841 |
} |
|
4842 |
// 経費率セット |
|
4843 |
if (!LedgerDDB.UpdateFeild(CurConstrCode, (int)IOConstructionLedgerDetail.DataColumn.AmountConfigRate, CurParcent, 1, CurLineCnt, false)) |
|
4844 |
{ |
|
4845 |
LedgerDDB.rollback(); |
|
4846 |
return; |
|
4847 |
} |
|
4848 |
// 経費コード |
|
4849 |
if (!LedgerDDB.UpdateFeild(CurConstrCode, (int)IOConstructionLedgerDetail.DataColumn.ComponentCode, CurCompnentCode, 1, CurLineCnt, false)) |
|
4850 |
{ |
|
4851 |
LedgerDDB.rollback(); |
|
4852 |
return; |
|
4853 |
} |
|
4854 |
} |
|
4804 |
// // 経費率のセット
|
|
4805 |
// string strSQL1 = "SELECT A.CONSTRUCTIONCODE, E.DETAILSTRING, F.DEPARTMENTSTRING, A.LINECOUNT, A.FIRSTSTRING";
|
|
4806 |
// strSQL1 += ", A.EXECUTIONAMOUNT, A.AMOUNTCONFIGRATE, B.CONSTRUCTIONPERIOD, C.DEPARTMENTCODE, D.NAMECODE";
|
|
4807 |
// strSQL1 += ", D.EXPENSESRATIO, ROUND(B.ORDERSDECISIONPRICE * (A.AMOUNTCONFIGRATE / 100.0)), G.NAMESTRING";
|
|
4808 |
// strSQL1 += " FROM CONSTRUCTIONLEDGERDETAIL A, CONSTRUCTIONBASEINFO B, PERSONINCHARGEMASTER C, DEPARTMENTEXPENSESMASTER D, CONSTRUCTIONBASEINFODETAIL E, DEPARTMENTMASTER F, DIVISIONMASTER G";
|
|
4809 |
// strSQL1 += " WHERE A.CONSTRUCTIONCODE <> 2015043401";
|
|
4810 |
// strSQL1 += " AND A.GROUPCOUNT = 1";
|
|
4811 |
// strSQL1 += " AND A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
|
|
4812 |
// strSQL1 += " AND B.CONSTRUCTIONPERIOD = 16";
|
|
4813 |
// strSQL1 += " AND B.CONSTRUCTIONPERSONCODE = C.PERSONCODE";
|
|
4814 |
// strSQL1 += " AND (C.DEPARTMENTCODE = D.DEPARTMENTCODE AND B.CONSTRUCTIONPERIOD = D.EXPENSESPERIOD AND D.DISPLAYORDER = (A.LINECOUNT - 1))";
|
|
4815 |
// strSQL1 += " AND E.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE AND E.DETAILNO = 2";
|
|
4816 |
// strSQL1 += " AND F.DEPARTMENTCODE = C.DEPARTMENTCODE";
|
|
4817 |
// strSQL1 += " AND G.DIVISIONCODE = 3";
|
|
4818 |
// strSQL1 += " AND G.NAMECODE = D.NAMECODE";
|
|
4819 |
// strSQL1 += " ORDER BY A.CONSTRUCTIONCODE, A.LINECOUNT";
|
|
4820 |
// ArrayList arList = new ArrayList();
|
|
4821 |
// if (!LedgerDB.ExecuteReader(strSQL1, ref arList, false)) return;
|
|
4822 |
// foreach (object[] CurRec in arList)
|
|
4823 |
// {
|
|
4824 |
// int CurConstrCode = CommonMotions.cnvInt(CurRec[(int)Read1Enum.CONSTRUCTIONCODE]);
|
|
4825 |
// int CurLineCnt = CommonMotions.cnvInt(CurRec[(int)Read1Enum.LINECOUNT]);
|
|
4826 |
// int CurCompnentCode = CommonMotions.cnvInt(CurRec[(int)Read1Enum.NAMECODE]);
|
|
4827 |
// double CurParcent = CommonMotions.cnvDouble(CurRec[(int)Read1Enum.EXPENSESRATIO]);
|
|
4828 |
// int CurValue = CommonMotions.cnvInt(CurRec[(int)Read1Enum.EXPENESE]);
|
|
4829 |
// string strValue = CommonMotions.cnvString(CurRec[(int)Read1Enum.EXPENESENAME]) + string.Format("({0}%)", CurParcent.ToString("0.00"));
|
|
4830 |
// // 項目名
|
|
4831 |
// if (!LedgerDDB.UpdateFeild(CurConstrCode, (int)IOConstructionLedgerDetail.DataColumn.FirstString, strValue, 1, CurLineCnt, false))
|
|
4832 |
// {
|
|
4833 |
// LedgerDDB.rollback();
|
|
4834 |
// return;
|
|
4835 |
// }
|
|
4836 |
// // 実行金額
|
|
4837 |
// if (!LedgerDDB.UpdateFeild(CurConstrCode, (int)IOConstructionLedgerDetail.DataColumn.ExecutionAmount, CurValue, 1, CurLineCnt, false))
|
|
4838 |
// {
|
|
4839 |
// LedgerDDB.rollback();
|
|
4840 |
// return;
|
|
4841 |
// }
|
|
4842 |
// // 経費率セット
|
|
4843 |
// if (!LedgerDDB.UpdateFeild(CurConstrCode, (int)IOConstructionLedgerDetail.DataColumn.AmountConfigRate, CurParcent, 1, CurLineCnt, false))
|
|
4844 |
// {
|
|
4845 |
// LedgerDDB.rollback();
|
|
4846 |
// return;
|
|
4847 |
// }
|
|
4848 |
// // 経費コード
|
|
4849 |
// if (!LedgerDDB.UpdateFeild(CurConstrCode, (int)IOConstructionLedgerDetail.DataColumn.ComponentCode, CurCompnentCode, 1, CurLineCnt, false))
|
|
4850 |
// {
|
|
4851 |
// LedgerDDB.rollback();
|
|
4852 |
// return;
|
|
4853 |
// }
|
|
4854 |
// }
|
|
4855 | 4855 |
|
4856 |
string strSQL2 = "SELECT A.CONSTRUCTIONCODE, A.TYINGFLG, B.CONSTRUCTIONCODE, B.LINECOUNT, B.DataCnt,"; |
|
4857 |
strSQL2 += " C.CONSTRUCTIONCODE, C.GROUPCOUNT, C.LINECOUNT, C.COLUMNCOUNT,"; |
|
4858 |
strSQL2 += " ROUND(A.ORDERSDECISIONPRICE * (D.AMOUNTCONFIGRATE / 100.0))"; |
|
4859 |
strSQL2 += " FROM CONSTRUCTIONBASEINFO A,"; |
|
4860 |
strSQL2 += " (SELECT CONSTRUCTIONCODE, LINECOUNT, COUNT(*) DataCnt FROM CONSTRUCTIONLEDGEREXCUTE WHERE GROUPCOUNT = 1 GROUP BY CONSTRUCTIONCODE, LINECOUNT) B,"; |
|
4861 |
strSQL2 += " CONSTRUCTIONLEDGEREXCUTE C,"; |
|
4862 |
strSQL2 += " CONSTRUCTIONLEDGERDETAIL D"; |
|
4863 |
strSQL2 += " WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE"; |
|
4864 |
strSQL2 += " AND A.CONSTRUCTIONCODE <> 2015043401"; |
|
4865 |
strSQL2 += " AND B.DataCnt = 1"; |
|
4866 |
strSQL2 += " AND C.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE"; |
|
4867 |
strSQL2 += " AND C.GROUPCOUNT = 1"; |
|
4868 |
strSQL2 += " AND C.LINECOUNT = B.LINECOUNT"; |
|
4869 |
strSQL2 += " AND D.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE"; |
|
4870 |
strSQL2 += " AND D.GROUPCOUNT = C.GROUPCOUNT"; |
|
4871 |
strSQL2 += " AND D.LINECOUNT = C.LINECOUNT"; |
|
4872 |
strSQL2 += " ORDER BY C.CONSTRUCTIONCODE, C.GROUPCOUNT, C.LINECOUNT, C.COLUMNCOUNT"; |
|
4873 |
ArrayList arList2 = new ArrayList(); |
|
4874 |
if (!LedgerEDB.ExecuteReader(strSQL2, ref arList2, false)) |
|
4875 |
{ |
|
4876 |
LedgerDDB.rollback(); |
|
4877 |
return; |
|
4878 |
} |
|
4879 |
foreach (object[] CurRec in arList2) |
|
4880 |
{ |
|
4881 |
int CONSTRUCTIONCODE = CommonMotions.cnvInt(CurRec[0]); |
|
4882 |
int TYINGFLG = CommonMotions.cnvInt(CurRec[1]); |
|
4883 |
int CONSTRUCTIONCODE2 = CommonMotions.cnvInt(CurRec[2]); |
|
4884 |
int LINECOUNT = CommonMotions.cnvInt(CurRec[3]); |
|
4885 |
int DataCnt = CommonMotions.cnvInt(CurRec[4]); |
|
4886 |
int CONSTRUCTIONCODE3 = CommonMotions.cnvInt(CurRec[5]); |
|
4887 |
int GROUPCOUNT = CommonMotions.cnvInt(CurRec[6]); |
|
4888 |
int LINECOUNT2 = CommonMotions.cnvInt(CurRec[7]); |
|
4889 |
int COLUMNCOUNT = CommonMotions.cnvInt(CurRec[8]); |
|
4890 |
int iValue =CommonMotions.cnvInt(CurRec[9]); |
|
4856 |
// string strSQL2 = "SELECT A.CONSTRUCTIONCODE, A.TYINGFLG, B.CONSTRUCTIONCODE, B.LINECOUNT, B.DataCnt,";
|
|
4857 |
// strSQL2 += " C.CONSTRUCTIONCODE, C.GROUPCOUNT, C.LINECOUNT, C.COLUMNCOUNT,";
|
|
4858 |
// strSQL2 += " ROUND(A.ORDERSDECISIONPRICE * (D.AMOUNTCONFIGRATE / 100.0))";
|
|
4859 |
// strSQL2 += " FROM CONSTRUCTIONBASEINFO A,";
|
|
4860 |
// strSQL2 += " (SELECT CONSTRUCTIONCODE, LINECOUNT, COUNT(*) DataCnt FROM CONSTRUCTIONLEDGEREXCUTE WHERE GROUPCOUNT = 1 GROUP BY CONSTRUCTIONCODE, LINECOUNT) B,";
|
|
4861 |
// strSQL2 += " CONSTRUCTIONLEDGEREXCUTE C,";
|
|
4862 |
// strSQL2 += " CONSTRUCTIONLEDGERDETAIL D";
|
|
4863 |
// strSQL2 += " WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
|
|
4864 |
// strSQL2 += " AND A.CONSTRUCTIONCODE <> 2015043401";
|
|
4865 |
// strSQL2 += " AND B.DataCnt = 1";
|
|
4866 |
// strSQL2 += " AND C.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
|
|
4867 |
// strSQL2 += " AND C.GROUPCOUNT = 1";
|
|
4868 |
// strSQL2 += " AND C.LINECOUNT = B.LINECOUNT";
|
|
4869 |
// strSQL2 += " AND D.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE";
|
|
4870 |
// strSQL2 += " AND D.GROUPCOUNT = C.GROUPCOUNT";
|
|
4871 |
// strSQL2 += " AND D.LINECOUNT = C.LINECOUNT";
|
|
4872 |
// strSQL2 += " ORDER BY C.CONSTRUCTIONCODE, C.GROUPCOUNT, C.LINECOUNT, C.COLUMNCOUNT";
|
|
4873 |
// ArrayList arList2 = new ArrayList();
|
|
4874 |
// if (!LedgerEDB.ExecuteReader(strSQL2, ref arList2, false))
|
|
4875 |
// {
|
|
4876 |
// LedgerDDB.rollback();
|
|
4877 |
// return;
|
|
4878 |
// }
|
|
4879 |
// foreach (object[] CurRec in arList2)
|
|
4880 |
// {
|
|
4881 |
// int CONSTRUCTIONCODE = CommonMotions.cnvInt(CurRec[0]);
|
|
4882 |
// int TYINGFLG = CommonMotions.cnvInt(CurRec[1]);
|
|
4883 |
// int CONSTRUCTIONCODE2 = CommonMotions.cnvInt(CurRec[2]);
|
|
4884 |
// int LINECOUNT = CommonMotions.cnvInt(CurRec[3]);
|
|
4885 |
// int DataCnt = CommonMotions.cnvInt(CurRec[4]);
|
|
4886 |
// int CONSTRUCTIONCODE3 = CommonMotions.cnvInt(CurRec[5]);
|
|
4887 |
// int GROUPCOUNT = CommonMotions.cnvInt(CurRec[6]);
|
|
4888 |
// int LINECOUNT2 = CommonMotions.cnvInt(CurRec[7]);
|
|
4889 |
// int COLUMNCOUNT = CommonMotions.cnvInt(CurRec[8]);
|
|
4890 |
// int iValue =CommonMotions.cnvInt(CurRec[9]);
|
|
4891 | 4891 |
|
4892 |
if (!LedgerEDB.UpdateFeild(CONSTRUCTIONCODE3, GROUPCOUNT, LINECOUNT2, COLUMNCOUNT, (int)IOConstructionLedgerExcute.TableColumn.PaymentAmount, iValue, false)) |
|
4893 |
{ |
|
4894 |
LedgerDDB.rollback(); |
|
4895 |
return; |
|
4896 |
} |
|
4897 |
} |
|
4892 |
// if (!LedgerEDB.UpdateFeild(CONSTRUCTIONCODE3, GROUPCOUNT, LINECOUNT2, COLUMNCOUNT, (int)IOConstructionLedgerExcute.TableColumn.PaymentAmount, iValue, false))
|
|
4893 |
// {
|
|
4894 |
// LedgerDDB.rollback();
|
|
4895 |
// return;
|
|
4896 |
// }
|
|
4897 |
// }
|
|
4898 | 4898 |
|
4899 |
LedgerDB.commit(); |
|
4900 |
LedgerDDB.commit(); |
|
4901 |
LedgerEDB.commit(); |
|
4899 |
// LedgerDB.commit();
|
|
4900 |
// LedgerDDB.commit();
|
|
4901 |
// LedgerEDB.commit();
|
|
4902 | 4902 |
|
4903 |
string strSQL3 = "SELECT A.CONSTRUCTIONCODE FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFO B"; |
|
4904 |
strSQL3 += " WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE"; |
|
4905 |
strSQL3 += " AND B.CONSTRUCTIONPERIOD = 16"; |
|
4906 |
strSQL3 += " ORDER BY A.CONSTRUCTIONCODE"; |
|
4907 |
ArrayList arList3 = new ArrayList(); |
|
4908 |
if (!LedgerDB.ExecuteReader(strSQL3, ref arList3)) return; |
|
4909 |
foreach (object[] CurRec in arList3) |
|
4910 |
{ |
|
4911 |
// 工事コードのセット |
|
4912 |
frm.ConstructionCode = CommonMotions.cnvInt(CurRec[0]); |
|
4903 |
// string strSQL3 = "SELECT A.CONSTRUCTIONCODE FROM CONSTRUCTIONLEDGER A, CONSTRUCTIONBASEINFO B";
|
|
4904 |
// strSQL3 += " WHERE A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
|
|
4905 |
// strSQL3 += " AND B.CONSTRUCTIONPERIOD = 16";
|
|
4906 |
// strSQL3 += " ORDER BY A.CONSTRUCTIONCODE";
|
|
4907 |
// ArrayList arList3 = new ArrayList();
|
|
4908 |
// if (!LedgerDB.ExecuteReader(strSQL3, ref arList3)) return;
|
|
4909 |
// foreach (object[] CurRec in arList3)
|
|
4910 |
// {
|
|
4911 |
// // 工事コードのセット
|
|
4912 |
// frm.ConstructionCode = CommonMotions.cnvInt(CurRec[0]);
|
|
4913 | 4913 |
|
4914 |
// 見えない画面を出す |
|
4915 |
frm.Hide(); |
|
4916 |
// フォーム非表示 |
|
4917 |
//frm.Visible = false; |
|
4914 |
// // 見えない画面を出す
|
|
4915 |
// frm.Hide();
|
|
4916 |
// // フォーム非表示
|
|
4917 |
// //frm.Visible = false;
|
|
4918 | 4918 |
|
4919 |
// 再計算処理 |
|
4920 |
if (!frm.RecalculateLedger) break; |
|
4921 |
} |
|
4922 |
// 画面を閉じる |
|
4923 |
frm.Close(); |
|
4924 |
} |
|
4925 |
catch (Exception ex) |
|
4926 |
{ |
|
4927 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
4928 |
} |
|
4929 |
finally |
|
4930 |
{ |
|
4931 |
LedgerDB.close(); LedgerDB = null; |
|
4932 |
LedgerDDB.close(); LedgerDDB = null; |
|
4933 |
LedgerEDB.close(); LedgerEDB = null; |
|
4919 |
// // 再計算処理
|
|
4920 |
// if (!frm.RecalculateLedger) break;
|
|
4921 |
// }
|
|
4922 |
// // 画面を閉じる
|
|
4923 |
// frm.Close();
|
|
4924 |
//}
|
|
4925 |
//catch (Exception ex)
|
|
4926 |
//{
|
|
4927 |
// logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
|
|
4928 |
//}
|
|
4929 |
//finally
|
|
4930 |
//{
|
|
4931 |
// LedgerDB.close(); LedgerDB = null;
|
|
4932 |
// LedgerDDB.close(); LedgerDDB = null;
|
|
4933 |
// LedgerEDB.close(); LedgerEDB = null;
|
|
4934 | 4934 |
|
4935 |
frm.Dispose(); frm = null; |
|
4936 |
} |
|
4937 |
} |
|
4935 |
// frm.Dispose(); frm = null;
|
|
4936 |
//}
|
|
4937 |
//}
|
|
4938 | 4938 |
#endregion |
4939 | 4939 |
|
4940 | 4940 |
#region 未作成データ行作成処理 |
trunk/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoinAuxiliary.cs | ||
---|---|---|
895 | 895 |
IOConstructionLedger LedgerDB = new IOConstructionLedger(); |
896 | 896 |
IOConstructionLedgerDetail LedgerDDB = new IOConstructionLedgerDetail(); |
897 | 897 |
IOConstructionLedgerExcute ExcuteDB = new IOConstructionLedgerExcute(); |
898 |
IOCostDataOfPerson CostDataDB = new IOCostDataOfPerson(); |
|
898 | 899 |
|
899 | 900 |
IODailyDataConstruction DailyData1 = new IODailyDataConstruction(); |
900 | 901 |
IODailyDataDetail DailyData2 = new IODailyDataDetail(); |
... | ... | |
911 | 912 |
LedgerDB.connect(); LedgerDB.beginTran(); |
912 | 913 |
LedgerDDB.connect(); LedgerDDB.beginTran(); |
913 | 914 |
ExcuteDB.connect(); ExcuteDB.beginTran(); |
915 |
CostDataDB.connect(); CostDataDB.beginTran(); |
|
914 | 916 |
|
915 | 917 |
DailyData1.connect(); DailyData1.beginTran(); |
916 | 918 |
DailyData2.connect(); DailyData2.beginTran(); |
... | ... | |
966 | 968 |
JoinRollBackDataProc(BaseDB, DetailDB, LinkDB, LedgerDB, LedgerDDB, ExcuteDB, DateCodeList, m_ConstructionCode); |
967 | 969 |
return false; |
968 | 970 |
} |
969 |
|
|
970 |
// 日報結合 |
|
971 |
if (!JoiningDairyData(LinkDB, DailyData1, DailyData2, DailyData3, DailyData4, DailyData5, DailyData6)) |
|
972 |
{ |
|
973 |
MessageBox.Show("工事日報結合処理に失敗しました。", "日報結語エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
974 |
|
|
975 |
// エラー時工事情報を削除する |
|
976 |
JoinRollBackDataProc(BaseDB, DetailDB, LinkDB, LedgerDB, LedgerDDB, ExcuteDB, DateCodeList, m_ConstructionCode); |
|
977 |
ClsChangeLedgerData.PseudoRollBackForBudgetData(m_ConstructionCode, DateCodeList); |
|
978 |
return false; |
|
979 |
} |
|
980 | 971 |
} |
981 | 972 |
else |
982 | 973 |
{ // ----- 結合工事追加 |
... | ... | |
1013 | 1004 |
JoinRollBackDataProc(BaseDB, DetailDB, LinkDB, LedgerDB, LedgerDDB, ExcuteDB, DateCodeList, m_ConstructionCode); |
1014 | 1005 |
return false; |
1015 | 1006 |
} |
1007 |
} |
|
1016 | 1008 |
|
1017 |
// 日報結合 |
|
1018 |
if (!JoiningDairyData(LinkDB, DailyData1, DailyData2, DailyData3, DailyData4, DailyData5, DailyData6)) |
|
1019 |
{ |
|
1020 |
MessageBox.Show("工事日報結合処理に失敗しました。", "日報結語エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
1009 |
// |
|
1010 |
// 日報結合 |
|
1011 |
if (!JoiningDairyData(DateCodeList, DailyData1, DailyData2, DailyData3, DailyData4, DailyData5, DailyData6)) |
|
1012 |
{ |
|
1013 |
MessageBox.Show("工事日報結合処理に失敗しました。", "日報結合エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
1021 | 1014 |
|
1022 |
ClsChangeLedgerData.PseudoRollBackForBudgetData(m_ConstructionCode, DateCodeList); |
|
1015 |
// エラー時工事情報を削除する |
|
1016 |
JoinRollBackDataProc(BaseDB, DetailDB, LinkDB, LedgerDB, LedgerDDB, ExcuteDB, DateCodeList, m_ConstructionCode); |
|
1017 |
ClsChangeLedgerData.PseudoRollBackForBudgetData(m_ConstructionCode, DateCodeList); |
|
1023 | 1018 |
|
1024 |
// エラー時工事情報を削除する |
|
1025 |
JoinRollBackDataProc(BaseDB, DetailDB, LinkDB, LedgerDB, LedgerDDB, ExcuteDB, DateCodeList, m_ConstructionCode); |
|
1019 |
return false; |
|
1020 |
} |
|
1021 |
// 購入品結合 |
|
1022 |
if (!JoinCostData(DateCodeList, CostDataDB)) |
|
1023 |
{ |
|
1024 |
MessageBox.Show("交通費・購入品結合処理に失敗しました。", "交通費・購入品結合エラー", MessageBoxButtons.OK, MessageBoxIcon.Error); |
|
1026 | 1025 |
|
1027 |
return false; |
|
1028 |
} |
|
1026 |
// エラー時工事情報を削除する |
|
1027 |
JoinRollBackDataProc(BaseDB, DetailDB, LinkDB, LedgerDB, LedgerDDB, ExcuteDB, DateCodeList, m_ConstructionCode); |
|
1028 |
ClsChangeLedgerData.PseudoRollBackForBudgetData(m_ConstructionCode, DateCodeList); |
|
1029 |
DailyData1.rollback(); DailyData2.rollback(); DailyData3.rollback(); DailyData4.rollback(); DailyData5.rollback(); DailyData6.rollback(); |
|
1030 |
return false; |
|
1029 | 1031 |
} |
1030 |
string strRemove = string.Empty; |
|
1031 | 1032 |
|
1032 | 1033 |
return true; |
1033 | 1034 |
} |
... | ... | |
1044 | 1045 |
LedgerDB.commit(); |
1045 | 1046 |
LedgerDDB.commit(); |
1046 | 1047 |
ExcuteDB.commit(); |
1048 |
CostDataDB.commit(); |
|
1047 | 1049 |
|
1048 | 1050 |
DailyData1.commit(); |
1049 | 1051 |
DailyData2.commit(); |
... | ... | |
1058 | 1060 |
LedgerDB.close(); LedgerDB = null; |
1059 | 1061 |
LedgerDDB.close(); LedgerDDB = null; |
1060 | 1062 |
ExcuteDB.close(); ExcuteDB = null; |
1063 |
CostDataDB.close(); CostDataDB = null; |
|
1061 | 1064 |
|
1062 | 1065 |
DailyData1.close(); DailyData1 = null; |
1063 | 1066 |
DailyData2.close(); DailyData2 = null; |
... | ... | |
1426 | 1429 |
/// 日報結合 |
1427 | 1430 |
/// </summary> |
1428 | 1431 |
/// <returns></returns> |
他の形式にエクスポート: Unified diff