プロジェクト

全般

プロフィール

リビジョン 369

堀内6年以上前に追加

請求入力・請求書印刷修正
請求書取消理由入力追加
請求入力enum名称変更
承認ボタン処理統一修正中

差分を表示:

branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
14 14
        /// <summary>
15 15
        /// 本体バージョン
16 16
        /// </summary>
17
        public static int s_SystemVersion = 227;
17
        public static int s_SystemVersion = 228;
18 18

  
19 19
        /// <summary>
20 20
        /// コピー・環境バージョン
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsChangeBaseInfoData.cs
153 153
                DB25.beginTran(); DB26.beginTran(); DB27.beginTran(); DB28.beginTran(); DB29.beginTran();
154 154

  
155 155
                bool ProcSuccess = true;
156
                string strRemove = string.Empty;
157
                string strRemove2 = string.Empty;
156
                StringBuilder strRemove = new StringBuilder();
157
                StringBuilder strRemove2 = new StringBuilder();
158
                StringBuilder strSQL = new StringBuilder();
158 159
                for (int i = 0; i < RemoveList.Count; i++)
159 160
                {
160
                    strRemove = DB01.CreatePrimarykeyString(RemoveList[i]);
161
                    if (!DB01.DeleteAction(strRemove, false)) { ProcSuccess = false; break; }
162
                    if (!DB02.DeleteAction(strRemove, false)) { ProcSuccess = false; break; }
161
                    strRemove.Clear();
162
                    strRemove.Append(DB01.CreatePrimarykeyString(RemoveList[i]));
163
                    if (!DB01.DeleteAction(strRemove.ToString(), false)) { ProcSuccess = false; break; }
164
                    if (!DB02.DeleteAction(strRemove.ToString(), false)) { ProcSuccess = false; break; }
163 165

  
164
                    DB04.DeleteAction(strRemove, false);
165
                    DB05.DeleteAction(strRemove, false);
166
                    DB06.DeleteAction(strRemove, false);
167
                    DB07.DeleteAction(strRemove, false);
168
                    DB08.DeleteAction(strRemove, false);
169
                    DB09.DeleteAction(strRemove, false);
170
                    DB10.DeleteAction(strRemove, false);
171
                    DB11.DeleteAction(strRemove, false);
172
                    DB12.DeleteAction(strRemove, false);
173
                    DB13.DeleteAction(strRemove, false);
174
                    DB14.DeleteAction(strRemove, false);
175
                    DB15.DeleteAction(strRemove, false);
176
                    DB16.DeleteAction(strRemove, false);
177
                    DB17.DeleteAction(strRemove, false);
178
                    DB18.DeleteAction(strRemove, false);
179
                    DB19.DeleteAction(strRemove, false);
180
                    DB20.DeleteAction(strRemove, false);
181
                    DB21.DeleteAction(strRemove, false);
182
                    DB22.DeleteAction(strRemove, false);
183
                    DB23.DeleteAction(strRemove, false);
184
                    DB24.DeleteAction(strRemove, false);
185
                    DB25.DeleteAction(strRemove, false);
186
                    DB26.DeleteAction(strRemove, false);
187
                    DB27.DeleteAction(strRemove, false);
188
                    DB28.DeleteAction(strRemove, false);
189
                    DB29.DeleteAction(strRemove, false);
166
                    DB04.DeleteAction(strRemove.ToString(), false);
167
                    DB05.DeleteAction(strRemove.ToString(), false);
168
                    DB06.DeleteAction(strRemove.ToString(), false);
169
                    DB07.DeleteAction(strRemove.ToString(), false);
170
                    DB08.DeleteAction(strRemove.ToString(), false);
171
                    DB09.DeleteAction(strRemove.ToString(), false);
172
                    DB10.DeleteAction(strRemove.ToString(), false);
173
                    DB11.DeleteAction(strRemove.ToString(), false);
174
                    DB12.DeleteAction(strRemove.ToString(), false);
175
                    DB13.DeleteAction(strRemove.ToString(), false);
176
                    DB14.DeleteAction(strRemove.ToString(), false);
177
                    DB15.DeleteAction(strRemove.ToString(), false);
178
                    DB16.DeleteAction(strRemove.ToString(), false);
179
                    DB17.DeleteAction(strRemove.ToString(), false);
180
                    DB18.DeleteAction(strRemove.ToString(), false);
181
                    DB19.DeleteAction(strRemove.ToString(), false);
182
                    DB20.DeleteAction(strRemove.ToString(), false);
183
                    DB21.DeleteAction(strRemove.ToString(), false);
184
                    DB22.DeleteAction(strRemove.ToString(), false);
185
                    DB23.DeleteAction(strRemove.ToString(), false);
186
                    DB24.DeleteAction(strRemove.ToString(), false);
187
                    DB25.DeleteAction(strRemove.ToString(), false);
188
                    DB26.DeleteAction(strRemove.ToString(), false);
189
                    DB27.DeleteAction(strRemove.ToString(), false);
190
                    DB28.DeleteAction(strRemove.ToString(), false);
191
                    DB29.DeleteAction(strRemove.ToString(), false);
190 192

  
191 193
                    if (BaseRec.JoinFlg == (int)ConstructionBaseInfo.JoinFlgDef.JoinParent
192 194
                        || BaseRec.TyingFlg == (int)ConstructionBaseInfo.TyingFlgDef.Parent)
193 195
                    {
194
                        DB03.DeleteAction(strRemove, false);
196
                        DB03.DeleteAction(strRemove.ToString(), false);
195 197
                    }
196 198
                    else if (BaseRec.TyingFlg == (int)ConstructionBaseInfo.TyingFlgDef.Tying)
197 199
                    {
198
                        strRemove2 = string.Format(" Where FluctuationCode = {0}", RemoveList[i]);
199
                        strRemove2 += string.Format(" AND LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.FluctuationType);
200
                        DB03.DeleteAction(strRemove2, false);
200
                        strRemove2.Clear();
201
                        strRemove2.AppendFormat(" Where FluctuationCode = {0}", RemoveList[i]);
202
                        strRemove2.AppendFormat(" AND LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.FluctuationType);
203
                        DB03.DeleteAction(strRemove2.ToString(), false);
201 204
                    }
202 205
                    else if (BaseRec.JoinFlg == (int)ConstructionBaseInfo.JoinFlgDef.JoinChildren)
203 206
                    {
......
225 228
                    // 結合工事親確認
226 229
                    if (BaseRec.JoinFlg == (int)ConstructionBaseInfo.JoinFlgDef.JoinParent)
227 230
                    {
228
                        string strSQL = string.Empty;
231
                        strSQL.Clear();
229 232
                        for (int i = 0; i < UpdateLinkList.Count; i++)
230 233
                        {
231 234
                            if (!DB01.UpdateFeild(UpdateLinkList[i]
......
236 239
                                ProcSuccess = false;
237 240
                                break;
238 241
                            }
239
                            strSQL = string.Format("UPDATE CONSTRUCTIONBASEINFO A SET A.JOINFLG = {0}", (int)ConstructionBaseInfo.JoinFlgDef.Standard);
240
                            strSQL += " WHERE A.CONSTRUCTIONCODE IN (SELECT AA.FLUCTUATIONCODE FROM CONSTRUCTIONLINK AA";
241
                            strSQL += string.Format(" WHERE AA.CONSTRUCTIONCODE = {0}",UpdateLinkList[i]);
242
                            strSQL += string.Format(" AND AA.LINKTYPE = {0})", (int)ConstructionLink.DataTypeDef.FluctuationType);
243
                            DB01.ExecuteNonQuery(strSQL, false);
242
                            strSQL.AppendFormat("UPDATE CONSTRUCTIONBASEINFO A SET A.JOINFLG = {0}", (int)ConstructionBaseInfo.JoinFlgDef.Standard);
243
                            strSQL.Append(" WHERE A.CONSTRUCTIONCODE IN (SELECT AA.FLUCTUATIONCODE FROM CONSTRUCTIONLINK AA");
244
                            strSQL.AppendFormat(" WHERE AA.CONSTRUCTIONCODE = {0}",UpdateLinkList[i]);
245
                            strSQL.AppendFormat(" AND AA.LINKTYPE = {0})", (int)ConstructionLink.DataTypeDef.FluctuationType);
246
                            DB01.ExecuteNonQuery(strSQL.ToString(), false);
244 247
                        }
245 248
                    }
246 249
                }
......
293 296
        {
294 297
            try
295 298
            {
296
                string strSQL = "SELECT FLUCTUATIONCODE FROM CONSTRUCTIONLINK";
297
                strSQL += LinkDB.CreatePrimarykeyString(RemoveCode);
299
                StringBuilder strSQL = new StringBuilder();
300
                strSQL.Append("SELECT FLUCTUATIONCODE FROM CONSTRUCTIONLINK");
301
                strSQL.Append(LinkDB.CreatePrimarykeyString(RemoveCode));
298 302
                if (bJoin)
299
                    strSQL += string.Format(" AND LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.JoinType);
303
                    strSQL.AppendFormat(" AND LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.JoinType);
300 304
                else
301
                    strSQL += string.Format(" AND LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.FluctuationType);
305
                    strSQL.AppendFormat(" AND LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.FluctuationType);
302 306
                ArrayList arList = new ArrayList();
303
                if (!LinkDB.ExecuteReader(strSQL, ref arList)) return;
307
                if (!LinkDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
304 308
                foreach (object[] CurRec in arList)
305 309
                {
306 310
                    RemoveList.Add(CommonMotions.cnvInt(CurRec[0]));
......
321 325
        {
322 326
            try
323 327
            {
324
                string strSQL = "SELECT B.CONSTRUCTIONCODE, COUNT(*) FROM CONSTRUCTIONLINK A, CONSTRUCTIONLINK B";
325
                strSQL += string.Format(" WHERE A.FLUCTUATIONCODE = {0}", RemoveCode);
326
                strSQL += string.Format(" AND A.LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.FluctuationType);
327
                strSQL += " AND B.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
328
                strSQL += " GROUP BY B.CONSTRUCTIONCODE";
328
                StringBuilder strSQL = new StringBuilder();
329
                strSQL.Append("SELECT B.CONSTRUCTIONCODE, COUNT(*) FROM CONSTRUCTIONLINK A, CONSTRUCTIONLINK B");
330
                strSQL.AppendFormat(" WHERE A.FLUCTUATIONCODE = {0}", RemoveCode);
331
                strSQL.AppendFormat(" AND A.LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.FluctuationType);
332
                strSQL.Append(" AND B.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE");
333
                strSQL.Append(" GROUP BY B.CONSTRUCTIONCODE");
329 334

  
330 335
                ArrayList arList = new ArrayList();
331
                if (!LinkDB.ExecuteReader(strSQL, ref arList)) return 0;
336
                if (!LinkDB.ExecuteReader(strSQL.ToString(), ref arList)) return 0;
332 337

  
333 338
                object[] CurRec = (object[])arList[0];
334 339

  
......
358 363

  
359 364
                DataList.Clear();
360 365
                // 結合工事表示
361
                string strParent = "SELECT DISTINCT(A.CONSTRUCTIONCODE), B.REQUESTEDDATE, 0, 0, 0, 0, F.DETAILSTRING, B.JOINFLG";
362
                strParent += " FROM CONSTRUCTIONLINK A";
363
                strParent += " LEFT OUTER JOIN CONSTRUCTIONBASEINFODETAIL F ON F.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
364
                strParent += string.Format(" AND F.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName);
365
                strParent += ", CONSTRUCTIONBASEINFO B";
366
                StringBuilder strParent = new StringBuilder();
367
                strParent.Append("SELECT DISTINCT(A.CONSTRUCTIONCODE), B.REQUESTEDDATE, 0, 0, 0, 0, F.DETAILSTRING, B.JOINFLG");
368
                strParent.Append(" FROM CONSTRUCTIONLINK A");
369
                strParent.Append(" LEFT OUTER JOIN CONSTRUCTIONBASEINFODETAIL F ON F.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE");
370
                strParent.AppendFormat(" AND F.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DataNoDef.ConstructionName);
371
                strParent.Append(", CONSTRUCTIONBASEINFO B");
366 372

  
367
                strParent += string.Format(" WHERE A.FLUCTUATIONCODE = {0}", SearchCode);
373
                strParent.AppendFormat(" WHERE A.FLUCTUATIONCODE = {0}", SearchCode);
368 374

  
369 375
                switch (FuncCnt)
370 376
                {
371 377
                    case 0:
372 378
                    case 2:
373 379
                        // 結合タイプよりデータを検索
374
                        strParent += string.Format(" AND A.LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.JoinType);
380
                        strParent.AppendFormat(" AND A.LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.JoinType);
375 381
                        break;
376 382
                    case 1:
377 383
                        // 増減タイプよりデータを検索
378
                        strParent += string.Format(" AND A.LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.FluctuationType);
384
                        strParent.AppendFormat(" AND A.LINKTYPE = {0}", (int)ConstructionLink.DataTypeDef.FluctuationType);
379 385
                        break;
380 386
                }
381 387

  
382
                strParent += " AND B.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE";
383
                strParent += string.Format(" AND B.CONSTRUCTIONSTATUSFLG != {0}", iStatus);
388
                strParent.Append(" AND B.CONSTRUCTIONCODE = A.CONSTRUCTIONCODE");
389
                strParent.AppendFormat(" AND B.CONSTRUCTIONSTATUSFLG != {0}", iStatus);
384 390

  
385
                if (!BaseDB.ExecuteReader(strParent, ref DataList))
391
                if (!BaseDB.ExecuteReader(strParent.ToString(), ref DataList))
386 392
                {
387 393
                    FuncCnt = 3;
388 394
                    return;
......
428 434
            try
429 435
            {
430 436
                // 対象の工事情報を取得する
431
                string strSQL = BaseDB.CreatePrimarykeyString(TargetCode);
437
                StringBuilder strSQL = new StringBuilder();
438
                strSQL.Append(BaseDB.CreatePrimarykeyString(TargetCode));
432 439
                ConstructionBaseInfo BaseRec = new ConstructionBaseInfo();
433
                if (!BaseDB.SelectAction(strSQL, ref BaseRec, false)) return false;
440
                if (!BaseDB.SelectAction(strSQL.ToString(), ref BaseRec, false)) return false;
434 441

  
435 442
                // 結合工事では無ければ処理しない
436 443
                if (BaseRec.JoinFlg == (int)ConstructionBaseInfo.JoinFlgDef.Standard) return true;
......
439 446
                int ParentCode = ClsProcessExist.GetParentConstrCode(TargetCode);
440 447

  
441 448
                // 結合している工事番号をすべて取得する
442
                strSQL = "SELECT A.CONSTRUCTIONCODE, A.FLUCTUATIONCODE, D.JOINFLG, B.FLUCTUATIONCODE, C.JOINFLG FROM CONSTRUCTIONLINK A";
443
                strSQL += " LEFT JOIN CONSTRUCTIONLINK B ON B.CONSTRUCTIONCODE = A.FLUCTUATIONCODE";
444
                strSQL += " LEFT JOIN CONSTRUCTIONBASEINFO C ON C.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE";
445
                strSQL += ", CONSTRUCTIONBASEINFO D";
446
                strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0}", ParentCode);
447
                strSQL += " AND D.CONSTRUCTIONCODE = A.FLUCTUATIONCODE";
448
                strSQL += " ORDER BY D.JOINFLG ASC, C.JOINFLG ASC";
449
                strSQL.Clear();
450
                strSQL.Append("SELECT A.CONSTRUCTIONCODE, A.FLUCTUATIONCODE, D.JOINFLG, B.FLUCTUATIONCODE, C.JOINFLG FROM CONSTRUCTIONLINK A");
451
                strSQL.Append(" LEFT JOIN CONSTRUCTIONLINK B ON B.CONSTRUCTIONCODE = A.FLUCTUATIONCODE");
452
                strSQL.Append(" LEFT JOIN CONSTRUCTIONBASEINFO C ON C.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE");
453
                strSQL.Append(", CONSTRUCTIONBASEINFO D");
454
                strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", ParentCode);
455
                strSQL.Append(" AND D.CONSTRUCTIONCODE = A.FLUCTUATIONCODE");
456
                strSQL.Append(" ORDER BY D.JOINFLG ASC, C.JOINFLG ASC");
449 457

  
450 458
                ArrayList arList = new ArrayList();
451
                if (!BaseDB.ExecuteReader(strSQL, ref arList, false)) return false;
459
                if (!BaseDB.ExecuteReader(strSQL.ToString(), ref arList, false)) return false;
452 460
                if (arList.Count == 0) return false;
453 461

  
454 462
                List<int> CodeList = new List<int>();
......
464 472
                }
465 473

  
466 474
                // 工事進捗を取得する
467
                strSQL = "SELECT MIN(CONSTRUCTIONSTATUSFLG), MAX(CONSTRUCTIONSTATUSFLG)";
468
                strSQL += " FROM CONSTRUCTIONBASEINFO";
469
                strSQL += " WHERE CONSTRUCTIONCODE IN (";
475
                strSQL.Clear();
476
                strSQL.Append("SELECT MIN(CONSTRUCTIONSTATUSFLG), MAX(CONSTRUCTIONSTATUSFLG)");
477
                strSQL.Append(" FROM CONSTRUCTIONBASEINFO");
478
                strSQL.Append(" WHERE CONSTRUCTIONCODE IN (");
470 479
                for (int i = 0; i < CodeList.Count; i++)
471 480
                {
472
                    if (i != 0) strSQL += ", ";
473
                    strSQL += CodeList[i].ToString();
481
                    if (i != 0) strSQL.Append(", ");
482
                    strSQL.Append(CodeList[i].ToString());
474 483
                }
475
                strSQL += ")";
484
                strSQL.Append(")");
476 485
                
477 486
                arList.Clear();
478
                if (!BaseDB.ExecuteReader(strSQL, ref arList, false)) return false;
487
                if (!BaseDB.ExecuteReader(strSQL.ToString(), ref arList, false)) return false;
479 488
                if (arList.Count == 0) return false;
480 489
                object[] StatRec = (object[])arList[0];
481 490

  
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsCommonApproval.cs
392 392
        /// <summary>
393 393
        /// 最終承認確認(工事承認)
394 394
        /// </summary>
395
        /// <param name="ConstructionCode"></param>
396
        /// <param name="ApprovalCode"></param>
397 395
        /// <returns></returns>
398
        public static bool CheckProcessApproval(int ConstructionCode, int ApprovalCode, int Approvalcount)
396
        public static bool CheckProcessApproval(int ConstructionCode, int ApprovalCode, int OrderNo)
399 397
        {
400 398
            IOMApproval mApprDB = new IOMApproval();
401 399
            IOProcessApproval ApprDB = new IOProcessApproval();
402 400
            try
403 401
            {
404
                // 承認データを取得する(申請データを除く)
405
                string strData = ApprDB.CreatePrimarykeyString(ConstructionCode, ApprovalCode, Approvalcount, s_PrimartyRecord);
402
                // 承認データを取得する
403
                string strData = ApprDB.CreatePrimarykeyString(ConstructionCode, ApprovalCode, OrderNo, s_PrimartyRecord);
406 404
                ProcessApproval DataRec = new ProcessApproval();
407 405
                if (!ApprDB.SelectAction(strData, ref DataRec)) return false;
408 406

  
......
456 454
        }
457 455
        #endregion
458 456

  
459
        #region 承認確認(工事承認)
457
        #region 承認確認(工事承認)
460 458
        /// <summary>
461
        /// 工事案件に対して最終承認がされているかを確認する
459
        /// 工事案件に対して承認OKかを確認する
462 460
        /// </summary>
463
        /// <param name="ConstructionCode"></param>
464
        /// <param name="ApprovalCode"></param>
465 461
        /// <returns></returns>
466
        public static bool CheckProcessApprovalData(int ConstructionCode, int ApprovalCode, int OrderNo)
462
        public static bool CheckProcessApprovalFinal(int ConstructionCode, int ApprovalCode, int OrderNo)
467 463
        {
468 464
            IOConstructionBaseInfo cbiDB = new IOConstructionBaseInfo();
469 465
            IOMApproval mApprDB = new IOMApproval();
......
488 484
                if (MasterList.Count == 0) return false;
489 485

  
490 486
                // 承認データを取得する
491
                string strData = ApprDB.CreatePrimarykeyString(ConstructionCode, ApprovalCode, OrderNo);
492
                //strData += string.Format(" And SeqNo != {0} And ApprovalStatus = {1}", s_PrimartyRecord, (int)CommonDefine.ApprovalStatus.Approval);
493
                strData += " Order By SeqNo ASC";
487
                StringBuilder strData = new StringBuilder();
488
                strData.Append(ApprDB.CreatePrimarykeyString(ConstructionCode, ApprovalCode, OrderNo));
489
                strData.Append(" Order By SeqNo ASC");
494 490
                List<ProcessApproval> DataList = new List<ProcessApproval>();
495
                if (!ApprDB.SelectAction(strData, ref DataList)) return false;
491
                if (!ApprDB.SelectAction(strData.ToString(), ref DataList)) return false;
496 492
                if (DataList.Count == 0) return false;
497 493

  
498 494
                // 申請データを取得する
499 495
                ProcessApproval RequestData = DataList.Find(x => x.SeqNo == s_PrimartyRecord);
500 496
                if (RequestData == null) return false;
501 497

  
498
                // 承認されている場合はそのまま終了
499
                //if (RequestData.ApprovalStatus == (int)CommonDefine.ApprovalStatus.Approval) return true;
500

  
502 501
                int NoCnt = MasterList.Count;
503 502
                foreach (ProcessApproval DataRec in DataList)
504 503
                {
......
1249 1248
                if (bPetition)
1250 1249
                {
1251 1250
                    // 未申請ボタン
1252
                    PetitionButtonDisplay(btnPetition, btnApproval, lblAppCnt, bNone);
1251
                    PetitionButtonDisplay(AppPnls, btnPetition, btnApproval, lblAppCnt, bNone);
1253 1252
                }
1254 1253
                else
1255 1254
                {
......
1268 1267
        /// <summary>
1269 1268
        /// 申請パネル:申請ボタン表示
1270 1269
        /// </summary>
1271
        private static void PetitionButtonDisplay(Button btnPetition, Button btnApproval, Label lblAppCnt, bool bNone)
1270
        private static void PetitionButtonDisplay(List<Panel> AppPnls, Button btnPetition, Button btnApproval, Label lblAppCnt, bool bNone)
1272 1271
        {
1273 1272
            try
1274 1273
            {
......
1277 1276
                btnApproval.Visible = false;
1278 1277
                lblAppCnt.Visible = false;
1279 1278

  
1280
                int nWidth = btnPetition.Width + btnApproval.Width + lblAppCnt.Width;
1279
                int nWidth = AppPnls[(int)AppPnlDef.Normal].Width - 12;
1281 1280
                btnPetition.Size = new Size(nWidth, btnPetition.Size.Height);
1282 1281

  
1283 1282
                btnPetition.BackColor = Color.White;
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs
205 205
                                                                                { (int)ProcessExecuteNo.SafetyPatrol,           "安全パトロール申請"},
206 206
                                                                                { (int)ProcessExecuteNo.ReqSumTotalList,        "手間・通常業者一覧-表示"},
207 207
                                                                                { (int)ProcessExecuteNo.RequestPrintList,       "請求書印刷一覧-表示"},
208
                                                                                { (int)ProcessExecuteNo.DepartmentCost,         "部署出納帳" },
208
                                                                                { (int)ProcessExecuteNo.DepartmentCost,         "部署出納帳-入力" },
209 209
        };
210 210

  
211 211
        #endregion
......
298 298
            /// <summary>
299 299
            ///  5:請求承認
300 300
            /// </summary>
301
            OrderBillingApproval,
301
            OrderRequestApproval,
302 302
            /// <summary>
303 303
            ///  6:工事日報承認
304 304
            /// </summary>
......
2243 2243

  
2244 2244
                // パラメータセット
2245 2245
                frm.ConstructionCode = CurrentPara.IntExecParameter[0];
2246
                frm.ApprovalCode = 0;
2247
                frm.OrderNo = CurrentPara.IntExecParameter[1];
2246
                if (CurrentPara.IntExecParameter.Count > 1) frm.ApprovalCode = CurrentPara.IntExecParameter[1];
2247
                if (CurrentPara.IntExecParameter.Count > 2) frm.OrderNo = CurrentPara.IntExecParameter[2];
2248 2248

  
2249 2249
                if (EditFlg == (int)CommonDefine.ProcessDataEdit.Reference) frm.EditFlg = false;
2250 2250

  
......
2323 2323
                // 次起動プロセスセット
2324 2324
                frm.ExecuteFlg = CurrentPara.IntExecParameter[0];
2325 2325
                frm.ExecuteSubFlg = CurrentPara.IntExecParameter[1];
2326

  
2327
                frm.EditFlg = true;
2328 2326
                frm.RequestMonth = CurrentPara.IntExecParameter[2];
2329 2327
                frm.OrderersDivision = CurrentPara.IntExecParameter[3];
2330 2328
                frm.OrderersCode = CurrentPara.IntExecParameter[4];
2329

  
2331 2330
                frm.OrderersName = CurrentPara.StringExecParameter[0];
2332 2331

  
2332
                frm.EditFlg = true;
2333

  
2333 2334
                // フォーム表示
2334 2335
                frm.ShowDialog();
2335 2336
            }
......
2616 2617
        /// <param name="CurrentPara"></param>
2617 2618
        public static void ProcessExecuteNo_ReqBillingStatus(ProcessParameter CurrentPara)
2618 2619
        {
2619
            // 請求選択一覧
2620
            // 請求状況一覧
2620 2621
            FrmReqBillingStatus frm = new FrmReqBillingStatus();
2621 2622
            try
2622 2623
            {
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsOtherProc.cs
693 693
                ExecFormEntry(ProcessNo, CurProcNo, (Form)frm);
694 694

  
695 695
                // 請求書印刷起動
696
                frm.ConstructionCode = ClsProcessExist.GetParentConstrCode(ConstrCode);
697 696
                frm.SubForm = true;
698 697
                frm.ShowInTaskbar = true;
699 698

  
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IORemInvoiceData.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Collections;
7

  
8
using log4net;
9
using MySql.Data.MySqlClient;
10

  
11
using ProcessManagement.DB.MySql;
12
using ProcessManagement.DB.Core;
13
using ProcessManagement.DataModel;
14

  
15
using ProcessManagement.Common;
16

  
17
namespace ProcessManagement.DB.IOAccess
18
{
19
    /// <summary>
20
    /// 請求書削除データアクセスクラス
21
    /// </summary>
22
    public class IORemInvoiceData : MySqlProcess
23
    {
24
        #region 定義部
25
        /// <summary>
26
        /// log4netログを使用する
27
        /// </summary>
28
        private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
29
        #endregion
30

  
31
        #region 定数
32
        /// <summary>
33
        /// 請求データフィールド並び
34
        /// </summary>
35
        public enum NameColumn
36
        {
37
            InvoiceNo = 0,
38
            RemPerson,
39
            RemDate,
40
            RemComment,
41
            EntryDate,
42
            UpdateDate,
43
        }
44
        #endregion
45

  
46
        #region コンストラクタ
47
        /// <summary>
48
        /// コンストラクタ
49
        /// </summary>
50
        /// <param name="connectionString"></param>
51
        public IORemInvoiceData()
52
                : base(DBCommon.Instance.DBConnectString)
53
        {
54
        }
55

  
56
        #endregion
57

  
58

  
59
        #region SELECT SQL作成
60
        private string CreateSelectSQL()
61
        {
62
            StringBuilder strcmd = new StringBuilder();
63
            try
64
            {
65
                strcmd.Append("SELECT ");
66

  
67
                bool bColFirst = true;
68
                string strWork = string.Empty;
69
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
70
                {
71
                    strWork = gender.ToString();
72
                    if (!bColFirst) strcmd.Append(",");
73
                    if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
74
                    {
75
                        strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d %H:%i:%s')", strWork);
76
                    }
77
                    else
78
                    {
79
                        strcmd.AppendFormat(" {0}", strWork);
80
                    }
81
                    bColFirst = false;
82
                }
83

  
84
                strcmd.Append(" FROM RemInvoiceData");
85

  
86
                return strcmd.ToString();
87
            }
88
            catch (Exception ex)
89
            {
90
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
91
                return string.Empty;
92
            }
93
        }
94
        #endregion
95

  
96
        #region 請求書削除データ検索(1件取得)
97
        /// <summary>
98
        /// 請求書削除データ検索(複数件取得)
99
        /// </summary>
100
        /// <param name="AddSQLString"></param>
101
        /// <param name="data"></param>
102
        /// <param name="bConnect"></param>
103
        /// <returns></returns>
104
        public bool SelectAction(string AddSQLString, ref RemInvoiceData data, bool bConnect = true)
105
        {
106
            // インターフェース
107
            StringBuilder strcmd = new StringBuilder();
108
            ArrayList arData = new ArrayList();
109

  
110
            try
111
            {
112
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
113
                strcmd.Append(CreateSelectSQL());
114
                strcmd.Append(AddSQLString);
115

  
116
                // SQL実行
117
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
118

  
119
                // データセット
120
                foreach (object[] objwrk in arData)
121
                {
122
                    Reader2Struct(objwrk, ref data);
123
                    break;
124
                }
125

  
126
                return true;
127
            }
128
            catch (Exception ex)
129
            {
130
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
131
                return false;
132
            }
133
        }
134
        #endregion
135

  
136
        #region 請求書削除データ検索(複数件取得)
137
        /// <summary>
138
        /// 請求書削除データ検索(複数件取得)
139
        /// </summary>
140
        /// <param name="AddSQLString"></param>
141
        /// <param name="data"></param>
142
        /// <param name="bConnect"></param>
143
        /// <returns></returns>
144
        public bool SelectAction(string AddSQLString, ref List<RemInvoiceData> data, bool bConnect = true)
145
        {
146
            // インターフェース
147
            StringBuilder strcmd = new StringBuilder();
148
            ArrayList arData = new ArrayList();
149

  
150
            try
151
            {
152
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
153
                strcmd.Append(CreateSelectSQL());
154
                strcmd.Append(AddSQLString);
155

  
156
                // SQL実行
157
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
158

  
159
                // データセット
160
                foreach (object[] objwrk in arData)
161
                {
162
                    RemInvoiceData work = new RemInvoiceData();
163
                    Reader2Struct(objwrk, ref work);
164
                    data.Add(work);
165
                }
166

  
167
                return true;
168
            }
169
            catch (Exception ex)
170
            {
171
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
172
                return false;
173
            }
174
        }
175
        #endregion
176

  
177
        #region 請求書削除データ1件追加
178
        /// <summary>
179
        /// 請求書削除データ1件追加
180
        /// </summary>
181
        /// <param name="data"></param>
182
        /// <param name="bConnect"></param>
183
        /// <returns></returns>
184
        public bool InsertAction(RemInvoiceData data, bool bConnect = true)
185
        {
186
            StringBuilder strcmd = new StringBuilder();
187
            try
188
            {
189

  
190
                strcmd.Append("INSERT INTO RemInvoiceData");
191

  
192
                strcmd.Append("(");
193
                bool bFirst = true;
194
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
195
                {
196
                    if (!bFirst) strcmd.Append(", ");
197
                    strcmd.Append(gender.ToString());
198
                    bFirst = false;
199
                }
200
                strcmd.Append(") VALUES (");
201

  
202
                strcmd.AppendFormat(" {0}", data.InvoiceNo);
203
                strcmd.AppendFormat(", {0}", data.RemPerson);
204
                strcmd.AppendFormat(", DATE('{0}')", data.RemDate.ToShortDateString());
205
                strcmd.AppendFormat(",'{0}'", data.RemComment);
206

  
207
                strcmd.Append(", NOW()");
208
                strcmd.Append(", NOW()");
209
                strcmd.Append(")");
210

  
211
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
212

  
213
                return true;
214
            }
215
            catch (Exception ex)
216
            {
217
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
218
                return false;
219
            }
220
        }
221
        #endregion
222

  
223
        #region 請求書削除データ複数追加
224
        /// <summary>
225
        /// 請求書削除データ複数追加
226
        /// </summary>
227
        /// <param name="data">請求データ</param>
228
        /// <returns>true:成功 false:失敗</returns>
229
        public bool InsertAction(List<RemInvoiceData> data, bool bConnect = true)
230
        {
231
            StringBuilder strcmd = new StringBuilder();
232
            try
233
            {
234
                bool bColFirst = true;
235
                strcmd.Append("INSERT INTO RemInvoiceData");
236
                strcmd.Append(" (");
237
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
238
                {
239
                    if (!bColFirst) strcmd.Append(", ");
240
                    strcmd.Append(gender.ToString());
241
                    bColFirst = false;
242
                }
243
                strcmd.Append(") VALUES (");
244

  
245
                bool bDataFirst = true;
246
                foreach (RemInvoiceData work in data)
247
                {
248
                    if (!bDataFirst) strcmd.Append(", (");
249

  
250
                    strcmd.AppendFormat(" {0}", work.InvoiceNo);
251
                    strcmd.AppendFormat(", {0}", work.RemPerson);
252
                    strcmd.AppendFormat(", {0}", work.RemDate);
253
                    strcmd.AppendFormat(",'{0}'", work.RemComment);
254

  
255
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
256
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
257
                    strcmd.Append(")");
258

  
259
                    bDataFirst = false;
260
                }
261

  
262
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
263

  
264
                return true;
265
            }
266
            catch (Exception ex)
267
            {
268
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
269
                return false;
270
            }
271
        }
272
        #endregion
273

  
274
        #region 請求書削除データ更新
275
        /// <summary>
276
        /// 請求データ更新
277
        /// </summary>
278
        /// <param name="AddSQLString">更新条件SQL文字列</param>
279
        /// <param name="data">請求書削除データ</param>
280
        /// <returns>true:成功 false:失敗</returns>
281
        public bool UpdateAction(string AddSQLString, RemInvoiceData data, bool bConnect = true)
282
        {
283
            StringBuilder strcmd = new StringBuilder();
284
            try
285
            {
286

  
287
                strcmd.Append("UPDATE RemInvoiceData");
288

  
289
                strcmd.Append(" SET");
290

  
291
                strcmd.AppendFormat(" InvoiceNo = {0}", data.InvoiceNo);
292
                strcmd.AppendFormat(", RemPerson = {0}", data.RemPerson);
293
                strcmd.AppendFormat(", RemDate = {0}", data.RemDate);
294
                strcmd.AppendFormat(", RemComment = '{0}'", data.RemComment);
295

  
296
                strcmd.Append(", UpdateDate = NOW()");
297

  
298
                strcmd.Append(AddSQLString);
299

  
300
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
301

  
302
                return true;
303
            }
304
            catch (Exception ex)
305
            {
306
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
307
                return false;
308
            }
309
        }
310
        #endregion
311

  
312
        #region 請求書削除データ削除
313
        /// <summary>
314
        /// 請求データ削除
315
        /// </summary>
316
        /// <param name="AddSQLString">削除条件SQL文字列</param>
317
        /// <param name="bConnect"></param>
318
        /// <returns></returns>
319
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
320
        {
321
            // インターフェース
322
            StringBuilder strcmd = new StringBuilder();
323
            try
324
            {
325
                strcmd.AppendFormat("{0}{1}", "DELETE FROM RemInvoiceData", AddSQLString);
326

  
327
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
328

  
329
                return true;
330
            }
331
            catch (Exception ex)
332
            {
333
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
334
                return false;
335
            }
336
        }
337
        #endregion
338

  
339
        #region MySQLDataReaderより構造体へセットする
340
        /// <summary>
341
        /// MySQLDataReaderより構造体へセットする
342
        /// </summary>
343
        /// <param name="reader">MySQLDataReader</param>
344
        /// <param name="wrk">構造体</param>
345
        public void Reader2Struct(object[] objwrk, ref RemInvoiceData wrk)
346
        {
347
            try
348
            {
349
                // データ取得
350
                wrk.InvoiceNo = int.Parse(objwrk[(int)NameColumn.InvoiceNo].ToString());
351
                wrk.RemPerson = int.Parse(objwrk[(int)NameColumn.RemPerson].ToString());
352
                wrk.RemDate = DateTime.Parse(objwrk[(int)NameColumn.RemDate].ToString());
353
                wrk.RemComment = objwrk[(int)NameColumn.RemComment].ToString();
354

  
355
                wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString());
356
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString());
357
            }
358
            catch (MySqlException myex)
359
            {
360
                logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
361
            }
362
            catch (Exception ex)
363
            {
364
                logger.ErrorFormat("システムエラー::{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
365
            }
366
        }
367
        #endregion
368

  
369
        #region 構造体クリア
370
        /// <summary>
371
        /// 構造体クリア
372
        /// </summary>
373
        /// <param name="wrk"></param>
374
        public void ClearStruct(ref RemInvoiceData wrk)
375
        {
376
            try
377
            {
378
                // データ取得
379
                wrk.InvoiceNo = 0;
380
                wrk.RemPerson = 0;
381
                wrk.RemDate = DateTime.Today;
382
                wrk.RemComment = string.Empty;
383

  
384
                wrk.EntryDate = DateTime.Now;
385
                wrk.UpdateDate = DateTime.Now;
386
            }
387
            catch (MySqlException myex)
388
            {
389
                logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
390
            }
391
            catch (Exception ex)
392
            {
393
                logger.ErrorFormat("システムエラー::{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
394
            }
395
        }
396
        #endregion
397

  
398
        #region 主キー検索の文字列を返す
399
        /// <summary>
400
        /// 主キー検索の文字列を返す
401
        /// </summary>
402
        /// <param name="InvoiceNo">請求書No</param>
403
        /// <returns>Where文字列</returns>
404
        public string CreatePrimarykeyString(int InvoiceNo)
405
        {
406
            StringBuilder strWork = new StringBuilder();
407
            try
408
            {
409
                strWork.AppendFormat(" Where InvoiceNo = {0}", InvoiceNo.ToString());
410

  
411
                return strWork.ToString();
412
            }
413
            catch (Exception ex)
414
            {
415
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
416
                return string.Empty;
417
            }
418
        }
419
        #endregion
420
    }
421

  
422
}
423

  
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IORemInvoiceDataDetail.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6
using System.Collections;
7

  
8
using log4net;
9
using MySql.Data.MySqlClient;
10

  
11
using ProcessManagement.DB.MySql;
12
using ProcessManagement.DB.Core;
13
using ProcessManagement.DataModel;
14

  
15
using ProcessManagement.Common;
16

  
17
namespace ProcessManagement.DB.IOAccess
18
{
19
    /// <summary>
20
    /// 請求書削除明細データアクセスクラス
21
    /// </summary>
22
    public class IORemInvoiceDataDetail : MySqlProcess
23
    {
24
        #region 定義部
25
        /// <summary>
26
        /// log4netログを使用する
27
        /// </summary>
28
        private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);
29
        #endregion
30

  
31
        #region 定数
32
        /// <summary>
33
        /// 請求データフィールド並び
34
        /// </summary>
35
        public enum NameColumn
36
        {
37
            InvoiceNo = 0,
38
            SeqNo,
39
            RequestNo,
40
            EntryDate,
41
            UpdateDate,
42
        }
43
        #endregion
44

  
45
        #region コンストラクタ
46
        /// <summary>
47
        /// コンストラクタ
48
        /// </summary>
49
        /// <param name="connectionString"></param>
50
        public IORemInvoiceDataDetail()
51
                : base(DBCommon.Instance.DBConnectString)
52
        {
53
        }
54

  
55
        #endregion
56

  
57

  
58
        #region SELECT SQL作成
59
        private string CreateSelectSQL()
60
        {
61
            StringBuilder strcmd = new StringBuilder();
62
            try
63
            {
64
                strcmd.Append("SELECT ");
65

  
66
                bool bColFirst = true;
67
                string strWork = string.Empty;
68
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
69
                {
70
                    strWork = gender.ToString();
71
                    if (!bColFirst) strcmd.Append(",");
72
                    if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate"))
73
                    {
74
                        strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d %H:%i:%s')", strWork);
75
                    }
76
                    else
77
                    {
78
                        strcmd.AppendFormat(" {0}", strWork);
79
                    }
80
                    bColFirst = false;
81
                }
82

  
83
                strcmd.Append(" FROM RemInvoiceDataDetail");
84

  
85
                return strcmd.ToString();
86
            }
87
            catch (Exception ex)
88
            {
89
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
90
                return string.Empty;
91
            }
92
        }
93
        #endregion
94

  
95
        #region 請求書削除明細データ検索(1件取得)
96
        /// <summary>
97
        /// 請求書削除明細データ検索(複数件取得)
98
        /// </summary>
99
        /// <param name="AddSQLString"></param>
100
        /// <param name="data"></param>
101
        /// <param name="bConnect"></param>
102
        /// <returns></returns>
103
        public bool SelectAction(string AddSQLString, ref RemInvoiceDataDetail data, bool bConnect = true)
104
        {
105
            // インターフェース
106
            StringBuilder strcmd = new StringBuilder();
107
            ArrayList arData = new ArrayList();
108

  
109
            try
110
            {
111
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
112
                strcmd.Append(CreateSelectSQL());
113
                strcmd.Append(AddSQLString);
114

  
115
                // SQL実行
116
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
117

  
118
                // データセット
119
                foreach (object[] objwrk in arData)
120
                {
121
                    Reader2Struct(objwrk, ref data);
122
                    break;
123
                }
124

  
125
                return true;
126
            }
127
            catch (Exception ex)
128
            {
129
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
130
                return false;
131
            }
132
        }
133
        #endregion
134

  
135
        #region 請求書削除明細データ検索(複数件取得)
136
        /// <summary>
137
        /// 請求書削除明細データ検索(複数件取得)
138
        /// </summary>
139
        /// <param name="AddSQLString"></param>
140
        /// <param name="data"></param>
141
        /// <param name="bConnect"></param>
142
        /// <returns></returns>
143
        public bool SelectAction(string AddSQLString, ref List<RemInvoiceDataDetail> data, bool bConnect = true)
144
        {
145
            // インターフェース
146
            StringBuilder strcmd = new StringBuilder();
147
            ArrayList arData = new ArrayList();
148

  
149
            try
150
            {
151
                // SQL作成(DateTime型が変換できないのでCharに変換しておく)
152
                strcmd.Append(CreateSelectSQL());
153
                strcmd.Append(AddSQLString);
154

  
155
                // SQL実行
156
                if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
157

  
158
                // データセット
159
                foreach (object[] objwrk in arData)
160
                {
161
                    RemInvoiceDataDetail work = new RemInvoiceDataDetail();
162
                    Reader2Struct(objwrk, ref work);
163
                    data.Add(work);
164
                }
165

  
166
                return true;
167
            }
168
            catch (Exception ex)
169
            {
170
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
171
                return false;
172
            }
173
        }
174
        #endregion
175

  
176
        #region 請求書削除明細データ1件追加
177
        /// <summary>
178
        /// 請求書削除明細データ1件追加
179
        /// </summary>
180
        /// <param name="data"></param>
181
        /// <param name="bConnect"></param>
182
        /// <returns></returns>
183
        public bool InsertAction(RemInvoiceDataDetail data, bool bConnect = true)
184
        {
185
            StringBuilder strcmd = new StringBuilder();
186
            try
187
            {
188

  
189
                strcmd.Append("INSERT INTO RemInvoiceDataDetail");
190

  
191
                strcmd.Append("(");
192
                bool bFirst = true;
193
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
194
                {
195
                    if (!bFirst) strcmd.Append(", ");
196
                    strcmd.Append(gender.ToString());
197
                    bFirst = false;
198
                }
199
                strcmd.Append(") VALUES (");
200

  
201
                strcmd.AppendFormat(" {0}", data.InvoiceNo);
202
                strcmd.AppendFormat(", {0}", data.SeqNo);
203
                strcmd.AppendFormat(", {0}", data.RequestNo);
204

  
205
                strcmd.Append(", NOW()");
206
                strcmd.Append(", NOW()");
207
                strcmd.Append(")");
208

  
209
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
210

  
211
                return true;
212
            }
213
            catch (Exception ex)
214
            {
215
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
216
                return false;
217
            }
218
        }
219
        #endregion
220

  
221
        #region 請求書削除明細データ複数追加
222
        /// <summary>
223
        /// 請求書削除明細データ複数追加
224
        /// </summary>
225
        /// <param name="data">請求データ</param>
226
        /// <returns>true:成功 false:失敗</returns>
227
        public bool InsertAction(List<RemInvoiceDataDetail> data, bool bConnect = true)
228
        {
229
            StringBuilder strcmd = new StringBuilder();
230
            try
231
            {
232
                bool bColFirst = true;
233
                strcmd.Append("INSERT INTO RemInvoiceDataDetail");
234
                strcmd.Append(" (");
235
                foreach (var gender in Enum.GetValues(typeof(NameColumn)))
236
                {
237
                    if (!bColFirst) strcmd.Append(", ");
238
                    strcmd.Append(gender.ToString());
239
                    bColFirst = false;
240
                }
241
                strcmd.Append(") VALUES (");
242

  
243
                bool bDataFirst = true;
244
                foreach (RemInvoiceDataDetail work in data)
245
                {
246
                    if (!bDataFirst) strcmd.Append(", (");
247

  
248
                    strcmd.AppendFormat(" {0}", work.InvoiceNo);
249
                    strcmd.AppendFormat(", {0}", work.SeqNo);
250
                    strcmd.AppendFormat(", {0}", work.RequestNo);
251

  
252
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.EntryDate);
253
                    strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d %H:%i:%s')", work.UpdateDate);
254
                    strcmd.Append(")");
255

  
256
                    bDataFirst = false;
257
                }
258

  
259
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
260

  
261
                return true;
262
            }
263
            catch (Exception ex)
264
            {
265
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
266
                return false;
267
            }
268
        }
269
        #endregion
270

  
271
        #region 請求書削除明細データ更新
272
        /// <summary>
273
        /// 請求データ更新
274
        /// </summary>
275
        /// <param name="AddSQLString">更新条件SQL文字列</param>
276
        /// <param name="data">請求書削除明細データ</param>
277
        /// <returns>true:成功 false:失敗</returns>
278
        public bool UpdateAction(string AddSQLString, RemInvoiceDataDetail data, bool bConnect = true)
279
        {
280
            StringBuilder strcmd = new StringBuilder();
281
            try
282
            {
283

  
284
                strcmd.Append("UPDATE RemInvoiceDataDetail");
285

  
286
                strcmd.Append(" SET");
287

  
288
                strcmd.AppendFormat(" InvoiceNo = {0}", data.InvoiceNo);
289
                strcmd.AppendFormat(", SeqNo = {0}", data.SeqNo);
290
                strcmd.AppendFormat(", RequestNo = {0}", data.RequestNo);
291

  
292
                strcmd.Append(", UpdateDate = NOW()");
293

  
294
                strcmd.Append(AddSQLString);
295

  
296
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
297

  
298
                return true;
299
            }
300
            catch (Exception ex)
301
            {
302
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
303
                return false;
304
            }
305
        }
306
        #endregion
307

  
308
        #region 請求書削除明細データ削除
309
        /// <summary>
310
        /// 請求データ削除
311
        /// </summary>
312
        /// <param name="AddSQLString">削除条件SQL文字列</param>
313
        /// <param name="bConnect"></param>
314
        /// <returns></returns>
315
        public bool DeleteAction(string AddSQLString, bool bConnect = true)
316
        {
317
            // インターフェース
318
            StringBuilder strcmd = new StringBuilder();
319
            try
320
            {
321
                strcmd.AppendFormat("{0}{1}", "DELETE FROM RemInvoiceDataDetail", AddSQLString);
322

  
323
                if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
324

  
325
                return true;
326
            }
327
            catch (Exception ex)
328
            {
329
                logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString());
330
                return false;
331
            }
332
        }
333
        #endregion
334

  
335
        #region MySQLDataReaderより構造体へセットする
336
        /// <summary>
337
        /// MySQLDataReaderより構造体へセットする
338
        /// </summary>
339
        /// <param name="reader">MySQLDataReader</param>
340
        /// <param name="wrk">構造体</param>
341
        public void Reader2Struct(object[] objwrk, ref RemInvoiceDataDetail wrk)
342
        {
343
            try
344
            {
345
                // データ取得
346
                wrk.InvoiceNo = int.Parse(objwrk[(int)NameColumn.InvoiceNo].ToString());
347

  
348
                wrk.SeqNo = int.Parse(objwrk[(int)NameColumn.SeqNo].ToString());
349
                wrk.RequestNo = int.Parse(objwrk[(int)NameColumn.RequestNo].ToString());
350

  
351
                wrk.EntryDate = DateTime.Parse(objwrk[(int)NameColumn.EntryDate].ToString());
352
                wrk.UpdateDate = DateTime.Parse(objwrk[(int)NameColumn.UpdateDate].ToString());
353
            }
354
            catch (MySqlException myex)
355
            {
356
                logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
357
            }
358
            catch (Exception ex)
359
            {
360
                logger.ErrorFormat("システムエラー::{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
361
            }
362
        }
363
        #endregion
364

  
365
        #region 構造体クリア
366
        /// <summary>
367
        /// 構造体クリア
368
        /// </summary>
369
        /// <param name="wrk"></param>
370
        public void ClearStruct(ref RemInvoiceDataDetail wrk)
371
        {
372
            try
373
            {
374
                // データ取得
375
                wrk.InvoiceNo = 0;
376
                wrk.SeqNo = 0;
377
                wrk.RequestNo = 0;
378

  
379
                wrk.EntryDate = DateTime.Now;
380
                wrk.UpdateDate = DateTime.Now;
381
            }
382
            catch (MySqlException myex)
383
            {
384
                logger.ErrorFormat("MySQLエラー:{0}:{1}", CommonMotions.GetMethodName(2), myex.Message);
385
            }
386
            catch (Exception ex)
387
            {
388
                logger.ErrorFormat("システムエラー::{0}:{1}", CommonMotions.GetMethodName(), ex.Message);
389
            }
390
        }
391
        #endregion
392

  
393
        #region 主キー検索の文字列を返す
394
        /// <summary>
395
        /// 主キー検索の文字列を返す
396
        /// </summary>
397
        /// <param name="InvoiceNo">請求書No</param>
398
        /// <returns>Where文字列</returns>
399
        public string CreatePrimarykeyString(int InvoiceNo, int SeqNo = 0)
400
        {
401
            StringBuilder strWork = new StringBuilder();
402
            try
403
            {
404
                strWork.AppendFormat(" Where InvoiceNo = {0}", InvoiceNo);
405
                if (SeqNo > 0)
406
                    strWork.AppendFormat(" And SeqNo = {0}", SeqNo);
407

  
408
                return strWork.ToString();
409
            }
410
            catch (Exception ex)
411
            {
412
                logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
413
                return string.Empty;
414
            }
415
        }
416
        #endregion
417
    }
418

  
419
}
420

  
branches/src/ProcessManagement/ProcessManagement/DataModel/InvoiceData.cs
11 11
    /// </summary>
12 12
    public class InvoiceData
13 13
    {
14
        #region 定数
15
        public enum CompleteFlgDef
16
        {
17
            /// <summary>
18
            /// 削除済み
19
            /// </summary>
20
            Deleted = -1,
21
            /// <summary>
22
            /// 未印刷
23
            /// </summary>
24
            NoPrint = 0,
25
            /// <summary>
26
            /// 印刷済み
27
            /// </summary>
28
            Printed,
29
        }
30
        #endregion
31

  
14 32
        #region メンバ変数
15 33
        private int         m_InvoiceNo = 0;                    // 請求書No
16 34
        private int         m_OrderersDivision = 0;             // 発注者区分
branches/src/ProcessManagement/ProcessManagement/DataModel/RemInvoiceData.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6

  
7
namespace ProcessManagement.DataModel
8
{
9
    /// <summary>
10
    /// 請求書削除データ
11
    /// </summary>
12
    public class RemInvoiceData
13
    {
14
        #region メンバ変数
15
        /// <summary>
16
        ///  請求書No
17
        /// </summary>
18
        private int         m_InvoiceNo = 0;
19
        /// <summary>
20
        /// 削除担当者コード
21
        /// </summary>
22
        private int         m_RemPerson = 0;
23
        /// <summary>
24
        /// 削除日付
25
        /// </summary>
26
        private DateTime    m_RemDate = DateTime.Today;
27
        /// <summary>
28
        /// 削除理由
29
        /// </summary>
30
        private string      m_RemComment = string.Empty;
31
        /// <summary>
32
        /// 登録日付
33
        /// </summary>
34
        private DateTime    m_EntryDate = DateTime.Now;
35
        /// <summary>
36
        /// 更新日付
37
        /// </summary>
38
        private DateTime    m_UpdateDate = DateTime.Now;
39
        #endregion
40

  
41
        #region コンストラクタ
42
        #endregion
43

  
44
        #region プロパティ
45
        /// <summary>
46
        ///  請求書No
47
        /// </summary>
48
        public int InvoiceNo
49
        {
50
            get { return m_InvoiceNo; }
51
            set { m_InvoiceNo = value; }
52
        }
53
        /// <summary>
54
        /// 削除担当者コード
55
        /// </summary>
56
        public int RemPerson
57
        {
58
            get { return m_RemPerson; }
59
            set { m_RemPerson = value; }
60
        }
61
        /// <summary>
62
        /// 削除日付
63
        /// </summary>
64
        public DateTime RemDate
65
        {
66
            get { return m_RemDate; }
67
            set { m_RemDate = value; }
68
        }
69
        /// <summary>
70
        /// 削除理由
71
        /// </summary>
72
        public string RemComment
73
        {
74
            get { return m_RemComment; }
75
            set { m_RemComment = value; }
76
        }
77

  
78
        /// <summary>
79
        /// 登録日付
80
        /// </summary>
81
        public DateTime EntryDate
82
        {
83
            get { return m_EntryDate; }
84
            set { m_EntryDate = value; }
85
        }
86

  
87
        /// <summary>
88
        /// 更新日付
89
        /// </summary>
90
        public DateTime UpdateDate
91
        {
92
            get { return m_UpdateDate; }
93
            set { m_UpdateDate = value; }
94
        }
95

  
96
        #endregion
97

  
98
    }
99
}
branches/src/ProcessManagement/ProcessManagement/DataModel/RemInvoiceDataDetail.cs
1
using System;
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Text;
5
using System.Threading.Tasks;
6

  
7
namespace ProcessManagement.DataModel
8
{
9
    /// <summary>
10
    /// 請求書削除明細データ
11
    /// </summary>
12
    public class RemInvoiceDataDetail
13
    {
14
        #region メンバ変数
15
        /// <summary>
16
        ///  請求書No
17
        /// </summary>
18
        private int         m_InvoiceNo = 0;
19
        /// <summary>
20
        /// 連番
21
        /// </summary>
22
        private int         m_SeqNo = 0;
23
        /// <summary>
24
        /// 請求No
25
        /// </summary>
26
        private int         m_RequestNo = 0;
27
        /// <summary>
28
        /// 登録日付
29
        /// </summary>
30
        private DateTime    m_EntryDate = DateTime.Now;
31
        /// <summary>
32
        /// 更新日付
33
        /// </summary>
34
        private DateTime    m_UpdateDate = DateTime.Now;
35
        #endregion
36

  
37
        #region コンストラクタ
38
        #endregion
39

  
40
        #region プロパティ
41
        /// <summary>
42
        ///  請求書No
43
        /// </summary>
44
        public int InvoiceNo
45
        {
46
            get { return m_InvoiceNo; }
47
            set { m_InvoiceNo = value; }
48
        }
49
        /// <summary>
50
        /// 連番
51
        /// </summary>
52
        public int SeqNo
53
        {
54
            get { return m_SeqNo; }
55
            set { m_SeqNo = value; }
56
        }
... 差分の行数が表示可能な上限を超えました。超過分は表示しません。

他の形式にエクスポート: Unified diff