Index: branches/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Common/CommonDefine.cs	(revision 228)
@@ -1720,5 +1720,26 @@
         /// </summary>
         public static int s_DefalutShiftValue = 30;
         #endregion
+
+        #region 画面終了時ボタン
+        /// <summary>
+        /// 画面終了時ボタン
+        /// </summary>
+        public enum FormEndButton
+        {
+            /// <summary>
+            /// 登録時終了
+            /// </summary>
+            AsSaved = 0,
+            /// <summary>
+            /// 削除時終了
+            /// </summary>
+            AsRemoved,
+            /// <summary>
+            /// 普通終了
+            /// </summary>
+            AsNormalEnd,
+        }
+        #endregion
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs	(revision 228)
@@ -14,7 +14,7 @@
         /// <summary>
         /// 本体バージョン
         /// </summary>
-        public static int s_SystemVersion = 52;
+        public static int s_SystemVersion = 53;
 
         /// <summary>
         /// コピー・環境バージョン
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ConstructionBaseInfo/FrmConstructionBaseInfoAuxiliary.cs	(revision 228)
@@ -20,6 +20,7 @@
 using ProcessManagement.Forms.CustomControls;
 using ProcessManagement.Forms.ControlsAction;
 using ProcessManagement.Forms.SubForms;
+using ProcessManagement.Forms.Master;
 //*---------------------------- �H�����ꗗ��� ------------------------------*
 //  2015/07/13  Ver1.0.0.0      Create Source           
 //
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudgetAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudgetAuxiliary.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/FrmEstimateBudgetAuxiliary.cs	(revision 228)
@@ -157,8 +157,9 @@
             IOConstructionBaseInfo cbDB = new IOConstructionBaseInfo();
             try
             {
-                string strSQL = cbDB.CreatePrimarykeyString(m_ConstructionCode);
-                if (!cbDB.SelectAction(strSQL, ref m_ConstructionBaseInfo)) return false;
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(cbDB.CreatePrimarykeyString(m_ConstructionCode));
+                if (!cbDB.SelectAction(strSQL.ToString(), ref m_ConstructionBaseInfo)) return false;
 
                 return true;
             }
@@ -185,9 +186,10 @@
             {
                 // データ初期表示
                 // 積算予算書を取得する
-                string strSQL = ebDB.CreatePrimarykeyString(m_ConstructionCode);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(ebDB.CreatePrimarykeyString(m_ConstructionCode));
                 EstimateBudget ebRec = new EstimateBudget();
-                bool bRet = ebDB.SelectAction(strSQL, ref ebRec);
+                bool bRet = ebDB.SelectAction(strSQL.ToString(), ref ebRec);
 
                 // データ取得
                 m_CostCalcEditValue1 = ebRec.RetValue1;     // 予定価格
@@ -348,9 +350,10 @@
             try
             {
                 // 積算予算書を取得する
-                string strSQL = ebDB.CreatePrimarykeyString(m_ConstructionCode);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(ebDB.CreatePrimarykeyString(m_ConstructionCode));
                 EstimateBudget ebRec = new EstimateBudget();
-                ebDB.SelectAction(strSQL, ref ebRec);
+                ebDB.SelectAction(strSQL.ToString(), ref ebRec);
 
                 // データ表示
                 m_dispLabelControl[(int)DispControl.ConstructionCode].Text = CommonMotions.cnvStringCodeFromInt(m_ConstructionBaseInfo.ConstructionCode, "-", 8);   // 工事コード
@@ -357,9 +360,10 @@
                 m_dispLabelControl[(int)DispControl.SubmittedDate].Text = CommonMotions.cnvDateToUndecidedString(m_ConstructionBaseInfo.EstimatesSubmittedDate);    // 見積提出日
 
                 // 工事基本情報明細取得
-                strSQL = cbidDB.CreatePrimarykeyString(m_ConstructionCode, (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL.Clear();
+                strSQL.Append(cbidDB.CreatePrimarykeyString(m_ConstructionCode, (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName));
                 List<ConstructionBaseInfoDetail> workdlist = new List<ConstructionBaseInfoDetail>();
-                if (!cbidDB.SelectAction(strSQL, ref workdlist) || workdlist.Count == 0) return false;
+                if (!cbidDB.SelectAction(strSQL.ToString(), ref workdlist) || workdlist.Count == 0) return false;
                 m_dispLabelControl[(int)DispControl.ConstructionName].Text = workdlist[0].DetailString;                                                             // 工事名称
 
                 m_dispLabelControl[(int)DispControl.PredeterminedPrice].Text = ebRec.RetValue1.ToString("#,0");                                                     // 予定価格
@@ -367,17 +371,19 @@
 
                 // 工事種別マスタ取得
                 // 担当者マスタ取得
-                strSQL = ctypeDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionType);
+                strSQL.Clear();
+                strSQL.Append(ctypeDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionType));
                 ConstructionTypeMaster ctypeRec = new ConstructionTypeMaster();
-                ctypeDB.SelectAction(strSQL, ref ctypeRec);
+                ctypeDB.SelectAction(strSQL.ToString(), ref ctypeRec);
                 m_dispLabelControl[(int)DispControl.ConstructionType].Text = ctypeRec.NameString;                                                                   // 工事種別
 
                 // 担当者マスタ取得
                 int PersonCode = ebRec.IntegratedCode;
                 if (PersonCode == 0) PersonCode = CommonMotions.LoginUserData.PersonCode;
-                strSQL = picDB.CreatePrimarykeyString(PersonCode);
+                strSQL.Clear();
+                strSQL.Append(picDB.CreatePrimarykeyString(PersonCode));
                 PersonInChargeMaster personRec = new PersonInChargeMaster();
-                picDB.SelectAction(strSQL, ref personRec);
+                picDB.SelectAction(strSQL.ToString(), ref personRec);
                 m_dispLabelControl[(int)DispControl.IntegratedPerson].Text = personRec.PersonName;                                                                  // 積算者
                 lblPersonCode.Text = PersonCode.ToString();
 
@@ -418,17 +424,18 @@
 
                 // 積算見積明細に入力用の大項目があれば公共工事とする
                 List<EstimateDataDetail> DetailList = new List<EstimateDataDetail>();
-                string strSQL = DetailDB.CreatePrimarykeyString(m_ConstructionCode);
-                strSQL += " And (";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(DetailDB.CreatePrimarykeyString(m_ConstructionCode));
+                strSQL.Append(" And (");
                 int i = 0;
                 foreach (int Comp in ClsCommonCosts.s_BiddingCode)
                 {
-                    if (i != 0) strSQL += " Or";
-                    strSQL += string.Format(" ComponentCode = {0}", Comp);
+                    if (i != 0) strSQL.Append(" Or");
+                    strSQL.AppendFormat(" ComponentCode = {0}", Comp);
                     i++;
                 }
-                strSQL += ")";
-                if (!DetailDB.SelectAction(strSQL, ref DetailList)) return;
+                strSQL.Append(")");
+                if (!DetailDB.SelectAction(strSQL.ToString(), ref DetailList)) return;
                 // データがあれば公共工事
                 if (DetailList.Count > 0) m_PublicConstruction = true;
             }
@@ -441,7 +448,6 @@
                 DetailDB.close(); DetailDB = null;
             }
         }
-
         #endregion
 
         #region 明細データをグリッドにセットする
@@ -882,11 +888,12 @@
             IOEstimateBudgetDetail DetailDB = new IOEstimateBudgetDetail();
             try
             {
-                string strSQL = string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
-                strSQL += " ORDER BY GROUPCOUNT, LINECOUNT";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
+                strSQL.Append(" ORDER BY GROUPCOUNT, LINECOUNT");
 
                 m_DetailDataList.Clear();
-                if (!DetailDB.SelectAction(strSQL, ref m_DetailDataList)) return false;
+                if (!DetailDB.SelectAction(strSQL.ToString(), ref m_DetailDataList)) return false;
                 // データ無は処理しない
                 if (m_DetailDataList.Count == 0) return true;
 
@@ -998,20 +1005,35 @@
             IOEstimateDataDetail DetailDB = new IOEstimateDataDetail();
             try
             {
-                string strSQL = "SELECT B.COMPANYNAME, C.COMPONENTNAME, SUM(A.LINETOTAL), A.COMPANYCODE, A.COMPONENTCODE, D.ITEMCODE, D.ITEMNAME";
-                strSQL += " FROM ESTIMATEDATADETAIL A";
-                strSQL += " LEFT JOIN SUBCONTRACTORMASTER B ON A.COMPANYCODE = B.COMPANYCODE";
-                strSQL += " LEFT JOIN  COMPONENTMASTER C ON A.COMPONENTCODE = C.COMPONENTCODE";
-                strSQL += " LEFT JOIN  CONSTRUCTIONITEMMASTER D ON A.ITEMCODE = D.ITEMCODE";
-                strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode);                                     // 対象工事のみ
-                strSQL += string.Format(" And A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode);                         // 共通仮設費以外を対象にする
-                strSQL += " And A.MYEXPENSESFLG = 0";                                                                               // 経費を除外する
-                strSQL += " And (A.COMPANYCODE != 0";
-                strSQL += string.Format(" And A.COMPANYCODE != {0})", CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key);   // 自社施工・会社割当無を除外する
-                strSQL += " GROUP BY B.COMPANYNAME, C.COMPONENTNAME, D.ITEMNAME, A.COMPANYCODE, A.COMPONENTCODE, D.ITEMCODE";
-                strSQL += " ORDER BY B.COMPANYNAME, C.COMPONENTNAME, D.ITEMNAME";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT");
+                strSQL.Append(" ifnull(B.COMPANYNAME,'不　明'),");
+                strSQL.Append(" C.COMPONENTNAME,");
+                strSQL.Append(" SUM(A.LINETOTAL),");
+                strSQL.Append(" A.COMPANYCODE,");
+                strSQL.Append(" A.COMPONENTCODE,");
+                strSQL.Append(" D.ITEMCODE,");
+                strSQL.Append(" D.ITEMNAME");
+                strSQL.Append(" FROM ESTIMATEDATADETAIL A");
+                strSQL.Append(" LEFT JOIN SUBCONTRACTORMASTER B ON A.COMPANYCODE = B.COMPANYCODE");
+                strSQL.Append(" LEFT JOIN  COMPONENTMASTER C ON A.COMPONENTCODE = C.COMPONENTCODE");
+                strSQL.Append(" LEFT JOIN  CONSTRUCTIONITEMMASTER D ON A.ITEMCODE = D.ITEMCODE");
+                strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode);                                     // 対象工事のみ
+                strSQL.AppendFormat(" And A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode);                         // 共通仮設費以外を対象にする
+                strSQL.Append(" And A.MYEXPENSESFLG = 0");                                                                      // 経費を除外する
+                //strSQL.Append(" And (A.COMPANYCODE != 0");
+                strSQL.AppendFormat(" And A.COMPANYCODE != {0}",
+                                                    CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key);   // 自社施工・会社割当無を除外する
+                strSQL.AppendFormat(" And ((A.DataType = {0} And  A.InputFlg = {1})",
+                                                    (int)CommonDefine.TabCotegory.Item,
+                                                    (int)CommonDefine.DirectInput.Input);
+                strSQL.AppendFormat(" Or (A.DataType = {0} And A.LineTotal != 0))",
+                                                    (int)CommonDefine.TabCotegory.Spec);
+
+                strSQL.Append(" GROUP BY B.COMPANYNAME, C.COMPONENTNAME, D.ITEMNAME, A.COMPANYCODE, A.COMPONENTCODE, D.ITEMCODE");
+                strSQL.Append(" ORDER BY B.COMPANYNAME, C.COMPONENTNAME, D.ITEMNAME");
                 ArrayList arList = new ArrayList();
-                if (!DetailDB.ExecuteReader(strSQL, ref arList)) return;
+                if (!DetailDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
                 // データ無は処理しない
                 if (arList.Count == 0) return;
 
@@ -1132,20 +1154,19 @@
             IOEstimateDataDetail DetailDB = new IOEstimateDataDetail();
             try
             {
-                string strSQL = "SELECT B.COMPONENTNAME,A.ITEMNAME,SUM(A.LINETOTAL),A.COMPONENTCODE,A.ITEMCODE";
-                strSQL += " FROM ESTIMATEDATADETAIL A, COMPONENTMASTER B";
-                strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode);                 // 対象工事のみ
-                strSQL += string.Format(" AND A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode);     // 共通仮設費以外を対象にする
-                strSQL += " And A.MYEXPENSESFLG = 0";                                                           // 経費を除外する
-                strSQL += string.Format(" And A.COMPANYCODE = {0}",
-                            CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key);           // 自社施工を除外する
-                strSQL += " And A.COMPONENTCODE = B.COMPONENTCODE";
-                strSQL += " GROUP BY B.COMPONENTNAME, A.COMPONENTCODE, A.ITEMNAME, A.ITEMCODE, A.PageCount";
-                strSQL += " ORDER BY A.COMPONENTCODE, A.ITEMCODE, A.PAGECOUNT";
-                //strSQL += " GROUP BY B.COMPONENTNAME, A.COMPONENTCODE, A.ITEMNAME, A.ITEMCODE, A.PageCount, A.LineCount";
-                //strSQL += " ORDER BY A.COMPONENTCODE, A.ITEMCODE, A.PAGECOUNT, A.LINECOUNT";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT B.COMPONENTNAME,A.ITEMNAME,SUM(A.LINETOTAL),A.COMPONENTCODE,A.ITEMCODE");
+                strSQL.Append(" FROM ESTIMATEDATADETAIL A, COMPONENTMASTER B");
+                strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode);                 // 対象工事のみ
+                strSQL.AppendFormat(" AND A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode);     // 共通仮設費以外を対象にする
+                strSQL.Append(" And A.MYEXPENSESFLG = 0");                                                  // 経費を除外する
+                strSQL.AppendFormat(" And A.COMPANYCODE = {0}",
+                            CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key);       // 自社施工を除外する
+                strSQL.Append(" And A.COMPONENTCODE = B.COMPONENTCODE");
+                strSQL.Append(" GROUP BY B.COMPONENTNAME, A.COMPONENTCODE, A.ITEMNAME, A.ITEMCODE, A.PageCount");
+                strSQL.Append(" ORDER BY A.COMPONENTCODE, A.ITEMCODE, A.PAGECOUNT");
                 ArrayList arList = new ArrayList();
-                if (!DetailDB.ExecuteReader(strSQL, ref arList)) return;
+                if (!DetailDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
                 // データ無は処理しない
                 if (arList.Count == 0) return;
 
@@ -1217,13 +1238,14 @@
             IOMConstructionItem ItemDB = new IOMConstructionItem();
             try
             {
-                string strSQL = string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
-                strSQL += string.Format(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_CommunityCompCode); // 共通仮設費を対象にする
-                strSQL += " AND COMPANYCODE != 0";                                                          // 会社割当のあるものを対象
-                strSQL += " ORDER BY PageCount, LineCount";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
+                strSQL.AppendFormat(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_CommunityCompCode);    // 共通仮設費を対象にする
+                strSQL.Append(" AND COMPANYCODE != 0");                                                 // 会社割当のあるものを対象
+                strSQL.Append(" ORDER BY PageCount, LineCount");
 
                 List<EstimateDataDetail> DetailList = new List<EstimateDataDetail>();
-                if (!DetailDB.SelectAction(strSQL, ref DetailList)) return;
+                if (!DetailDB.SelectAction(strSQL.ToString(), ref DetailList)) return;
 
                 // データ無は処理しない
                 if (DetailList.Count == 0) return;
@@ -1285,13 +1307,14 @@
                 SetPublicCommonTempFix();
 
                 // ----- 積み上げ共通仮設費
-                string strSQL = string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
-                strSQL += string.Format(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_CommunityCompCode);    // 共通仮設費を対象にする
-                strSQL += string.Format(" AND ITEMCODE = {0}", ClsCommonCosts.s_PileUpCommonTempory);       // 積み上げ共通仮設費を対象とする
-                strSQL += " AND COMPANYCODE != 0";                                                          // 会社割当のあるものを対象
-                strSQL += " ORDER BY PageCount, LineCount";                                                 // 見積入力と同じ並びにする
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
+                strSQL.AppendFormat(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_CommunityCompCode);        // 共通仮設費を対象にする
+                strSQL.AppendFormat(" AND ITEMCODE = {0}", ClsCommonCosts.s_PileUpCommonTempory);           // 積み上げ共通仮設費を対象とする
+                strSQL.Append(" AND COMPANYCODE != 0");                                                     // 会社割当のあるものを対象
+                strSQL.Append(" ORDER BY PageCount, LineCount");                                            // 見積入力と同じ並びにする
                 List<EstimateDataDetail> DetailList = new List<EstimateDataDetail>();
-                if (!DetailDB.SelectAction(strSQL, ref DetailList)) return;
+                if (!DetailDB.SelectAction(strSQL.ToString(), ref DetailList)) return;
 
                 InsertBlankLine(1);
                 // 積み上げ共通仮設費タイトルセット
@@ -1402,23 +1425,24 @@
                 dgv.Rows[m_CommonItemLine].Cells[(int)DispGridColumn.NegotiationPrice].ReadOnly = true;
 
                 // ----- 明細項目をセットする
-                string strSQL = "SELECT A.LARGECODE, A.MIDDLECODE, B.LARGENAME, C.MIDDLENAME, C.COMMENTTEXT, C.DISPLAYORDER, IFNULL(D.TOTAL, 0)";
-                strSQL += " FROM COMMONCOSTLINKMS A";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT A.LARGECODE, A.MIDDLECODE, B.LARGENAME, C.MIDDLENAME, C.COMMENTTEXT, C.DISPLAYORDER, IFNULL(D.TOTAL, 0)");
+                strSQL.Append(" FROM COMMONCOSTLINKMS A");
                 
-                strSQL += " LEFT JOIN (SELECT E.COMPONENTCODE, E.ITEMCODE, SUM(E.LINETOTAL) TOTAL FROM ESTIMATEDATADETAIL E";
-                strSQL += string.Format(" WHERE E.CONSTRUCTIONCODE = {0} GROUP BY E.COMPONENTCODE, E.ITEMCODE) D ON A.ITEMCODE = D.ITEMCODE", m_ConstructionCode);
+                strSQL.Append(" LEFT JOIN (SELECT E.COMPONENTCODE, E.ITEMCODE, SUM(E.LINETOTAL) TOTAL FROM ESTIMATEDATADETAIL E");
+                strSQL.AppendFormat(" WHERE E.CONSTRUCTIONCODE = {0} GROUP BY E.COMPONENTCODE, E.ITEMCODE) D ON A.ITEMCODE = D.ITEMCODE", m_ConstructionCode);
 
-                strSQL += " , COMMONCOSTLARGE B, COMMONCOSTMIDDLE C";
+                strSQL.Append(" , COMMONCOSTLARGE B, COMMONCOSTMIDDLE C");
                 
-                strSQL += string.Format(" WHERE A.LARGECODE = {0}", ClsCommonCosts.s_CommunityCompCode);
-                strSQL += " AND A.LARGECODE = B.LARGECODE";
-                strSQL += " AND A.LARGECODE = C.LARGECODE";
-                strSQL += " AND A.MIDDLECODE = C.MIDDLECODE";
-                strSQL += " GROUP BY A.LARGECODE, A.MIDDLECODE, B.LARGENAME, C.MIDDLENAME, C.COMMENTTEXT, C.DISPLAYORDER, IFNULL(D.TOTAL, 0)";
-                strSQL += " ORDER BY C.DISPLAYORDER";
+                strSQL.AppendFormat(" WHERE A.LARGECODE = {0}", ClsCommonCosts.s_CommunityCompCode);
+                strSQL.Append(" AND A.LARGECODE = B.LARGECODE");
+                strSQL.Append(" AND A.LARGECODE = C.LARGECODE");
+                strSQL.Append(" AND A.MIDDLECODE = C.MIDDLECODE");
+                strSQL.Append(" GROUP BY A.LARGECODE, A.MIDDLECODE, B.LARGENAME, C.MIDDLENAME, C.COMMENTTEXT, C.DISPLAYORDER, IFNULL(D.TOTAL, 0)");
+                strSQL.Append(" ORDER BY C.DISPLAYORDER");
 
                 ArrayList LinkList = new ArrayList();
-                if (!LinkMSDB.ExecuteReader(strSQL, ref LinkList)) return;
+                if (!LinkMSDB.ExecuteReader(strSQL.ToString(), ref LinkList)) return;
                 if (LinkList.Count == 0) return;
 
                 // 金額のセット
@@ -1507,17 +1531,18 @@
             IOMComponent CompDB = new IOMComponent();
             try
             {
-                string strSQL = "SELECT COMPONENTCODE, ITEMNAME, SPECNAME, PRICEVALUE, FIXEDITEMCODE";
-                strSQL += " FROM ESTIMATEDATA";
-                strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
-                strSQL += string.Format(" AND (COMPONENTCODE <> {0}", ClsCommonCosts.s_MaterialDisposal);
-                strSQL += string.Format(" AND COMPONENTCODE <> {0}", ClsCommonCosts.s_FieldManagementCompCode);
-                strSQL += string.Format(" AND COMPONENTCODE <> {0})", ClsCommonCosts.s_NormalManagementCompCode);
-                strSQL += string.Format(" AND InputFlg = {0}", (int)CommonDefine.DirectInput.Input);
-                strSQL += " ORDER BY LineCount";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT COMPONENTCODE, ITEMNAME, SPECNAME, PRICEVALUE, FIXEDITEMCODE");
+                strSQL.Append(" FROM ESTIMATEDATA");
+                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
+                strSQL.AppendFormat(" AND (COMPONENTCODE <> {0}", ClsCommonCosts.s_MaterialDisposal);
+                strSQL.AppendFormat(" AND COMPONENTCODE <> {0}", ClsCommonCosts.s_FieldManagementCompCode);
+                strSQL.AppendFormat(" AND COMPONENTCODE <> {0})", ClsCommonCosts.s_NormalManagementCompCode);
+                strSQL.AppendFormat(" AND InputFlg = {0}", (int)CommonDefine.DirectInput.Input);
+                strSQL.Append(" ORDER BY LineCount");
 
                 ArrayList arList = new ArrayList();
-                if (!esDB.ExecuteReader(strSQL, ref arList)) return;
+                if (!esDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
 
                 // データ無は処理しない
                 if (arList.Count == 0) return;
@@ -1584,14 +1609,15 @@
             IOEstimateData esDB = new IOEstimateData();
             try
             {
-                string strSQL = "SELECT COMPONENTCODE, ITEMNAME, SPECNAME, PRICEVALUE, FIXEDITEMCODE";
-                strSQL += " FROM ESTIMATEDATA";
-                strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
-                strSQL += string.Format(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_MaterialDisposal);
-                strSQL += " ORDER BY COMPONENTCODE";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT COMPONENTCODE, ITEMNAME, SPECNAME, PRICEVALUE, FIXEDITEMCODE");
+                strSQL.Append(" FROM ESTIMATEDATA");
+                strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
+                strSQL.AppendFormat(" AND COMPONENTCODE = {0}", ClsCommonCosts.s_MaterialDisposal);
+                strSQL.Append(" ORDER BY COMPONENTCODE");
 
                 ArrayList arList = new ArrayList();
-                if (!esDB.ExecuteReader(strSQL, ref arList)) return;
+                if (!esDB.ExecuteReader(strSQL.ToString(), ref arList)) return;
 
                 // データ無は処理しない
                 if (arList.Count == 0) return;
@@ -1767,9 +1793,10 @@
 
                 // 現場管理費明細
                 EstimateData DataRec = new EstimateData();
-                string strSQL = DataDB.CreatePrimarykeyString(m_ConstructionCode);
-                strSQL += string.Format(" AND ComponentCode = {0}", ClsCommonCosts.s_FieldManagementCompCode);
-                DataDB.SelectAction(strSQL, ref DataRec);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(DataDB.CreatePrimarykeyString(m_ConstructionCode));
+                strSQL.AppendFormat(" AND ComponentCode = {0}", ClsCommonCosts.s_FieldManagementCompCode);
+                DataDB.SelectAction(strSQL.ToString(), ref DataRec);
 
                 EstimateBudgetDetail DetailRec = new EstimateBudgetDetail();
                 DetailRec.GroupCount = (int)GroupName_EstimateBudget.FieldManage;                          // グループ番号
@@ -1868,9 +1895,10 @@
 
                 // 一般管理費明細
                 EstimateData DataRec = new EstimateData();
-                string strSQL = DataDB.CreatePrimarykeyString(m_ConstructionCode);
-                strSQL += string.Format(" AND ComponentCode = {0}", ClsCommonCosts.s_NormalManagementCompCode);
-                DataDB.SelectAction(strSQL, ref DataRec);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(DataDB.CreatePrimarykeyString(m_ConstructionCode));
+                strSQL.AppendFormat(" AND ComponentCode = {0}", ClsCommonCosts.s_NormalManagementCompCode);
+                DataDB.SelectAction(strSQL.ToString(), ref DataRec);
 
                 EstimateBudgetDetail DetailRec = new EstimateBudgetDetail();
                 DetailRec.GroupCount = (int)GroupName_EstimateBudget.UsualManage;                          // グループ番号
@@ -3204,11 +3232,12 @@
                 foreach (int[] wrkData in m_ChangeOutSourceList)
                 {
                     // 積算見積データ更新
-                    string strSQL = string.Format("UPDATE EstimateDataDetail SET CompanyCode = {0}", wrkData[1]);		    // 協力会社コード
-                    strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
-                    strSQL += string.Format(" AND COMPANYCODE = {0}", wrkData[0]);
+                    StringBuilder strSQL = new StringBuilder();
+                    strSQL.AppendFormat("UPDATE EstimateDataDetail SET CompanyCode = {0}", wrkData[1]);		    // 協力会社コード
+                    strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode);
+                    strSQL.AppendFormat(" AND COMPANYCODE = {0}", wrkData[0]);
 
-                    if (!DetailDB.ExecuteNonQuery(strSQL, false))
+                    if (!DetailDB.ExecuteNonQuery(strSQL.ToString(), false))
                     {
                         MessageBox.Show("積算予算書明細データ：協力会社コード更新に失敗しました。",
                                         "登録エラー",
@@ -3235,6 +3264,7 @@
         private bool EstimateLinkCheck()
         {
             IOProcessApproval ProcAppDB = new IOProcessApproval();
+            IOEstimateDataDetail DetailDB = new IOEstimateDataDetail();
             try
             {
                 // 積算見積の申請が承認されているかをチェックする
@@ -3250,16 +3280,28 @@
                     if (ProcAppRec.ApprovalStatus == (int)CommonDefine.ApprovalStatus.Approval) return true;
                 }
 
-                // 積算見積入力を見えないように表示して割付チェックを行う
-                object sender = new object();
-                EventArgs e = new EventArgs();
-                ProcessExecute_EstimateInput(sender, e);
-
-                int ProcessNo = (int)ClsExcute.ProcessExecuteNo.EstimateInput;
-                FrmEstimateInput frm = (FrmEstimateInput)ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle;
-                frm.Hide();
-                if (!frm.LinkBudgetPetition)
+                // 業社割付のチェック
+                strSQL.Clear();
+                strSQL.Append("SELECT");
+                strSQL.Append(" count(*)");
+                strSQL.Append(" FROM ESTIMATEDATADETAIL A");
+                strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode);                                     // 対象工事のみ
+                strSQL.AppendFormat(" And A.COMPONENTCODE != {0}", ClsCommonCosts.s_CommunityCompCode);                         // 共通仮設費以外を対象にする
+                strSQL.Append(" And A.MYEXPENSESFLG = 0");                                                                      // 経費を除外する
+                strSQL.AppendFormat(" And A.COMPANYCODE != {0}",
+                                                    CommonDefine.s_AmountMoney[(int)CommonDefine.AmountMoneyNo.MyCosts].Key);   // 自社施工・会社割当無を除外する
+                strSQL.AppendFormat(" And ((A.DataType = {0} And  A.InputFlg = {1} And A.CompanyCode = 0 And A.LineTotal != 0)",
+                                                    (int)CommonDefine.TabCotegory.Item,
+                                                    (int)CommonDefine.DirectInput.Input);
+                strSQL.AppendFormat(" Or (A.DataType = {0} And A.CompanyCode = 0 And A.LineTotal != 0))",
+                                                    (int)CommonDefine.TabCotegory.Spec);
+                ArrayList arList = new ArrayList();
+                DetailDB.ExecuteReader(strSQL.ToString(), ref arList);
+                object[] ObjRec = (object[])arList[0];
+                if (CommonMotions.cnvInt(ObjRec[0]) != 0)
                 {
+                    // エラー時、積算見積入力を表示
+                    EstimateInputErrorDisp();
                     return false;
                 }
 
@@ -3273,8 +3315,39 @@
             finally
             {
                 ProcAppDB.close(); ProcAppDB = null;
+                DetailDB.close(); DetailDB = null;
             }
         }
         #endregion
+
+        #region 見積予算書エラー表示
+        /// <summary>
+        /// 見積予算書エラー表示
+        /// </summary>
+        private void EstimateInputErrorDisp()
+        {
+            try
+            {
+                int ProcessNo = (int)ClsExcute.ProcessExecuteNo.EstimateInput;
+                // 積算見積書入力起動
+                FrmEstimateInput frm = new FrmEstimateInput();
+                ClsExcute.SubFormHandleList[ProcessNo].ProcessNo = s_CurrentProcessNo;
+                ClsExcute.SubFormHandleList[ProcessNo].SubFormHandle = (Form)frm;
+                frm.ConstructionCode = m_ConstructionCode;
+                frm.EditLock = m_EditLock;
+                frm.SubForm = true;
+                frm.ShowInTaskbar = true;
+
+                // クロースドハンドラをこちらで定義する
+                frm.FormClosed += new FormClosedEventHandler(FrmEstimateInputClosed);
+                frm.Show();
+                bool bErr = frm.LinkBudgetPetition;
+            }
+            catch (Exception ex)
+            {
+                logger.ErrorFormat("システムエラー：{0}：{1}", CommonMotions.GetMethodName(), ex.Message);
+            }
+        }
+        #endregion
     }
 }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/ProcessControl.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/ProcessControl.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateBudget/ProcessControl.cs	(revision 228)
@@ -929,6 +929,17 @@
                 else
                 {
                     UpDateProcessContextMenu();
+                    // 通常終了以外は再読込
+                    if (frm.EndingButton != (int)CommonDefine.FormEndButton.AsNormalEnd)
+                    {
+                        ClearDisplay();
+                        dgvAllDisplay.Rows.Clear();
+                        // ヘッダーの表示
+                        DispHeader();
+                        // 初期表示
+                        InitDataLoad();
+                    }
+                    
                     this.Activate();
                 }
             }
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.cs	(revision 228)
@@ -336,6 +336,11 @@
         /// �֘A���鑼���ϕ\���{�^���\��
         /// </summary>
         private bool m_Panel3Visible = true;
+
+        /// <summary>
+        /// �I���������{�^��
+        /// </summary>
+        private int m_EndingButton = -1;
         #endregion
 
         #region �v���p�e�B
@@ -407,6 +412,15 @@
         {
             get { return LinkBudgetPetitionProc(); }
         }
+
+        /// <summary>
+        /// �I���������{�^��
+        /// </summary>
+        public int EndingButton
+        {
+            get { return m_EndingButton; }
+            set { m_EndingButton = value; }
+        }
         #endregion
 
         #region �R���X�g���N�^
@@ -481,6 +495,9 @@
             // �T�u�t�H�[���N���ȊO�͏I���������s��
             if (!m_SubForm) m_CloseingProcessOn = true;
 
+            // �I���{�^���Z�b�g
+            m_EndingButton = (int)CommonDefine.FormEndButton.AsNormalEnd;
+
             this.Close();
         }
         #endregion
@@ -519,6 +536,9 @@
                 else
                     m_CloseingProcessOn = false;
 
+                // �o�^�{�^���Z�b�g
+                m_EndingButton = (int)CommonDefine.FormEndButton.AsSaved;
+
                 CommonMotions.EntryEndMessage("�ώZ���Ϗ��f�[�^");
 
                 // �I��
@@ -550,6 +570,9 @@
                 else
                     m_CloseingProcessOn = false;
 
+                // �폜�{�^���Z�b�g
+                m_EndingButton = (int)CommonDefine.FormEndButton.AsRemoved;
+
                 CommonMotions.RemoveEndMessage("�ώZ���Ϗ��f�[�^");
 
                 // �I��
@@ -1055,9 +1078,10 @@
             try
             {
                 // �ώZ�\�Z�f�[�^�������ꍇ�͓o�^����
-                string strSQL = EstimateDB.CreatePrimarykeyString(m_ConstructionCode);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(EstimateDB.CreatePrimarykeyString(m_ConstructionCode));
                 EstimateData DataRec = new EstimateData();
-                if (!EstimateDB.SelectAction(strSQL, ref DataRec)) m_bChengeAns = true;
+                if (!EstimateDB.SelectAction(strSQL.ToString(), ref DataRec)) m_bChengeAns = true;
 
                 // �f�[�^�ύX�L���̓f�[�^�o�^
                 if (m_bChengeAns) if (!DataEntryProcess()) return;
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.designer.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.designer.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInput.designer.cs	(revision 228)
@@ -182,7 +182,6 @@
             this.panel1.Controls.Add(this.panel3);
             this.panel1.Controls.Add(this.pnlApproval);
             this.panel1.Controls.Add(this.pnlApprovalButton);
-            this.panel1.Controls.Add(this.pnlComent);
             this.panel1.Controls.Add(this.panel2);
             this.panel1.Controls.Add(this.label7);
             this.panel1.Controls.Add(this.lblDispCnt03);
@@ -359,7 +358,7 @@
             this.pnlComent.BackColor = System.Drawing.Color.LemonChiffon;
             this.pnlComent.Controls.Add(this.btnDelComment);
             this.pnlComent.Controls.Add(this.btnAddComment);
-            this.pnlComent.Location = new System.Drawing.Point(577, 95);
+            this.pnlComent.Location = new System.Drawing.Point(73, 5);
             this.pnlComent.Name = "pnlComent";
             this.pnlComent.Size = new System.Drawing.Size(272, 34);
             this.pnlComent.TabIndex = 30;
@@ -977,6 +976,7 @@
             this.Controls.Add(this.lblWrok);
             this.Controls.Add(this.btnDispDown);
             this.Controls.Add(this.btnDispUp);
+            this.Controls.Add(this.pnlComent);
             this.Controls.Add(this.btnLineDel);
             this.Controls.Add(this.btnLineAdd);
             this.Controls.Add(this.btnStructure);
Index: branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInputAuxiliary.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInputAuxiliary.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/EstimateInput/FrmEstimateInputAuxiliary.cs	(revision 228)
@@ -1104,10 +1104,11 @@
                 }
 
                 string strName = string.Empty;
-                string strSQL = scDB.CreatePrimarykeyString(SubConstructorCode);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(scDB.CreatePrimarykeyString(SubConstructorCode));
                 SubContractorMaster scData = new SubContractorMaster();
 
-                if (scDB.SelectAction(strSQL, ref scData)) strName = scData.CompanyName;
+                if (scDB.SelectAction(strSQL.ToString(), ref scData)) strName = scData.CompanyName;
 
                 return strName;
             }
@@ -2460,8 +2461,9 @@
             IOMComponent ioDB = new IOMComponent();
             try
             {
-                string strSQL = ioDB.CreatePrimarykeyString(ComponentKey);
-                if (!ioDB.SelectAction(strSQL, ref cm)) return false;
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(ioDB.CreatePrimarykeyString(ComponentKey));
+                if (!ioDB.SelectAction(strSQL.ToString(), ref cm)) return false;
 
                 return true;
             }
@@ -2489,8 +2491,9 @@
             {
                 if (ItemKey == 0) return false;
 
-                string strSQL = ioDB.CreatePrimarykeyString(ItemKey);
-                if (!ioDB.SelectAction(strSQL, ref cm)) return false;
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(ioDB.CreatePrimarykeyString(ItemKey));
+                if (!ioDB.SelectAction(strSQL.ToString(), ref cm)) return false;
 
                 return true;
             }
@@ -2582,9 +2585,10 @@
             {
                 List<ConstructionBaseInfoDetail> workdlist = new List<ConstructionBaseInfoDetail>();
 
-                string strSQL = string.Format(" Where ConstructionCode = {0}", m_ConstructionCode);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.AppendFormat(" Where ConstructionCode = {0}", m_ConstructionCode);
                 // 工事基本情報取得
-                if (!cbiDB.SelectAction(strSQL, ref m_ConstructionBaseInfo)) return false;
+                if (!cbiDB.SelectAction(strSQL.ToString(), ref m_ConstructionBaseInfo)) return false;
 
 
                 // データ表示
@@ -2597,9 +2601,9 @@
                 m_ConsumptionTaxFlg = m_ConstructionBaseInfo.ConsumptionTaxFlg;
 
 
-                strSQL += string.Format(" And DetailNo = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
+                strSQL.AppendFormat(" And DetailNo = {0}", (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName);
                 // 工事基本情報明細取得
-                if (!cbidDB.SelectAction(strSQL, ref workdlist)) return false;
+                if (!cbidDB.SelectAction(strSQL.ToString(), ref workdlist)) return false;
 
                 if (workdlist.Count == 0) return false;
 
@@ -4026,7 +4030,6 @@
         private void EntryConstructionSpecMaster(int iTabCnt)
         {
             IOMConstructionSpec csDB = new IOMConstructionSpec();
-            //IOMConstructionSpecUnitPrice csuDB = new IOMConstructionSpecUnitPrice();
 
             try
             {
@@ -4034,9 +4037,10 @@
                 int CurComponentCode = m_EntryPage[iTabCnt].ComponentCode;
                 int CurItemCode = m_EntryPage[iTabCnt].ItemCode;
 
-                string strSQL = csDB.CreatePrimarykeyString(CurItemCode);
-                int CurSpecCode = csDB.GetMaxSpecCodeCount(strSQL);
-                int CurDisplayOrder = csDB.GetMaxDisplayOrder(strSQL);
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append(csDB.CreatePrimarykeyString(CurItemCode));
+                int CurSpecCode = csDB.GetMaxSpecCodeCount(strSQL.ToString());
+                int CurDisplayOrder = csDB.GetMaxDisplayOrder(strSQL.ToString());
 
                 List<ConstructionSpecMaster> cwmList = new List<ConstructionSpecMaster>();
                 List<ConstructionSpecUnitPrice> csuList = new List<ConstructionSpecUnitPrice>();
@@ -4069,22 +4073,9 @@
                     cwmSpec.DisplayOrder = ++CurDisplayOrder;
 
                     cwmList.Add(cwmSpec);
-
-                    //// 単価マスタデータセット
-                    //ConstructionSpecUnitPrice csuSpec = new ConstructionSpecUnitPrice();
-                    //csuSpec.ComponentCode = m_EntryPage[iTabCnt].ComponentCode;
-                    //csuSpec.ItemCode = cwmSpec.ItemCode;
-                    //csuSpec.SpecCode = cwmSpec.SpecCode;
-                    //csuSpec.TypeCode = m_ConstructionBaseInfo.ConstructionType;
-                    //if (!CommonMotions.chkCellBlank(wrkRow.Cells[(int)GridItemColumn.UnitPrice].Value))
-                    //    csuSpec.UnitPrice = CommonMotions.cnvDouble(wrkRow.Cells[(int)GridItemColumn.UnitPrice].Value.ToString());
-
-                    //csuList.Add(csuSpec);
-
                 }
                 // トランザクション開始
                 csDB.connect(); csDB.beginTran();
-                //csuDB.connect(); csuDB.beginTran();
 
                 // データ登録
                 if (!csDB.InsertAction(cwmList, false))
@@ -4095,19 +4086,9 @@
                     csDB.rollback();
                     return;
                 }
-                //if (!csuDB.InsertAction(csuList, false))
-                //{
-                //    MessageBox.Show("小項目単価マスタ追加に失敗しました。\n小項目マスタでデータを追加してください。",
-                //                    "データ作成エラー", MessageBoxButtons.OK, MessageBoxIcon.Error);
 
-                //    csDB.rollback();
-                //    csuDB.rollback();
-                //    return;
-                //}
-
                 // Commit
                 csDB.commit();
-                //csuDB.commit();
 
                 MessageBox.Show("小項目マスタ追加を終了しました。", "データ作成完了", MessageBoxButtons.OK, MessageBoxIcon.Information);
 
@@ -4127,7 +4108,6 @@
             finally
             {
                 csDB.close(); csDB = null;
-                //csuDB.close(); csuDB = null;
             }
         }
         #endregion
@@ -4480,9 +4460,10 @@
                 // ++++++++++++++++++++++++++++++++++++++++ 積算見積データ
                 // 積算見積データ取得
                 ArrayList LargeDataList = new ArrayList();
-                string strSQL = "SELECT A.*, B.* FROM ESTIMATEDATA A LEFT JOIN COMPONENTMASTER B ON B.COMPONENTCODE = A.COMPONENTCODE";
-                strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0} ORDER BY A.LineCount",m_ConstructionCode);
-                if (!etDB.ExecuteReader(strSQL, ref LargeDataList)) return false;
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT A.*, B.* FROM ESTIMATEDATA A LEFT JOIN COMPONENTMASTER B ON B.COMPONENTCODE = A.COMPONENTCODE");
+                strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0} ORDER BY A.LineCount", m_ConstructionCode);
+                if (!etDB.ExecuteReader(strSQL.ToString(), ref LargeDataList)) return false;
 
                 // データ無は表示せずに入力へ
                 if (LargeDataList.Count == 0) return false;
@@ -4648,17 +4629,16 @@
                 List<EstimateDataBody> MiddleList = new List<EstimateDataBody>();
 
                 // 積算見積ページデータ取得
-                //string strSQL = etbDB.CreatePrimarykeyString(m_ConstructionCode) + " Order By PageCount";
-                //if (!etbDB.SelectAction(strSQL, ref MiddleList)) return false;
-                string strSQL = "SELECT A.*, B.CNT, B.COMPONENTCODE FROM ESTIMATEDATABODY A,";
-                strSQL += " (SELECT COMPONENTCODE, COUNT(*) CNT FROM COMPONENTLINKMASTER BB";
-                strSQL += " WHERE BB.COMPONENTCODE IN (SELECT BBB.COMPONENTCODE FROM ESTIMATEDATABODY BBB";
-                strSQL += string.Format(" WHERE BBB.CONSTRUCTIONCODE = {0}) GROUP BY BB.COMPONENTCODE) B", m_ConstructionCode);
-                strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0}",m_ConstructionCode);
-                strSQL += " AND B.COMPONENTCODE = A.COMPONENTCODE";
-                strSQL += " ORDER BY A.PAGECOUNT";
+                StringBuilder strSQL = new StringBuilder();
+                strSQL.Append("SELECT A.*, B.CNT, B.COMPONENTCODE FROM ESTIMATEDATABODY A,");
+                strSQL.Append(" (SELECT COMPONENTCODE, COUNT(*) CNT FROM COMPONENTLINKMASTER BB");
+                strSQL.Append(" WHERE BB.COMPONENTCODE IN (SELECT BBB.COMPONENTCODE FROM ESTIMATEDATABODY BBB");
+                strSQL.AppendFormat(" WHERE BBB.CONSTRUCTIONCODE = {0}) GROUP BY BB.COMPONENTCODE) B", m_ConstructionCode);
+                strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0}", m_ConstructionCode);
+                strSQL.Append(" AND B.COMPONENTCODE = A.COMPONENTCODE");
+                strSQL.Append(" ORDER BY A.PAGECOUNT");
                 ArrayList MiddleDataList = new ArrayList();
-                if (!etbDB.ExecuteReader(strSQL, ref MiddleDataList)) return false;
+                if (!etbDB.ExecuteReader(strSQL.ToString(), ref MiddleDataList)) return false;
 
                 // データ無は次処理
                 if (MiddleDataList.Count == 0) return true;
@@ -4711,13 +4691,14 @@
                     SubConstr.Clear();
                     
                     // 積算見積データ取得
-                    strSQL = "SELECT A.*, B.*, C.COMPANYNAME FROM ESTIMATEDATADETAIL A";
-                    strSQL += " LEFT JOIN CONSTRUCTIONITEMMASTER B ON B.ITEMCODE = A.ITEMCODE";
-                    strSQL += " LEFT JOIN SUBCONTRACTORMASTER C ON C.COMPANYCODE = A.COMPANYCODE";
-                    strSQL += string.Format(" WHERE A.CONSTRUCTIONCODE = {0} AND A.PAGECOUNT = {1}", MiddleList[ix].ConstructionCode, MiddleList[ix].PageCount);
-                    strSQL += " Order By A.PAGECOUNT, A.LINECOUNT";
+                    strSQL.Clear();
+                    strSQL.Append("SELECT A.*, B.*, C.COMPANYNAME FROM ESTIMATEDATADETAIL A");
+                    strSQL.Append(" LEFT JOIN CONSTRUCTIONITEMMASTER B ON B.ITEMCODE = A.ITEMCODE");
+                    strSQL.Append(" LEFT JOIN SUBCONTRACTORMASTER C ON C.COMPANYCODE = A.COMPANYCODE");
+                    strSQL.AppendFormat(" WHERE A.CONSTRUCTIONCODE = {0} AND A.PAGECOUNT = {1}", MiddleList[ix].ConstructionCode, MiddleList[ix].PageCount);
+                    strSQL.Append(" Order By A.PAGECOUNT, A.LINECOUNT");
                     ArrayList SmallDataList = new ArrayList();
-                    if (!etdDB.ExecuteReader(strSQL, ref SmallDataList)) continue;
+                    if (!etdDB.ExecuteReader(strSQL.ToString(), ref SmallDataList)) continue;
 
                     // データ無は次処理
                     if (SmallDataList.Count == 0) continue;
Index: branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs
===================================================================
--- branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs	(revision 227)
+++ branches/src/ProcessManagement/ProcessManagement/Properties/AssemblyInfo.cs	(revision 228)
@@ -32,7 +32,7 @@
 // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 
 // 既定値にすることができます:
 // [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.52")]
-[assembly: AssemblyFileVersion("1.0.0.52")]
+[assembly: AssemblyVersion("1.0.0.53")]
+[assembly: AssemblyFileVersion("1.0.0.53")]
 // Log4netを使用する
 [assembly: log4net.Config.XmlConfigurator(ConfigFile = @"log4net.config", Watch = true)]
\ No newline at end of file
