Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoinAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoinAuxiliary.cs	(revision 152)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionJoin/FrmConstructionJoinAuxiliary.cs	(revision 153)
@@ -653,6 +653,7 @@
 
                 frm.ProcessNo = (int)ClsExcute.ProcessExecuteNo.OrderJoin;
                 frm.PersonCode = GetConstructionPersonCode();
+                frm.SelectType = (int)FrmConstructionDiag.SelectConstructionType.All;
 
                 frm.ShowDialog();
                 // 終了コード確認
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCostsAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCostsAuxiliary.cs	(revision 152)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/TAndPCosts/FrmTAndPCostsAuxiliary.cs	(revision 153)
@@ -1654,6 +1654,7 @@
                 frm.PersonCharge = (int)FrmConstructionDiag.PersonChargePoint.Construction;
                 frm.PersonCode = PersonCode;
                 frm.ProcessNo = (int)ClsExcute.ProcessExecuteNo.TAndPCosts;
+                frm.SelectType = (int)FrmConstructionDiag.SelectConstructionType.Ongoing;
 
                 frm.ShowDialog();
                 // 終了コード確認
Index: branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.Designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.Designer.cs	(revision 152)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.Designer.cs	(revision 153)
@@ -38,6 +38,7 @@
             this.Column1 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column5 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column3 = new System.Windows.Forms.DataGridViewTextBoxColumn();
+            this.Column7 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column2 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column4 = new System.Windows.Forms.DataGridViewTextBoxColumn();
             this.Column6 = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -91,6 +92,7 @@
             this.Column1,
             this.Column5,
             this.Column3,
+            this.Column7,
             this.Column2,
             this.Column4,
             this.Column6});
@@ -127,7 +129,8 @@
             this.Column5.ReadOnly = true;
             this.Column5.Resizable = System.Windows.Forms.DataGridViewTriState.False;
             this.Column5.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
-            this.Column5.Width = 120;
+            this.Column5.Visible = false;
+            this.Column5.Width = 5;
             // 
             // Column3
             // 
@@ -142,6 +145,15 @@
             this.Column3.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
             this.Column3.Width = 800;
             // 
+            // Column7
+            // 
+            this.Column7.Frozen = true;
+            this.Column7.HeaderText = "工事担当者";
+            this.Column7.Name = "Column7";
+            this.Column7.Resizable = System.Windows.Forms.DataGridViewTriState.False;
+            this.Column7.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable;
+            this.Column7.Width = 120;
+            // 
             // Column2
             // 
             this.Column2.Frozen = true;
@@ -197,6 +209,7 @@
         private System.Windows.Forms.DataGridViewTextBoxColumn Column1;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column5;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column3;
+        private System.Windows.Forms.DataGridViewTextBoxColumn Column7;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column2;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column4;
         private System.Windows.Forms.DataGridViewTextBoxColumn Column6;
Index: branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.cs	(revision 152)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.cs	(revision 153)
@@ -299,6 +299,30 @@
         }
         #endregion
 
+        #region グリッド空行チェック
+        /// <summary>
+        /// グリッド空行チェック
+        /// </summary>
+        /// <param name="row"></param>
+        /// <returns></returns>
+        private bool BlanckRowCheck(DataGridViewRow row)
+        {
+            try
+            {
+                // 空欄チェック
+                if (CommonMotions.chkObjectIsNull(row.Cells[(int)DispGridColumn.ConstructionCode].Value)) return false;
+                if (CommonMotions.cnvString(row.Cells[(int)DispGridColumn.ConstructionName].Value).Length == 0) return false;
+
+                return true;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+                return false;
+            }
+        }
+        #endregion
+
         #region 選択データセット処理
         /// <summary>
         /// 選択データセット処理
@@ -365,238 +389,30 @@
                 dgvMaster.Rows.Clear();
 
                 StringBuilder strSQL = new StringBuilder();
-//                string strSQL = string.Empty;
 
-////                if (m_ProcessNo == (int)ClsExcute.ProcessExecuteNo.TAndPCosts)      Del BIT 2017/02/22
-                if (m_SelectType == (int)SelectConstructionType.Ongoing)                    // 検索タイプが進行中 Add BIT 2017/02/22
-                {   // ----- 購入品選択の場合
-                    // 進行中案件を検索する
-                    strSQL.Append("SELECT A.CONSTRUCTIONCODE, B.DETAILSTRING");
-                    strSQL.Append(" FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBASEINFODETAIL B, CONSTRUCTIONLEDGER C");
-                    strSQL.AppendFormat(" WHERE (A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.DETAILNO = {0})", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                    strSQL.Append(" AND A.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE AND C.COMPLATEFLG = 0");
+                switch (m_SelectType)
+                {
+                    case (int)SelectConstructionType.Ongoing:                           // 検索タイプが進行中 Add BIT 2017/02/22
+                        // 進行中案件を検索する
+                        SetSelectTypeOngoing(ref strSQL);
+                        break;
+                    case (int)SelectConstructionType.CombinedOrder:                     // 検索タイプが一括請求 Add BIT 2017/02/22
+                        // ----- 請求入力（一括請求）の場合
+                        SetSelectTypeCombinedOrder(ref strSQL);
+                        break;
 
-                    switch (m_PersonCharge)
-                    {
-                        case (int)PersonChargePoint.Sales:
-                            /// 営業担当検索
-                            strSQL.AppendFormat(" AND A.SalesPersonCode = {0}", m_PersonCode);
-                            break;
-                        case (int)PersonChargePoint.Construction:
-                            /// 工事担当者
-                            strSQL.AppendFormat(" AND (A.ConstructionPersonCode = {0} OR A.ConstrSubPersonCode = {0} OR A.ConstructionInstructor = {0})", m_PersonCode);
-                            break;
-                    }
-                    strSQL.Append(" ORDER BY A.ConstructionPeriodStart DESC");
-                }
-                else if (m_SelectType == (int)SelectConstructionType.CombinedOrder)                    // 検索タイプが一括請求 Add BIT 2017/02/22
-                {   // ----- 請求入力（一括請求）の場合
-                    // 進行中＋一括請求を検索する
-                    strSQL.Append("SELECT");
-                    strSQL.Append(" UNI.CONSTRUCTIONCODE");
-                    strSQL.Append(" , UNI.DETAILSTRING");
-                    strSQL.Append(" FROM (");
-                    strSQL.Append(" SELECT");
-                    strSQL.Append(" A1.CONSTRUCTIONCODE AS CONSTRUCTIONCODE");
-                    strSQL.Append(" , B1.DETAILSTRING AS DETAILSTRING");
-                    strSQL.Append(" , A1.CONSTRUCTIONPERIODSTART AS CONSTRUCTIONPERIODSTART");
-                    strSQL.Append(" FROM"); 
-                    strSQL.Append(" CONSTRUCTIONBASEINFO A1");
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL B1 ON ");
-                    strSQL.Append(" A1.CONSTRUCTIONCODE = B1.CONSTRUCTIONCODE");
-                    strSQL.AppendFormat(" AND B1.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONLEDGER C1 ON ");
-                    strSQL.Append(" A1.CONSTRUCTIONCODE = C1.CONSTRUCTIONCODE");
-                    strSQL.Append(" AND C1.COMPLATEFLG = 0 ");
-                    strSQL.Append(" WHERE ");
-                    strSQL.AppendFormat(" A1.BILLINGSPLITFLG = {0}", (int)CommonDefine.BaseInfoBillingSplitFlg.AllOnBilling);
-                    strSQL.AppendFormat(" AND A1.JOINFLG <> {0}", (int)CommonDefine.BaseInfoJoinFlg.JoinChildren);
+                    case (int)SelectConstructionType.SeparateBilling:                   // 検索タイプが分割請求 Add BIT 2017/02/22
+                        // ----- 請求入力（分割請求）の場合
+                        SetSelectTypeSeparateBilling(ref strSQL);
+                        break;
 
-                    switch (m_PersonCharge)
-                    {
-                        case (int)PersonChargePoint.Sales:
-                            /// 営業担当検索
-                            strSQL.AppendFormat(" AND A1.SALESPERSONCODE = {0}", m_PersonCode);
-                            break;
-                        case (int)PersonChargePoint.Construction:
-                            /// 工事担当者
-                            strSQL.AppendFormat(" AND (A1.CONSTRUCTIONPERSONCODE = {0} OR A1.CONSTRSUBPERSONCODE = {0} OR A1.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
-                            break;
-                    }
-
-                    strSQL.Append(" UNION ALL");
-                    strSQL.Append(" SELECT");
-                    strSQL.Append(" A2.CONSTRUCTIONCODE AS CONSTRUCTIONCODE");
-                    strSQL.Append(" , B2.DETAILSTRING AS DETAILSTRING");
-                    strSQL.Append(" , A2.CONSTRUCTIONPERIODSTART AS CONSTRUCTIONPERIODSTART");
-                    strSQL.Append(" FROM");
-                    strSQL.Append(" CONSTRUCTIONBASEINFO A2");
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL B2 ON ");
-                    strSQL.Append(" A2.CONSTRUCTIONCODE = B2.CONSTRUCTIONCODE");
-                    strSQL.AppendFormat(" AND B2.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONLINK D2 ON ");
-                    strSQL.Append(" A2.CONSTRUCTIONCODE = D2.FLUCTUATIONCODE");
-                    strSQL.AppendFormat(" AND D2.LINKTYPE = {0}",(int)CommonDefine.LinkDataType.JoinType);
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONLEDGER C2 ON ");
-                    strSQL.Append(" D2.CONSTRUCTIONCODE = C2.CONSTRUCTIONCODE");
-                    strSQL.Append(" AND C2.COMPLATEFLG = 0 ");
-                    strSQL.Append(" WHERE ");
-                    strSQL.AppendFormat(" A2.BILLINGSPLITFLG = {0}", (int)CommonDefine.BaseInfoBillingSplitFlg.AllOnBilling);
-                    strSQL.AppendFormat(" AND A2.JOINFLG = {0}", (int)CommonDefine.BaseInfoJoinFlg.JoinChildren);
-
-                    switch (m_PersonCharge)
-                    {
-                        case (int)PersonChargePoint.Sales:
-                            /// 営業担当検索
-                            strSQL.AppendFormat(" AND A2.SALESPERSONCODE = {0}", m_PersonCode);
-                            break;
-                        case (int)PersonChargePoint.Construction:
-                            /// 工事担当者
-                            strSQL.AppendFormat(" AND (A2.CONSTRUCTIONPERSONCODE = {0} OR A2.CONSTRSUBPERSONCODE = {0} OR A2.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
-                            break;
-                    }
-                    strSQL.Append(" ) UNI ORDER BY UNI.CONSTRUCTIONPERIODSTART DESC");
-
+                    case (int)SelectConstructionType.All:                               // 結合工事検索
+                        // ----- 工事結合の場合
+                        // 対象全ての案件を検索する
+                        SetSelectTypeAll(ref strSQL);
+                        break;
                 }
-                else if (m_SelectType == (int)SelectConstructionType.SeparateBilling)                    // 検索タイプが分割請求 Add BIT 2017/02/22
-                {   // ----- 請求入力（分割請求）の場合
-                    // 進行中＋分割請求を検索する
-                    strSQL.Append("SELECT");
-                    strSQL.Append(" UNI.CONSTRUCTIONCODE");
-                    strSQL.Append(" , UNI.DETAILSTRING");
-                    strSQL.Append(" FROM (");
-                    strSQL.Append(" SELECT");
-                    strSQL.Append(" A1.CONSTRUCTIONCODE AS CONSTRUCTIONCODE");
-                    strSQL.Append(" , B1.DETAILSTRING AS DETAILSTRING");
-                    strSQL.Append(" , A1.CONSTRUCTIONPERIODSTART AS CONSTRUCTIONPERIODSTART");
-                    strSQL.Append(" FROM");
-                    strSQL.Append(" CONSTRUCTIONBASEINFO A1");
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL B1 ON ");
-                    strSQL.Append(" A1.CONSTRUCTIONCODE = B1.CONSTRUCTIONCODE");
-                    strSQL.AppendFormat(" AND B1.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONLEDGER C1 ON ");
-                    strSQL.Append(" A1.CONSTRUCTIONCODE = C1.CONSTRUCTIONCODE");
-                    strSQL.Append(" AND C1.COMPLATEFLG = 0 ");
-                    strSQL.Append(" WHERE ");
-                    strSQL.AppendFormat(" A1.BILLINGSPLITFLG = {0}", (int)CommonDefine.BaseInfoBillingSplitFlg.SplitBilling);
-                    strSQL.AppendFormat(" AND A1.JOINFLG <> {0}", (int)CommonDefine.BaseInfoJoinFlg.JoinChildren);
 
-                    switch (m_PersonCharge)
-                    {
-                        case (int)PersonChargePoint.Sales:
-                            /// 営業担当検索
-                            strSQL.AppendFormat(" AND A1.SALESPERSONCODE = {0}", m_PersonCode);
-                            break;
-                        case (int)PersonChargePoint.Construction:
-                            /// 工事担当者
-                            strSQL.AppendFormat(" AND (A1.CONSTRUCTIONPERSONCODE = {0} OR A1.CONSTRSUBPERSONCODE = {0} OR A1.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
-                            break;
-                    }
-
-                    strSQL.Append(" UNION ALL");
-                    strSQL.Append(" SELECT");
-                    strSQL.Append(" A2.CONSTRUCTIONCODE AS CONSTRUCTIONCODE");
-                    strSQL.Append(" , B2.DETAILSTRING AS DETAILSTRING");
-                    strSQL.Append(" , A2.CONSTRUCTIONPERIODSTART AS CONSTRUCTIONPERIODSTART");
-                    strSQL.Append(" FROM");
-                    strSQL.Append(" CONSTRUCTIONBASEINFO A2");
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL B2 ON ");
-                    strSQL.Append(" A2.CONSTRUCTIONCODE = B2.CONSTRUCTIONCODE");
-                    strSQL.AppendFormat(" AND B2.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONLINK D2 ON ");
-                    strSQL.Append(" A2.CONSTRUCTIONCODE = D2.FLUCTUATIONCODE");
-                    strSQL.AppendFormat(" AND D2.LINKTYPE = {0}", (int)CommonDefine.LinkDataType.JoinType);
-                    strSQL.Append(" INNER JOIN CONSTRUCTIONLEDGER C2 ON ");
-                    strSQL.Append(" D2.CONSTRUCTIONCODE = C2.CONSTRUCTIONCODE");
-                    strSQL.Append(" AND C2.COMPLATEFLG = 0 ");
-                    strSQL.Append(" WHERE ");
-                    strSQL.AppendFormat(" A2.BILLINGSPLITFLG = {0}", (int)CommonDefine.BaseInfoBillingSplitFlg.SplitBilling);
-                    strSQL.AppendFormat(" AND A2.JOINFLG = {0}", (int)CommonDefine.BaseInfoJoinFlg.JoinChildren);
-
-                    switch (m_PersonCharge)
-                    {
-                        case (int)PersonChargePoint.Sales:
-                            /// 営業担当検索
-                            strSQL.AppendFormat(" AND A2.SALESPERSONCODE = {0}", m_PersonCode);
-                            break;
-                        case (int)PersonChargePoint.Construction:
-                            /// 工事担当者
-                            strSQL.AppendFormat(" AND (A2.CONSTRUCTIONPERSONCODE = {0} OR A2.CONSTRSUBPERSONCODE = {0} OR A2.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
-                            break;
-                    }
-                    strSQL.Append(" ) UNI ORDER BY UNI.CONSTRUCTIONPERIODSTART DESC");
-                }
-                /////                else if (m_ProcessNo == (int)ClsExcute.ProcessExecuteNo.OrderJoin) Del BIT 2017/02/22
-                //else                                // Add BIT 2017/02/22
-                //{             // ※※※※※なぜ検索条件が違うＳＱＬを一つにしたのか？ 2017/05/13
-                //    // 対象全ての案件を検索する
-                //    strSQL.Append("SELECT DISTINCT A.CONSTRUCTIONCODE, B.DETAILSTRING, A.OrderersDivision, A.OrderersCode");
-                //    strSQL.Append(" FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBASEINFODETAIL B, PERSONINCHARGEMASTER C");
-                //    strSQL.AppendFormat(" WHERE (A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.DETAILNO = {0})", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                //    strSQL.AppendFormat(" AND A.JOINFLG = {0} ", (int)CommonDefine.BaseInfoJoinFlg.JoinParent);
-                //    switch (m_PersonCharge)
-                //    {
-                //        case (int)PersonChargePoint.Sales:
-                //            /// 営業担当検索
-                //            strSQL.AppendFormat(" AND A.SALESPERSONCODE = {0}", m_PersonCode);
-                //            break;
-                //        case (int)PersonChargePoint.Construction:
-                //            /// 工事担当者
-                //            strSQL.AppendFormat(" AND (A.CONSTRUCTIONPERSONCODE = {0} OR A.CONSTRSUBPERSONCODE = {0} OR A.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
-                //            break;
-                //    }
-                //    strSQL.Append(" AND (C.PERSONCODE = A.SALESPERSONCODE");
-                //    strSQL.Append(" OR C.PERSONCODE = A.CONSTRUCTIONPERSONCODE");
-                //    strSQL.Append(" OR C.PERSONCODE = A.CONSTRSUBPERSONCODE");
-                //    strSQL.Append(" OR C.PERSONCODE = A.CONSTRUCTIONINSTRUCTOR)");
-                //    strSQL.Append(" ORDER BY B.DETAILSTRING ASC, A.CONSTRUCTIONCODE DESC");
-                //}
-                else if (m_ProcessNo == (int)ClsExcute.ProcessExecuteNo.TAndPCosts)
-                {   // ----- 購入品選択の場合
-                    // 進行中案件を検索する
-                    strSQL.Append("SELECT A.CONSTRUCTIONCODE, B.DETAILSTRING");
-                    strSQL.Append(" FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBASEINFODETAIL B, CONSTRUCTIONLEDGER C");
-                    strSQL.AppendFormat(" WHERE (A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.DETAILNO = {0})", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                    strSQL.Append(" AND A.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE AND C.COMPLATEFLG = 0");
-
-                    switch (m_PersonCharge)
-                    {
-                        case (int)PersonChargePoint.Sales:
-                            /// 営業担当検索
-                            strSQL.AppendFormat(" AND A.SalesPersonCode = {0}", m_PersonCode);
-                            break;
-                        case (int)PersonChargePoint.Construction:
-                            /// 工事担当者
-                            strSQL.AppendFormat(" AND (A.ConstructionPersonCode = {0} OR A.ConstrSubPersonCode = {0} OR A.ConstructionInstructor = {0})", m_PersonCode);
-                            break;
-                    }
-                    strSQL.Append(" ORDER BY A.ConstructionPeriodStart DESC");
-                }
-                else if (m_ProcessNo == (int)ClsExcute.ProcessExecuteNo.OrderJoin)
-                {   // ----- 工事結合の場合
-                    // 対象全ての案件を検索する
-                    strSQL.Append("SELECT DISTINCT A.CONSTRUCTIONCODE, B.DETAILSTRING, A.OrderersDivision, A.OrderersCode");
-                    strSQL.Append(" FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBASEINFODETAIL B, PERSONINCHARGEMASTER C");
-                    strSQL.AppendFormat(" WHERE (A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.DETAILNO = {0})", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
-                    strSQL.AppendFormat(" AND A.JOINFLG = {0} ", (int)CommonDefine.BaseInfoJoinFlg.JoinParent);
-                    switch (m_PersonCharge)
-                    {
-                        case (int)PersonChargePoint.Sales:
-                            /// 営業担当検索
-                            strSQL.AppendFormat(" AND A.SalesPersonCode = {0}", m_PersonCode);
-                            break;
-                        case (int)PersonChargePoint.Construction:
-                            /// 工事担当者
-                            strSQL.AppendFormat(" AND (A.ConstructionPersonCode = {0} OR A.ConstrSubPersonCode = {0} OR A.ConstructionInstructor = {0})", m_PersonCode);
-                            break;
-                    }
-                    strSQL.Append(" AND (C.PERSONCODE = A.SALESPERSONCODE");
-                    strSQL.Append(" Or C.PERSONCODE = A.CONSTRUCTIONPERSONCODE");
-                    strSQL.Append(" Or C.PERSONCODE = A.CONSTRSUBPERSONCODE");
-                    strSQL.Append(" Or C.PERSONCODE = A.CONSTRUCTIONINSTRUCTOR)");
-                    strSQL.Append(" ORDER BY B.DETAILSTRING ASC, A.CONSTRUCTIONCODE DESC");
-                }
-
                 ArrayList BaseList = new ArrayList();
                 if (!BaseDB.ExecuteReader(strSQL.ToString(), ref BaseList)) return;
                 if (BaseList.Count == 0) return;
@@ -621,6 +437,7 @@
                     dgvMaster.Rows.Add((i + 1),
                                         EditConstructionCode,
                                         CommonMotions.cnvString(wrk[1]),
+                                        CommonMotions.cnvString(wrk[4]),
                                         ConstructionCode,
                                         iData[0],
                                         iData[1]);
@@ -635,30 +452,258 @@
             {
                 BaseDB.close(); BaseDB = null;
                 dgvMaster.RowCount += (CommonDefine.s_MaxInitLineCount - dgvMaster.Rows.Count);
+            }
+        }
+        #endregion
 
+        #region 進行中（購入品選択、資材貸出、資材返却）SQL作成
+        /// <summary>
+        /// 進行中（購入品選択、資材貸出、資材返却）SQL作成
+        /// </summary>
+        /// <param name="strSQL"></param>
+        private void SetSelectTypeOngoing(ref StringBuilder strSQL)
+        {
+            try
+            {
+                // 進行中案件を検索する
+                strSQL.Append("SELECT A.CONSTRUCTIONCODE, B.DETAILSTRING, '', '' , D.PERSONNAME");
+                strSQL.Append(" FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBASEINFODETAIL B, CONSTRUCTIONLEDGER C, PERSONINCHARGEMASTER D");
+                strSQL.AppendFormat(" WHERE (A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.DETAILNO = {0})", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL.Append(" AND A.CONSTRUCTIONCODE = C.CONSTRUCTIONCODE AND C.COMPLATEFLG = 0");
+
+                switch (m_PersonCharge)
+                {
+                    case (int)PersonChargePoint.Sales:
+                        /// 営業担当検索
+                        strSQL.AppendFormat(" AND A.SalesPersonCode = {0}", m_PersonCode);
+                        break;
+                    case (int)PersonChargePoint.Construction:
+                        /// 工事担当者
+                        strSQL.AppendFormat(" AND (A.ConstructionPersonCode = {0} OR A.ConstrSubPersonCode = {0} OR A.ConstructionInstructor = {0})", m_PersonCode);
+                        break;
+                }
+                strSQL.Append(" AND D.PERSONCODE = A.ConstructionPersonCode");
+
+                strSQL.Append(" ORDER BY A.ConstructionPeriodStart DESC");
             }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
         }
+        #endregion
+
+        #region 請求入力（一括請求）SQL作成
         /// <summary>
-        /// グリッド空行チェック
+        /// 請求入力（一括請求）SQL作成
         /// </summary>
-        /// <param name="row"></param>
-        /// <returns></returns>
-        private bool BlanckRowCheck(DataGridViewRow row)
+        /// <param name="strSQL"></param>
+        private void SetSelectTypeCombinedOrder(ref StringBuilder strSQL)
         {
             try
             {
-                // 空欄チェック
-                if (CommonMotions.chkObjectIsNull(row.Cells[(int)DispGridColumn.ConstructionCode].Value)) return false;
-                if (CommonMotions.cnvString(row.Cells[(int)DispGridColumn.ConstructionName].Value).Length == 0) return false;
+                // 進行中＋一括請求を検索する
+                strSQL.Append("SELECT");
+                strSQL.Append(" UNI.CONSTRUCTIONCODE");
+                strSQL.Append(" , UNI.DETAILSTRING");
+                strSQL.Append(" , '', '', UNI.PERSONNAME");
+                strSQL.Append(" FROM (");
+                strSQL.Append(" SELECT");
+                strSQL.Append(" A1.CONSTRUCTIONCODE AS CONSTRUCTIONCODE");
+                strSQL.Append(" , B1.DETAILSTRING AS DETAILSTRING");
+                strSQL.Append(" , A1.CONSTRUCTIONPERIODSTART AS CONSTRUCTIONPERIODSTART");
+                strSQL.Append(" , P1.PERSONNAME AS PERSONNAME");
+                strSQL.Append(" FROM");
+                strSQL.Append(" CONSTRUCTIONBASEINFO A1");
+                strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL B1 ON ");
+                strSQL.Append(" A1.CONSTRUCTIONCODE = B1.CONSTRUCTIONCODE");
+                strSQL.AppendFormat(" AND B1.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL.Append(" INNER JOIN CONSTRUCTIONLEDGER C1 ON ");
+                strSQL.Append(" A1.CONSTRUCTIONCODE = C1.CONSTRUCTIONCODE");
+                strSQL.Append(" AND C1.COMPLATEFLG = 0 ");
+                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER P1 ON P1.PERSONCODE = A1.CONSTRUCTIONPERSONCODE");
+                strSQL.Append(" WHERE ");
+                strSQL.AppendFormat(" A1.BILLINGSPLITFLG = {0}", (int)CommonDefine.BaseInfoBillingSplitFlg.AllOnBilling);
+                strSQL.AppendFormat(" AND A1.JOINFLG <> {0}", (int)CommonDefine.BaseInfoJoinFlg.JoinChildren);
 
-                return true;
+                switch (m_PersonCharge)
+                {
+                    case (int)PersonChargePoint.Sales:
+                        /// 営業担当検索
+                        strSQL.AppendFormat(" AND A1.SALESPERSONCODE = {0}", m_PersonCode);
+                        break;
+                    case (int)PersonChargePoint.Construction:
+                        /// 工事担当者
+                        strSQL.AppendFormat(" AND (A1.CONSTRUCTIONPERSONCODE = {0} OR A1.CONSTRSUBPERSONCODE = {0} OR A1.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
+                        break;
+                }
+
+                strSQL.Append(" UNION ALL");
+                strSQL.Append(" SELECT");
+                strSQL.Append(" A2.CONSTRUCTIONCODE AS CONSTRUCTIONCODE");
+                strSQL.Append(" , B2.DETAILSTRING AS DETAILSTRING");
+                strSQL.Append(" , A2.CONSTRUCTIONPERIODSTART AS CONSTRUCTIONPERIODSTART");
+                strSQL.Append(" , P2.PERSONNAME AS PERSONNAME");
+                strSQL.Append(" FROM");
+                strSQL.Append(" CONSTRUCTIONBASEINFO A2");
+                strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL B2 ON ");
+                strSQL.Append(" A2.CONSTRUCTIONCODE = B2.CONSTRUCTIONCODE");
+                strSQL.AppendFormat(" AND B2.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL.Append(" INNER JOIN CONSTRUCTIONLINK D2 ON ");
+                strSQL.Append(" A2.CONSTRUCTIONCODE = D2.FLUCTUATIONCODE");
+                strSQL.AppendFormat(" AND D2.LINKTYPE = {0}", (int)CommonDefine.LinkDataType.JoinType);
+                strSQL.Append(" INNER JOIN CONSTRUCTIONLEDGER C2 ON ");
+                strSQL.Append(" D2.CONSTRUCTIONCODE = C2.CONSTRUCTIONCODE");
+                strSQL.Append(" AND C2.COMPLATEFLG = 0 ");
+                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER P2 ON P2.PERSONCODE = A2.CONSTRUCTIONPERSONCODE");
+                strSQL.Append(" WHERE ");
+                strSQL.AppendFormat(" A2.BILLINGSPLITFLG = {0}", (int)CommonDefine.BaseInfoBillingSplitFlg.AllOnBilling);
+                strSQL.AppendFormat(" AND A2.JOINFLG = {0}", (int)CommonDefine.BaseInfoJoinFlg.JoinChildren);
+
+                switch (m_PersonCharge)
+                {
+                    case (int)PersonChargePoint.Sales:
+                        /// 営業担当検索
+                        strSQL.AppendFormat(" AND A2.SALESPERSONCODE = {0}", m_PersonCode);
+                        break;
+                    case (int)PersonChargePoint.Construction:
+                        /// 工事担当者
+                        strSQL.AppendFormat(" AND (A2.CONSTRUCTIONPERSONCODE = {0} OR A2.CONSTRSUBPERSONCODE = {0} OR A2.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
+                        break;
+                }
+                strSQL.Append(" ) UNI ORDER BY UNI.CONSTRUCTIONPERIODSTART DESC");
             }
             catch (Exception ex)
             {
                 logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
-                return false;
             }
         }
         #endregion
+
+        #region 請求入力（分割請求）SQL作成
+        /// <summary>
+        /// 請求入力（分割請求）SQL作成
+        /// </summary>
+        /// <param name="strSQL"></param>
+        private void SetSelectTypeSeparateBilling(ref StringBuilder strSQL)
+        {
+            try
+            {   // ----- 請求入力（分割請求）の場合
+                // 進行中＋分割請求を検索する
+                strSQL.Append("SELECT");
+                strSQL.Append(" UNI.CONSTRUCTIONCODE");
+                strSQL.Append(" , UNI.DETAILSTRING");
+                strSQL.Append(" , '', '', UNI.PERSONNAME");
+                strSQL.Append(" FROM (");
+                strSQL.Append(" SELECT");
+                strSQL.Append(" A1.CONSTRUCTIONCODE AS CONSTRUCTIONCODE");
+                strSQL.Append(" , B1.DETAILSTRING AS DETAILSTRING");
+                strSQL.Append(" , A1.CONSTRUCTIONPERIODSTART AS CONSTRUCTIONPERIODSTART");
+                strSQL.Append(" , P1.PersonName AS PERSONNAME");
+                strSQL.Append(" FROM");
+                strSQL.Append(" CONSTRUCTIONBASEINFO A1");
+                strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL B1 ON ");
+                strSQL.Append(" A1.CONSTRUCTIONCODE = B1.CONSTRUCTIONCODE");
+                strSQL.AppendFormat(" AND B1.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL.Append(" INNER JOIN CONSTRUCTIONLEDGER C1 ON ");
+                strSQL.Append(" A1.CONSTRUCTIONCODE = C1.CONSTRUCTIONCODE");
+                strSQL.Append(" AND C1.COMPLATEFLG = 0 ");
+                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER P1 ON P1.PERSONCODE = A1.CONSTRUCTIONPERSONCODE");
+                strSQL.Append(" WHERE ");
+                strSQL.AppendFormat(" A1.BILLINGSPLITFLG = {0}", (int)CommonDefine.BaseInfoBillingSplitFlg.SplitBilling);
+                strSQL.AppendFormat(" AND A1.JOINFLG <> {0}", (int)CommonDefine.BaseInfoJoinFlg.JoinChildren);
+
+                switch (m_PersonCharge)
+                {
+                    case (int)PersonChargePoint.Sales:
+                        /// 営業担当検索
+                        strSQL.AppendFormat(" AND A1.SALESPERSONCODE = {0}", m_PersonCode);
+                        break;
+                    case (int)PersonChargePoint.Construction:
+                        /// 工事担当者
+                        strSQL.AppendFormat(" AND (A1.CONSTRUCTIONPERSONCODE = {0} OR A1.CONSTRSUBPERSONCODE = {0} OR A1.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
+                        break;
+                }
+
+                strSQL.Append(" UNION ALL");
+                strSQL.Append(" SELECT");
+                strSQL.Append(" A2.CONSTRUCTIONCODE AS CONSTRUCTIONCODE");
+                strSQL.Append(" , B2.DETAILSTRING AS DETAILSTRING");
+                strSQL.Append(" , A2.CONSTRUCTIONPERIODSTART AS CONSTRUCTIONPERIODSTART");
+                strSQL.Append(" , P2.PERSONNAME AS PERSONNAME");
+                strSQL.Append(" FROM");
+                strSQL.Append(" CONSTRUCTIONBASEINFO A2");
+                strSQL.Append(" INNER JOIN CONSTRUCTIONBASEINFODETAIL B2 ON ");
+                strSQL.Append(" A2.CONSTRUCTIONCODE = B2.CONSTRUCTIONCODE");
+                strSQL.AppendFormat(" AND B2.DETAILNO = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL.Append(" INNER JOIN CONSTRUCTIONLINK D2 ON ");
+                strSQL.Append(" A2.CONSTRUCTIONCODE = D2.FLUCTUATIONCODE");
+                strSQL.AppendFormat(" AND D2.LINKTYPE = {0}", (int)CommonDefine.LinkDataType.JoinType);
+                strSQL.Append(" INNER JOIN CONSTRUCTIONLEDGER C2 ON ");
+                strSQL.Append(" D2.CONSTRUCTIONCODE = C2.CONSTRUCTIONCODE");
+                strSQL.Append(" AND C2.COMPLATEFLG = 0 ");
+                strSQL.Append(" LEFT JOIN PERSONINCHARGEMASTER P2 ON P2.PERSONCODE = A2.CONSTRUCTIONPERSONCODE");
+                strSQL.Append(" WHERE ");
+                strSQL.AppendFormat(" A2.BILLINGSPLITFLG = {0}", (int)CommonDefine.BaseInfoBillingSplitFlg.SplitBilling);
+                strSQL.AppendFormat(" AND A2.JOINFLG = {0}", (int)CommonDefine.BaseInfoJoinFlg.JoinChildren);
+
+                switch (m_PersonCharge)
+                {
+                    case (int)PersonChargePoint.Sales:
+                        /// 営業担当検索
+                        strSQL.AppendFormat(" AND A2.SALESPERSONCODE = {0}", m_PersonCode);
+                        break;
+                    case (int)PersonChargePoint.Construction:
+                        /// 工事担当者
+                        strSQL.AppendFormat(" AND (A2.CONSTRUCTIONPERSONCODE = {0} OR A2.CONSTRSUBPERSONCODE = {0} OR A2.CONSTRUCTIONINSTRUCTOR = {0})", m_PersonCode);
+                        break;
+                }
+                strSQL.Append(" ) UNI ORDER BY UNI.CONSTRUCTIONPERIODSTART DESC");
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
+
+        #region 工事結合SQL作成
+        /// <summary>
+        /// 工事結合SQL作成
+        /// </summary>
+        /// <param name="strSQL"></param>
+        private void SetSelectTypeAll(ref StringBuilder strSQL)
+        {
+            try
+            {
+                // ----- 工事結合の場合
+                // 対象全ての案件を検索する
+                strSQL.Append("SELECT DISTINCT A.CONSTRUCTIONCODE, B.DETAILSTRING, A.OrderersDivision, A.OrderersCode, C.PERSONNAME");
+                strSQL.Append(" FROM CONSTRUCTIONBASEINFO A, CONSTRUCTIONBASEINFODETAIL B, PERSONINCHARGEMASTER C");
+                strSQL.AppendFormat(" WHERE (A.CONSTRUCTIONCODE = B.CONSTRUCTIONCODE AND B.DETAILNO = {0})", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL.AppendFormat(" AND A.JOINFLG = {0} ", (int)CommonDefine.BaseInfoJoinFlg.JoinParent);
+                switch (m_PersonCharge)
+                {
+                    case (int)PersonChargePoint.Sales:
+                        /// 営業担当検索
+                        strSQL.AppendFormat(" AND A.SalesPersonCode = {0}", m_PersonCode);
+                        break;
+                    case (int)PersonChargePoint.Construction:
+                        /// 工事担当者
+                        strSQL.AppendFormat(" AND (A.ConstructionPersonCode = {0} OR A.ConstrSubPersonCode = {0} OR A.ConstructionInstructor = {0})", m_PersonCode);
+                        break;
+                }
+                strSQL.Append(" AND (C.PERSONCODE = A.SALESPERSONCODE");
+                strSQL.Append(" Or C.PERSONCODE = A.CONSTRUCTIONPERSONCODE");
+                strSQL.Append(" Or C.PERSONCODE = A.CONSTRSUBPERSONCODE");
+                strSQL.Append(" Or C.PERSONCODE = A.CONSTRUCTIONINSTRUCTOR)");
+                strSQL.Append(" ORDER BY B.DETAILSTRING ASC, A.CONSTRUCTIONCODE DESC");
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.resx
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.resx	(revision 152)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/SubForms/FrmConstructionDiag.resx	(revision 153)
@@ -126,6 +126,9 @@
   <metadata name="Column3.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
+  <metadata name="Column7.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
+    <value>True</value>
+  </metadata>
   <metadata name="Column2.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
     <value>True</value>
   </metadata>
