リビジョン 241
購入品及び交通費入力画面バグ修正
請求的・担当者承認改修
branches/src/ProcessManagement/ProcessManagement/Common/CommonVersion.cs | ||
---|---|---|
14 | 14 |
/// <summary> |
15 | 15 |
/// 本体バージョン |
16 | 16 |
/// </summary> |
17 |
public static int s_SystemVersion = 59;
|
|
17 |
public static int s_SystemVersion = 60;
|
|
18 | 18 |
|
19 | 19 |
/// <summary> |
20 | 20 |
/// コピー・環境バージョン |
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsApprovalPermission.cs | ||
---|---|---|
91 | 91 |
// データがあるかをチェックする |
92 | 92 |
if (!ApprDB.SelectAction(strSQL, ref DataList)) return false; |
93 | 93 |
|
94 |
// データ追加時 |
|
95 | 94 |
if (DataList.Count == 0) |
96 |
{ |
|
95 |
{ // データ追加時
|
|
97 | 96 |
if (!ApprDB.InsertAction(Rec)) return false; |
98 |
return true; |
|
99 | 97 |
} |
98 |
else |
|
99 |
{ // データ更新時 |
|
100 |
if (!ApprDB.UpdateAction(strSQL, Rec)) return false; |
|
101 |
} |
|
100 | 102 |
|
101 |
// データ更新時 |
|
102 |
if (!ApprDB.UpdateAction(strSQL, Rec)) return false; |
|
103 |
|
|
104 | 103 |
return true; |
105 | 104 |
} |
106 | 105 |
catch (Exception ex) |
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsExcute.cs | ||
---|---|---|
3741 | 3741 |
|
3742 | 3742 |
if (CurrentPara.DateExecParameter.Count > 1) frm.DataSearchDate = CurrentPara.DateExecParameter[1]; |
3743 | 3743 |
if (CurrentPara.IntExecParameter.Count > 3) frm.DataSearchSeqNo = CurrentPara.IntExecParameter[3]; |
3744 |
if (CurrentPara.ArrayParameter.Count > 0) frm.ArrayParam = CurrentPara.ArrayParameter; |
|
3744 | 3745 |
|
3745 | 3746 |
// フォーム表示 |
3746 | 3747 |
frm.ShowDialog(); |
branches/src/ProcessManagement/ProcessManagement/Common/Process/ClsSecurityPermission.cs | ||
---|---|---|
824 | 824 |
#region ログイン者がデータにアクセスできるかを返す(担当者データ) |
825 | 825 |
private enum PersonAppData |
826 | 826 |
{ |
827 |
DataPersonCode = 0, |
|
828 |
DataDepCode, |
|
829 |
DataPersonName, |
|
830 |
DataSecRank, |
|
831 |
DataAffiliationFlg, |
|
832 |
RangePersonCode, |
|
833 |
RangePersonName, |
|
834 |
RangeSecCode, |
|
835 |
RangeSecRank, |
|
836 |
RangeGeneFlg |
|
827 |
PetPersonCode = 0, |
|
828 |
PetDepartmentCode, |
|
829 |
PetPersonName, |
|
830 |
PetSecRank, |
|
831 |
AppDepartmentCode, |
|
832 |
AppPersonCode, |
|
833 |
AppPersonName, |
|
834 |
AppSecRank |
|
837 | 835 |
} |
838 | 836 |
/// <summary> |
839 | 837 |
/// ログイン者がデータにアクセスできるかを返す |
... | ... | |
848 | 846 |
|
849 | 847 |
bool bRet = false; |
850 | 848 |
|
851 |
string strSQL ="SELECT"; |
|
852 |
strSQL += " A.PERSONCODE, A.DEPARTMENTCODE, A.PERSONNAME, E.SECRANK,"; |
|
853 |
strSQL += " B.AFFILIATIONFLG,"; |
|
854 |
strSQL += " C.PERSONCODE, C.PERSONNAME, C.SECCODE, D.SECRANK, D.GENERALAFFAIRS"; |
|
855 |
strSQL += " FROM PERSONINCHARGEMASTER A, PERSONDEPARTMENTMASTER B, PERSONINCHARGEMASTER C, SECURITYMASTER D, SECURITYMASTER E"; |
|
856 |
strSQL += string.Format(" WHERE A.PERSONCODE = {0}", PersonCode); |
|
857 |
strSQL += " AND B.DEPARTMENTCODE = A.DEPARTMENTCODE"; |
|
858 |
strSQL += " AND C.PERSONCODE = B.PERSONCODE"; |
|
859 |
strSQL += " AND D.SECCODE = C.SECCODE"; |
|
860 |
strSQL += " AND E.SECCODE = A.SECCODE"; |
|
861 |
strSQL += " ORDER BY B.PERSONCODE"; |
|
849 |
StringBuilder strSQL = new StringBuilder(); |
|
850 |
strSQL.Append("SELECT"); |
|
851 |
strSQL.Append(" A.PERSONCODE"); |
|
852 |
strSQL.Append(", A.DEPARTMENTCODE"); |
|
853 |
strSQL.Append(", A.PERSONNAME"); |
|
854 |
strSQL.Append(", B.SecRank"); |
|
855 |
strSQL.Append(", C.DepartmentCode"); |
|
856 |
strSQL.Append(", D.PersonCode"); |
|
857 |
strSQL.Append(", D.PersonName"); |
|
858 |
strSQL.Append(", E.SecRank"); |
|
859 |
strSQL.Append(" FROM PERSONINCHARGEMASTER as A"); |
|
860 |
strSQL.Append(" LEFT JOIN securitymaster as B ON B.SecCode = A.SecCode"); |
|
861 |
strSQL.Append(", PERSONDEPARTMENTMASTER as C"); |
|
862 |
strSQL.Append(" LEFT JOIN personinchargemaster as D ON D.PersonCode = C.PersonCode"); |
|
863 |
strSQL.Append(" LEFT JOIN securitymaster as E ON E.SecCode = D.SecCode"); |
|
864 |
strSQL.AppendFormat(" WHERE A.PERSONCODE = {0}", PersonCode); |
|
865 |
strSQL.Append(" AND C.DepartmentCode = A.DepartmentCode"); |
|
866 |
strSQL.Append(" AND E.SecRank < B.SecRank"); |
|
862 | 867 |
|
863 | 868 |
ArrayList arData = new ArrayList(); |
864 |
if (!PersonDB.ExecuteReader(strSQL, ref arData)) return false; |
|
869 |
if (!PersonDB.ExecuteReader(strSQL.ToString(), ref arData)) return false;
|
|
865 | 870 |
|
866 |
object[] objLoginUser = null; |
|
867 | 871 |
int wrkPersonCode = 0; |
868 | 872 |
foreach (object[] CurRec in arData) |
869 | 873 |
{ |
870 |
wrkPersonCode = CommonMotions.cnvInt(CurRec[(int)PersonAppData.RangePersonCode]);
|
|
871 |
if (wrkPersonCode == CommonMotions.LoginUserData.PersonCode)
|
|
874 |
wrkPersonCode = CommonMotions.cnvInt(CurRec[(int)PersonAppData.AppPersonCode]);
|
|
875 |
if (wrkPersonCode == CommonMotions.LoginUserData.PersonCode) |
|
872 | 876 |
{ |
873 |
objLoginUser = CurRec;
|
|
877 |
bRet = true;
|
|
874 | 878 |
break; |
875 | 879 |
} |
876 | 880 |
} |
877 | 881 |
|
878 |
// 対象データが無ければアクセスできない |
|
879 |
if (objLoginUser == null) return false; |
|
880 |
|
|
881 |
// 総務はアクセスできる |
|
882 |
int GeneFlg = CommonMotions.cnvInt(objLoginUser[(int)PersonAppData.RangeGeneFlg]); |
|
883 |
if (GeneFlg == (int)CommonDefine.GeneralAffairs.GeneralDep) bRet = true; |
|
884 |
|
|
885 |
// 保護区分ランクがログイン者以下の場合はアクセスできる |
|
886 |
int SecRank = CommonMotions.cnvInt(objLoginUser[(int)PersonAppData.DataSecRank]); |
|
887 |
if (SecRank <= CommonMotions.LoginUserSecurity.SecRank) bRet = true; |
|
888 |
|
|
889 | 882 |
return bRet; |
890 | 883 |
} |
891 | 884 |
catch (Exception ex) |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IODirectAccess.cs | ||
---|---|---|
1 |
using System; |
|
2 |
using System.Collections.Generic; |
|
3 |
using System.Linq; |
|
4 |
using System.Text; |
|
5 |
using System.Collections; |
|
6 |
|
|
7 |
using log4net; |
|
8 |
using MySql.Data.MySqlClient; |
|
9 |
|
|
10 |
using ProcessManagement.DB.MySql; |
|
11 |
using ProcessManagement.DB.Core; |
|
12 |
using ProcessManagement.DataModel; |
|
13 |
|
|
14 |
using ProcessManagement.Common; |
|
15 |
|
|
16 |
namespace ProcessManagement.DB.IOAccess |
|
17 |
{ |
|
18 |
/// <summary> |
|
19 |
/// 直接DBアクセスクラス |
|
20 |
/// </summary> |
|
21 |
public class IODirectAccess : MySqlProcess |
|
22 |
{ |
|
23 |
#region 定義部 |
|
24 |
/// <summary> |
|
25 |
/// log4netログを使用する |
|
26 |
/// </summary> |
|
27 |
private static readonly ILog logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); |
|
28 |
#endregion |
|
29 |
|
|
30 |
#region 定数 |
|
31 |
/// <summary> |
|
32 |
/// フィールド並び |
|
33 |
/// </summary> |
|
34 |
public enum NameColumn |
|
35 |
{ |
|
36 |
CompanyCode = 0, |
|
37 |
TargetDate, |
|
38 |
SeqNo, |
|
39 |
BillPrice, |
|
40 |
EntryDate, |
|
41 |
UpdateDate, |
|
42 |
} |
|
43 |
#endregion |
|
44 |
|
|
45 |
#region コンストラクタ |
|
46 |
/// <summary> |
|
47 |
/// コンストラクタ |
|
48 |
/// </summary> |
|
49 |
/// <param name="ConnectionString"></param> |
|
50 |
public IODirectAccess() |
|
51 |
: base(DBCommon.Instance.DBConnectString) |
|
52 |
{ |
|
53 |
} |
|
54 |
|
|
55 |
#endregion |
|
56 |
} |
|
57 |
} |
branches/src/ProcessManagement/ProcessManagement/DB/IOAccess/IOPaymentApprovalInfo.cs | ||
---|---|---|
61 | 61 |
|
62 | 62 |
#region パブリックメソッド |
63 | 63 |
|
64 |
#region SELECT SQL作成 |
|
64 | 65 |
/// <summary> |
66 |
/// SQL作成 |
|
67 |
/// </summary> |
|
68 |
private string CreateSelectSQL() |
|
69 |
{ |
|
70 |
StringBuilder strcmd = new StringBuilder(); |
|
71 |
try |
|
72 |
{ |
|
73 |
// SQL作成 |
|
74 |
strcmd.Append("SELECT"); |
|
75 |
|
|
76 |
bool bColFirst = true; |
|
77 |
string strWork = string.Empty; |
|
78 |
foreach (var gender in Enum.GetValues(typeof(NameColumn))) |
|
79 |
{ |
|
80 |
strWork = gender.ToString(); |
|
81 |
if (!bColFirst) strcmd.Append(","); |
|
82 |
if (strWork.Equals("EntryDate") || strWork.Equals("UpdateDate")) |
|
83 |
{ |
|
84 |
strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d %H:%i:%s')", strWork); |
|
85 |
} |
|
86 |
else if (strWork.Equals("ApprovalDate")) |
|
87 |
{ |
|
88 |
strcmd.AppendFormat(" DATE_FORMAT({0}, '%Y/%m/%d')", strWork); |
|
89 |
} |
|
90 |
else |
|
91 |
{ |
|
92 |
strcmd.AppendFormat(" {0}", strWork); |
|
93 |
} |
|
94 |
bColFirst = false; |
|
95 |
} |
|
96 |
strcmd.Append(" FROM PaymentApprovalInfo"); |
|
97 |
|
|
98 |
return strcmd.ToString(); |
|
99 |
} |
|
100 |
catch (Exception ex) |
|
101 |
{ |
|
102 |
logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString()); |
|
103 |
return string.Empty; |
|
104 |
} |
|
105 |
} |
|
106 |
#endregion |
|
107 |
|
|
108 |
/// <summary> |
|
65 | 109 |
/// 検索 |
66 | 110 |
/// </summary> |
67 | 111 |
/// <param name="AddSQLString"></param> |
... | ... | |
71 | 115 |
public bool SelectAction(string AddSQLString, ref List<PaymentApprovalInfo> data, bool bConnect = true) |
72 | 116 |
{ |
73 | 117 |
// インターフェース |
74 |
string strcmd = "";
|
|
118 |
StringBuilder strcmd = new StringBuilder();
|
|
75 | 119 |
ArrayList arData = new ArrayList(); |
76 | 120 |
|
77 | 121 |
try |
78 | 122 |
{ |
79 |
// SQL作成(DateTime型が変換できないのでCharに変換しておく) |
|
80 |
strcmd = "SELECT"; |
|
81 |
strcmd += " CompanyCode,TargetDate,SeqNo,LineCount,ApprovalNo,ApprovalPerson,ApprovalPersonName,ApprovalAuthority"; |
|
82 |
strcmd += " ,DATE_FORMAT(ApprovalDate, '%Y/%m/%d')"; |
|
83 |
strcmd += " ,DATE_FORMAT(EntryDate, '%Y/%m/%d %H:%i:%s')"; |
|
84 |
strcmd += " ,DATE_FORMAT(UpdateDate, '%Y/%m/%d %H:%i:%s')"; |
|
85 |
strcmd += " FROM PaymentApprovalInfo"; |
|
86 |
strcmd += AddSQLString; |
|
123 |
// SQL作成 |
|
124 |
strcmd.Append(CreateSelectSQL()); |
|
125 |
strcmd.Append(AddSQLString); |
|
87 | 126 |
|
88 | 127 |
// SQL実行 |
89 |
if (!ExecuteReader(strcmd, ref arData, bConnect)) return false; |
|
128 |
if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
|
|
90 | 129 |
|
91 | 130 |
// データセット |
92 | 131 |
foreach (object[] objwrk in arData) |
... | ... | |
100 | 139 |
} |
101 | 140 |
catch (Exception ex) |
102 | 141 |
{ |
103 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
|
|
142 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message,strcmd.ToString());
|
|
104 | 143 |
return false; |
105 | 144 |
} |
106 | 145 |
|
107 | 146 |
} |
108 | 147 |
|
109 | 148 |
/// <summary> |
149 |
/// 検索(1件) |
|
150 |
/// </summary> |
|
151 |
/// <param name="AddSQLString"></param> |
|
152 |
/// <param name="data"></param> |
|
153 |
/// <param name="bConnect"></param> |
|
154 |
/// <returns></returns> |
|
155 |
public bool SelectAction(string AddSQLString, ref PaymentApprovalInfo data, bool bConnect = true) |
|
156 |
{ |
|
157 |
// インターフェース |
|
158 |
StringBuilder strcmd = new StringBuilder(); |
|
159 |
ArrayList arData = new ArrayList(); |
|
160 |
|
|
161 |
try |
|
162 |
{ |
|
163 |
// SQL作成 |
|
164 |
strcmd.Append(CreateSelectSQL()); |
|
165 |
strcmd.Append(AddSQLString); |
|
166 |
|
|
167 |
// SQL実行 |
|
168 |
if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false; |
|
169 |
|
|
170 |
// データセット |
|
171 |
foreach (object[] objwrk in arData) |
|
172 |
{ |
|
173 |
Reader2Struct(objwrk, ref data); |
|
174 |
break; |
|
175 |
} |
|
176 |
|
|
177 |
return true; |
|
178 |
} |
|
179 |
catch (Exception ex) |
|
180 |
{ |
|
181 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString()); |
|
182 |
return false; |
|
183 |
} |
|
184 |
|
|
185 |
} |
|
186 |
|
|
187 |
/// <summary> |
|
110 | 188 |
/// 新規登録 |
111 | 189 |
/// </summary> |
112 | 190 |
/// <param name="data"></param> |
... | ... | |
114 | 192 |
/// <returns></returns> |
115 | 193 |
public bool InsertAction(List<PaymentApprovalInfo> data, bool bConnect = true) |
116 | 194 |
{ |
117 |
string strcmd = "";
|
|
195 |
StringBuilder strcmd = new StringBuilder();
|
|
118 | 196 |
try |
119 | 197 |
{ |
120 | 198 |
|
121 | 199 |
foreach (PaymentApprovalInfo work in data) |
122 | 200 |
{ |
123 |
strcmd = "INSERT INTO PaymentApprovalInfo";
|
|
201 |
strcmd.Append("INSERT INTO PaymentApprovalInfo");
|
|
124 | 202 |
|
125 |
strcmd += " VALUES (";
|
|
203 |
strcmd.Append(" VALUES (");
|
|
126 | 204 |
|
127 |
strcmd += string.Format(" {0}", work.CompanyCode.ToString());
|
|
128 |
strcmd += string.Format(", {0}", work.TargetDate.ToString());
|
|
129 |
strcmd += string.Format(", {0}", work.SeqNo.ToString());
|
|
130 |
strcmd += string.Format(", {0}", work.LineCount.ToString());
|
|
131 |
strcmd += string.Format(", {0}", work.ApprovalNo.ToString());
|
|
132 |
strcmd += string.Format(", {0}", work.ApprovalPerson.ToString());
|
|
133 |
strcmd += string.Format(", '{0}'", work.ApprovalPersonName);
|
|
134 |
strcmd += string.Format(", {0}", work.ApprovalAuthority.ToString());
|
|
135 |
strcmd += string.Format(", STR_TO_DATE('{0}','%Y/%m/%d')", work.ApprovalDate.ToShortDateString());
|
|
205 |
strcmd.AppendFormat(" {0}", work.CompanyCode.ToString());
|
|
206 |
strcmd.AppendFormat(", {0}", work.TargetDate.ToString());
|
|
207 |
strcmd.AppendFormat(", {0}", work.SeqNo.ToString());
|
|
208 |
strcmd.AppendFormat(", {0}", work.LineCount.ToString());
|
|
209 |
strcmd.AppendFormat(", {0}", work.ApprovalNo.ToString());
|
|
210 |
strcmd.AppendFormat(", {0}", work.ApprovalPerson.ToString());
|
|
211 |
strcmd.AppendFormat(", '{0}'", work.ApprovalPersonName);
|
|
212 |
strcmd.AppendFormat(", {0}", work.ApprovalAuthority.ToString());
|
|
213 |
strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')", work.ApprovalDate.ToShortDateString());
|
|
136 | 214 |
|
137 |
strcmd += ", NOW()";
|
|
138 |
strcmd += ", NOW()";
|
|
139 |
strcmd += ")";
|
|
215 |
strcmd.Append(", NOW()");
|
|
216 |
strcmd.Append(", NOW()");
|
|
217 |
strcmd.Append(")");
|
|
140 | 218 |
|
141 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
|
219 |
if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
|
|
142 | 220 |
} |
143 | 221 |
return true; |
144 | 222 |
} |
145 | 223 |
catch (Exception ex) |
146 | 224 |
{ |
147 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
|
|
225 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message,strcmd.ToString());
|
|
148 | 226 |
return false; |
149 | 227 |
} |
150 | 228 |
} |
151 | 229 |
|
152 | 230 |
/// <summary> |
231 |
/// 新規登録(1件) |
|
232 |
/// </summary> |
|
233 |
/// <param name="data"></param> |
|
234 |
/// <param name="bConnect"></param> |
|
235 |
/// <returns></returns> |
|
236 |
public bool InsertAction(PaymentApprovalInfo data, bool bConnect = true) |
|
237 |
{ |
|
238 |
StringBuilder strcmd = new StringBuilder(); |
|
239 |
try |
|
240 |
{ |
|
241 |
|
|
242 |
strcmd.Append("INSERT INTO PaymentApprovalInfo"); |
|
243 |
strcmd.Append("("); |
|
244 |
bool bFirst = true; |
|
245 |
foreach (var gender in Enum.GetValues(typeof(NameColumn))) |
|
246 |
{ |
|
247 |
if (!bFirst) strcmd.Append(" ,"); |
|
248 |
strcmd.Append(gender.ToString()); |
|
249 |
bFirst = false; |
|
250 |
} |
|
251 |
strcmd.Append(") VALUES ("); |
|
252 |
|
|
253 |
strcmd.AppendFormat(" {0}", data.CompanyCode.ToString()); |
|
254 |
strcmd.AppendFormat(", {0}", data.TargetDate.ToString()); |
|
255 |
strcmd.AppendFormat(", {0}", data.SeqNo.ToString()); |
|
256 |
strcmd.AppendFormat(", {0}", data.LineCount.ToString()); |
|
257 |
strcmd.AppendFormat(", {0}", data.ApprovalNo.ToString()); |
|
258 |
strcmd.AppendFormat(", {0}", data.ApprovalPerson.ToString()); |
|
259 |
strcmd.AppendFormat(", '{0}'", data.ApprovalPersonName); |
|
260 |
strcmd.AppendFormat(", {0}", data.ApprovalAuthority.ToString()); |
|
261 |
strcmd.AppendFormat(", STR_TO_DATE('{0}','%Y/%m/%d')", data.ApprovalDate.ToShortDateString()); |
|
262 |
|
|
263 |
strcmd.Append(", NOW()"); |
|
264 |
strcmd.Append(", NOW()"); |
|
265 |
strcmd.Append(")"); |
|
266 |
|
|
267 |
if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false; |
|
268 |
|
|
269 |
return true; |
|
270 |
} |
|
271 |
catch (Exception ex) |
|
272 |
{ |
|
273 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd.ToString()); |
|
274 |
return false; |
|
275 |
} |
|
276 |
} |
|
277 |
|
|
278 |
/// <summary> |
|
153 | 279 |
/// 更新登録 |
154 | 280 |
/// </summary> |
155 | 281 |
/// <param name="AddSQLString"></param> |
... | ... | |
158 | 284 |
/// <returns></returns> |
159 | 285 |
public bool UpdateAction(string AddSQLString, PaymentApprovalInfo data, bool bConnect = true) |
160 | 286 |
{ |
161 |
string strcmd = "";
|
|
287 |
StringBuilder strcmd = new StringBuilder();
|
|
162 | 288 |
try |
163 | 289 |
{ |
164 | 290 |
|
165 |
strcmd = "UPDATE PaymentApprovalInfo";
|
|
291 |
strcmd.Append("UPDATE PaymentApprovalInfo");
|
|
166 | 292 |
|
167 |
strcmd += " SET";
|
|
293 |
strcmd.Append(" SET");
|
|
168 | 294 |
|
169 |
strcmd += string.Format(" ApprovalPerson = {0}", data.ApprovalPerson.ToString());
|
|
170 |
strcmd += string.Format(",ApprovalPersonName = '{0}'", data.ApprovalPersonName);
|
|
171 |
strcmd += string.Format(",ApprovalAuthority = {0}", data.ApprovalAuthority.ToString());
|
|
172 |
strcmd += string.Format(",ApprovalDate = STR_TO_DATE('{0}','%Y/%m/%d')", data.ApprovalDate.ToShortDateString());
|
|
295 |
strcmd.AppendFormat(" ApprovalPerson = {0}", data.ApprovalPerson.ToString());
|
|
296 |
strcmd.AppendFormat(",ApprovalPersonName = '{0}'", data.ApprovalPersonName);
|
|
297 |
strcmd.AppendFormat(",ApprovalAuthority = {0}", data.ApprovalAuthority.ToString());
|
|
298 |
strcmd.AppendFormat(",ApprovalDate = STR_TO_DATE('{0}','%Y/%m/%d')", data.ApprovalDate.ToShortDateString());
|
|
173 | 299 |
|
174 |
strcmd += ", UpdateDate = NOW()";
|
|
175 |
strcmd += AddSQLString;
|
|
300 |
strcmd.Append(", UpdateDate = NOW()");
|
|
301 |
strcmd.Append(AddSQLString);
|
|
176 | 302 |
|
177 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
|
303 |
if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
|
|
178 | 304 |
|
179 | 305 |
return true; |
180 | 306 |
} |
181 | 307 |
catch (Exception ex) |
182 | 308 |
{ |
183 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
|
|
309 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message,strcmd.ToString());
|
|
184 | 310 |
return false; |
185 | 311 |
} |
186 | 312 |
} |
... | ... | |
194 | 320 |
public bool DeleteAction(string AddSQLString, bool bConnect = true) |
195 | 321 |
{ |
196 | 322 |
// インターフェース |
197 |
string strcmd = "";
|
|
323 |
StringBuilder strcmd = new StringBuilder();
|
|
198 | 324 |
try |
199 | 325 |
{ |
200 |
strcmd = string.Format("{0}{1}", "DELETE FROM PaymentApprovalInfo", AddSQLString);
|
|
326 |
strcmd.AppendFormat("{0}{1}", "DELETE FROM PaymentApprovalInfo", AddSQLString);
|
|
201 | 327 |
|
202 |
if (!ExecuteNonQuery(strcmd, bConnect)) return false; |
|
328 |
if (!ExecuteNonQuery(strcmd.ToString(), bConnect)) return false;
|
|
203 | 329 |
|
204 | 330 |
return true; |
205 | 331 |
} |
206 | 332 |
catch (Exception ex) |
207 | 333 |
{ |
208 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
|
|
334 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message,strcmd.ToString());
|
|
209 | 335 |
return false; |
210 | 336 |
} |
211 | 337 |
} |
... | ... | |
255 | 381 |
{ |
256 | 382 |
|
257 | 383 |
//インターフェース |
258 |
string strcmd = "";
|
|
384 |
StringBuilder strcmd = new StringBuilder();
|
|
259 | 385 |
ArrayList arData = new ArrayList(); |
260 | 386 |
|
261 | 387 |
try |
262 | 388 |
{ |
263 |
strcmd = string.Format("select * from PaymentApprovalInfo Where CompanyCode = {0} and TargetDate = {1} and SeqNo = {2} and LineCount = {3} and ApprovalNo = {4} for update;",
|
|
389 |
strcmd.AppendFormat("select * from PaymentApprovalInfo Where CompanyCode = {0} and TargetDate = {1} and SeqNo = {2} and LineCount = {3} and ApprovalNo = {4} for update;",
|
|
264 | 390 |
CompanyCode, TargetDate, SeqNo, LineCount, ApprovalNo); |
265 | 391 |
|
266 | 392 |
// SQL実行 |
267 |
if (!ExecuteReader(strcmd, ref arData, bConnect)) return false; |
|
393 |
if (!ExecuteReader(strcmd.ToString(), ref arData, bConnect)) return false;
|
|
268 | 394 |
|
269 | 395 |
return true; |
270 | 396 |
} |
271 | 397 |
catch (Exception ex) |
272 | 398 |
{ |
273 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strcmd);
|
|
399 |
logger.ErrorFormat("システムエラー::{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message,strcmd.ToString());
|
|
274 | 400 |
return false; |
275 | 401 |
} |
276 | 402 |
|
... | ... | |
279 | 405 |
|
280 | 406 |
public string CreatePrimarykeyString(int CompanyCode, int TargetDate, int SeqNo, int LineCount, int ApprovalNo) |
281 | 407 |
{ |
282 |
string strWork = string.Empty;
|
|
408 |
StringBuilder strWork = new StringBuilder();
|
|
283 | 409 |
try |
284 | 410 |
{ |
285 |
strWork = string.Format(" Where CompanyCode = {0} and TargetDate = {1} and SeqNo = {2} and LineCount = {3} and ApprovalNo = {4}", CompanyCode, TargetDate, SeqNo, LineCount,ApprovalNo);
|
|
411 |
strWork.AppendFormat(" Where CompanyCode = {0} and TargetDate = {1} and SeqNo = {2} and LineCount = {3} and ApprovalNo = {4}", CompanyCode, TargetDate, SeqNo, LineCount,ApprovalNo);
|
|
286 | 412 |
|
287 | 413 |
} |
288 | 414 |
catch (Exception ex) |
289 | 415 |
{ |
290 |
logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork); |
|
416 |
logger.ErrorFormat("システムエラー:{0}:{1}:{2}", CommonMotions.GetMethodName(2), ex.Message, strWork.ToString());
|
|
291 | 417 |
} |
292 | 418 |
|
293 |
return strWork; |
|
419 |
return strWork.ToString();
|
|
294 | 420 |
} |
295 | 421 |
|
296 | 422 |
#endregion |
branches/src/ProcessManagement/ProcessManagement/DataModel/PaymentApprovalInfo.cs | ||
---|---|---|
9 | 9 |
public class PaymentApprovalInfo |
10 | 10 |
{ |
11 | 11 |
#region メンバ変数 |
12 |
private int m_CompanyCode = 0; // 協力会社コード
|
|
13 |
private int m_TargetDate = 0; // 対象年月
|
|
14 |
private int m_SeqNo = 0; // 連番
|
|
15 |
private int m_LineCount = 0; // 行番号
|
|
16 |
private int m_ApprovalNo = 0; // 承認順序 |
|
17 |
private int m_ApprovalPersonCode = 0; // 承認者コード
|
|
18 |
private string m_ApprovalPersonName = ""; // 承認者名
|
|
19 |
private int m_ApprovalAuthority = 0; // 承認権限区分
|
|
20 |
private DateTime m_ApprovalDate = DateTime.Now;// 承認日付
|
|
21 |
private DateTime m_EntryDate = DateTime.Now; // 登録日付
|
|
22 |
private DateTime m_UpdateDate = DateTime.Now; // 更新日付
|
|
12 |
private int m_CompanyCode = 0; // 協力会社コード
|
|
13 |
private int m_TargetDate = 0; // 対象年月
|
|
14 |
private int m_SeqNo = 0; // 連番
|
|
15 |
private int m_LineCount = 0; // 行番号
|
|
16 |
private int m_ApprovalNo = 0; // 承認順序
|
|
17 |
private int m_ApprovalPersonCode = 0; // 承認者コード
|
|
18 |
private string m_ApprovalPersonName = ""; // 承認者名
|
|
19 |
private int m_ApprovalAuthority = 0; // 承認権限区分
|
|
20 |
private DateTime m_ApprovalDate = DateTime.Now; // 承認日付
|
|
21 |
private DateTime m_EntryDate = DateTime.Now; // 登録日付
|
|
22 |
private DateTime m_UpdateDate = DateTime.Now; // 更新日付
|
|
23 | 23 |
#endregion |
24 | 24 |
|
25 | 25 |
#region コンストラクタ |
branches/src/ProcessManagement/ProcessManagement/DataModel/PaymentDataDetail.cs | ||
---|---|---|
9 | 9 |
public class PaymentDataDetail |
10 | 10 |
{ |
11 | 11 |
#region メンバ変数 |
12 |
private int m_CompanyCode = 0; // 協力会社コード
|
|
13 |
private int m_TargetDate = 0; // 対象年月
|
|
14 |
private int m_SeqNo = 0; // 連番
|
|
15 |
private int m_LineCount = 0; // 行番号
|
|
16 |
private long m_BillPrice = 0; // 請求金額
|
|
17 |
private long m_DiscountPrice = 0; // 値引き金額
|
|
18 |
private long m_OffsetPrice = 0; // 相殺金額
|
|
19 |
private long m_NextCoPrice = 0; // 次回繰越
|
|
20 |
private long m_HighwPrice = 0; // 高速代
|
|
21 |
private long m_HardwPrice = 0; // 金物代
|
|
22 |
private long m_IndsWasteTax = 0; // 産廃税
|
|
23 |
private long m_CnstrPrice = 0; // 協力金
|
|
24 |
private int m_CnstrPriceExist =0; // 協力金有無
|
|
25 |
private int m_ApprovalPersonCode = 0;// 承認担当者コード
|
|
26 |
private DateTime m_ApprovalDate = DateTime.Now;// 担当者承認日付
|
|
27 |
private int m_ApprovalEndFlg = 0; // 承認完了フラグ
|
|
28 |
private DateTime m_EntryDate = DateTime.Now; // 登録日付
|
|
29 |
private DateTime m_UpdateDate = DateTime.Now; // 更新日付
|
|
12 |
private int m_CompanyCode = 0; // 協力会社コード
|
|
13 |
private int m_TargetDate = 0; // 対象年月
|
|
14 |
private int m_SeqNo = 0; // 連番
|
|
15 |
private int m_LineCount = 0; // 行番号
|
|
16 |
private long m_BillPrice = 0; // 請求金額
|
|
17 |
private long m_DiscountPrice = 0; // 値引き金額
|
|
18 |
private long m_OffsetPrice = 0; // 相殺金額
|
|
19 |
private long m_NextCoPrice = 0; // 次回繰越
|
|
20 |
private long m_HighwPrice = 0; // 高速代
|
|
21 |
private long m_HardwPrice = 0; // 金物代
|
|
22 |
private long m_IndsWasteTax = 0; // 産廃税
|
|
23 |
private long m_CnstrPrice = 0; // 協力金
|
|
24 |
private int m_CnstrPriceExist =0; // 協力金有無
|
|
25 |
private int m_ApprovalPersonCode = 0; // 承認担当者コード
|
|
26 |
private DateTime m_ApprovalDate = DateTime.Now; // 担当者承認日付
|
|
27 |
private int m_ApprovalEndFlg = 0; // 承認完了フラグ
|
|
28 |
private DateTime m_EntryDate = DateTime.Now; // 登録日付
|
|
29 |
private DateTime m_UpdateDate = DateTime.Now; // 更新日付
|
|
30 | 30 |
|
31 | 31 |
#endregion |
32 | 32 |
|
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalPerson/FrmAppManAux.cs | ||
---|---|---|
48 | 48 |
// 10:協力会社登録承認 |
49 | 49 |
CreateSubConstrData(); |
50 | 50 |
break; |
51 |
case (int)ClsExcute.ApprovalListNo.FeePayment: |
|
52 |
// 11:手間支払 |
|
53 |
break; |
|
54 |
case (int)ClsExcute.ApprovalListNo.SubConstrPayment: |
|
55 |
// 12:業者支払 |
|
56 |
break; |
|
57 |
default: |
|
58 |
break; |
|
51 | 59 |
} |
52 | 60 |
} |
53 | 61 |
catch (Exception ex) |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalPerson/FrmApprovalPerson.cs | ||
---|---|---|
133 | 133 |
/// ???F?o?H?}?X?^?? |
134 | 134 |
/// </summary> |
135 | 135 |
private List<ApprovalMaster> m_ApprovalList = new List<ApprovalMaster>(); |
136 |
/// <summary> |
|
137 |
/// ?I?u?W?F?N?g?l?z??p?????[?^ |
|
138 |
/// </summary> |
|
139 |
private List<ArrayList> m_ArrayParam = new List<ArrayList>(); |
|
136 | 140 |
#endregion |
137 | 141 |
|
138 | 142 |
#region ?v???p?e?B |
... | ... | |
184 | 188 |
get { return m_SearchSeqNo; } |
185 | 189 |
set { m_SearchSeqNo = value; } |
186 | 190 |
} |
191 |
/// <summary> |
|
192 |
/// ?I?u?W?F?N?g?l?z??p?????[?^ |
|
193 |
/// </summary> |
|
194 |
public List<ArrayList> ArrayParam |
|
195 |
{ |
|
196 |
get { return m_ArrayParam; } |
|
197 |
set { m_ArrayParam = value; } |
|
198 |
} |
|
187 | 199 |
|
188 | 200 |
#endregion |
189 | 201 |
|
... | ... | |
542 | 554 |
// ?R?????g???c??????????? |
543 | 555 |
RemoveCommentData(); |
544 | 556 |
|
545 |
// ?\?????f?[?^???t??????Z?b?g????
|
|
546 |
SetApprovalOrderNo((int)CommonDefine.ApprovalStatus.Petition);
|
|
557 |
// ?\???????????????
|
|
558 |
PettionNextProcess((int)CommonDefine.ApprovalStatus.Petition);
|
|
547 | 559 |
|
548 | 560 |
// ???????b?Z?[?W |
549 | 561 |
CommonMotions.EntryEndMessage("?S????\???f?[?^", "?\??"); |
... | ... | |
602 | 614 |
|
603 | 615 |
pAppDB.commit(); |
604 | 616 |
|
605 |
// ----- ?f?[?^?X?V???? |
|
606 |
if (!SorceDataBuild((int)CommonDefine.ApprovalStatus.Petition)) return; |
|
607 |
|
|
608 | 617 |
// ???????b?Z?[?W |
609 | 618 |
CommonMotions.EntryEndMessage("?S????\???f?[?^??\??", "??\??"); |
610 | 619 |
|
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/ApprovalPerson/FrmApprovalPersonAuxiliary.cs | ||
---|---|---|
75 | 75 |
} |
76 | 76 |
#endregion |
77 | 77 |
|
78 |
#region 承認時データ更新処理
|
|
78 |
#region 申請時データ更新処理
|
|
79 | 79 |
/// <summary> |
80 |
/// 承認時にデータを更新する
|
|
80 |
/// 申請時にデータを更新する
|
|
81 | 81 |
/// </summary> |
82 | 82 |
/// <param name="Rec"></param> |
83 | 83 |
/// <returns></returns> |
... | ... | |
144 | 144 |
// 最終承認が成された後の処理 |
145 | 145 |
ApprovalNextProcess(); |
146 | 146 |
} |
147 |
// 手間・業者支払は支払承認レコードを作成する |
|
148 |
if (m_ApprovalCode == (int)ClsExcute.ApprovalListNo.FeePayment |
|
149 |
|| m_ApprovalCode == (int)ClsExcute.ApprovalListNo.SubConstrPayment) |
|
150 |
{ |
|
151 |
ApprovalFeePayment(); |
|
152 |
} |
|
147 | 153 |
break; |
148 | 154 |
default: |
149 | 155 |
// ----- 承認以外 |
150 | 156 |
ClsApprovalPermission.SetPrimaryRecStatus(m_PersonCode, m_ApprovalCode, m_OrderDate, m_OrderNo, (int)CommonDefine.ApprovalStatus.NotApproval); |
151 | 157 |
break; |
152 | 158 |
} |
153 |
// ----- データ更新処理 |
|
154 |
if (!SorceDataBuild(statusCode)) return false; |
|
155 | 159 |
|
156 | 160 |
return true; |
157 | 161 |
} |
... | ... | |
347 | 351 |
// 申請・承認以外は申請ボタンを表示する |
348 | 352 |
switch (ApprovalStatus) |
349 | 353 |
{ |
350 |
case (int)CommonDefine.ApprovalStatus.Petition: // 申請 |
|
351 |
case (int)CommonDefine.ApprovalStatus.Pending: // 保留 |
|
352 |
case (int)CommonDefine.ApprovalStatus.Approval: // 承認 |
|
353 |
case (int)CommonDefine.ApprovalStatus.NotApproval: // 不承認 |
|
354 |
btnPetition.Visible = false; // 申請ボタン |
|
354 |
case (int)CommonDefine.ApprovalStatus.Petition: |
|
355 |
// ----- 申請 |
|
356 |
case (int)CommonDefine.ApprovalStatus.Pending: |
|
357 |
// ----- 保留 |
|
358 |
case (int)CommonDefine.ApprovalStatus.Approval: |
|
359 |
// ----- 承認 |
|
360 |
case (int)CommonDefine.ApprovalStatus.NotApproval: |
|
361 |
// ----- 不承認 |
|
362 |
|
|
363 |
btnPetition.Visible = false; // 申請ボタン |
|
355 | 364 |
|
356 |
// 注文書承認は承認取り消しがある |
|
365 |
// ----- 注文書承認は承認取り消しがある
|
|
357 | 366 |
switch (m_ApprovalCode) |
358 | 367 |
{ |
359 | 368 |
case (int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval: |
... | ... | |
372 | 381 |
break; |
373 | 382 |
} |
374 | 383 |
|
375 |
txtHoppesDate.Enabled = false; // 承認希望日 |
|
384 |
txtHoppesDate.Enabled = false; // 承認希望日
|
|
376 | 385 |
|
377 |
btnApproval.Visible = true; // 承認ボタン |
|
378 |
btnNotApproval.Visible = true; // 不承認ボタン |
|
379 |
btnOnHold.Visible = true; // 保留ボタン |
|
386 |
btnApproval.Visible = true; // 承認ボタン
|
|
387 |
btnNotApproval.Visible = true; // 不承認ボタン
|
|
388 |
btnOnHold.Visible = true; // 保留ボタン
|
|
380 | 389 |
break; |
381 |
case (int)CommonDefine.ApprovalStatus.Undecided: // 未定 |
|
382 |
case (int)CommonDefine.ApprovalStatus.Unclaimed: // 未申請 |
|
383 |
btnPetition.Visible = true; // 申請ボタン |
|
390 |
case (int)CommonDefine.ApprovalStatus.Undecided: |
|
391 |
// ----- 未定 |
|
392 |
case (int)CommonDefine.ApprovalStatus.Unclaimed: |
|
393 |
// ----- 未申請 |
|
394 |
btnPetition.Visible = true; // 申請ボタン |
|
384 | 395 |
btnPetition.Left = s_ButtonPosition[2].X; |
385 | 396 |
btnPetition.Top = s_ButtonPosition[2].Y; |
386 | 397 |
|
387 |
btnRePetition.Visible = false; // 再申請ボタン |
|
388 |
btnNotPetition.Visible = false; // 申請取消ボタン |
|
398 |
btnRePetition.Visible = false; // 再申請ボタン
|
|
399 |
btnNotPetition.Visible = false; // 申請取消ボタン
|
|
389 | 400 |
|
390 |
txtHoppesDate.Enabled = true; // 承認希望日 |
|
401 |
txtHoppesDate.Enabled = true; // 承認希望日
|
|
391 | 402 |
|
392 |
btnApproval.Visible = false; // 承認ボタン |
|
393 |
btnNotApproval.Visible = false; // 不承認ボタン |
|
394 |
btnOnHold.Visible = false; // 保留ボタン |
|
403 |
btnApproval.Visible = false; // 承認ボタン
|
|
404 |
btnNotApproval.Visible = false; // 不承認ボタン
|
|
405 |
btnOnHold.Visible = false; // 保留ボタン
|
|
395 | 406 |
break; |
396 | 407 |
} |
397 | 408 |
} |
... | ... | |
786 | 797 |
/// 申請元データに受付番号をセットする |
787 | 798 |
/// </summary> |
788 | 799 |
/// <returns></returns> |
789 |
private bool SetApprovalOrderNo(int AppAction)
|
|
800 |
private bool PettionNextProcess(int AppAction)
|
|
790 | 801 |
{ |
791 | 802 |
IOPersonApproval AppDB = new IOPersonApproval(); |
792 | 803 |
try |
... | ... | |
796 | 807 |
switch (m_ApprovalCode) |
797 | 808 |
{ |
798 | 809 |
case (int)ClsExcute.ApprovalListNo.DRWorkApproval: |
810 |
// 出勤日報データ |
|
799 | 811 |
strSQL.AppendFormat("UPDATE ATTENDANCEDATA SET ORDERDATE = STR_TO_DATE('{0}','%Y/%m/%d'),", m_OrderDate.ToShortDateString()); |
800 | 812 |
strSQL.AppendFormat(" ORDERNO = {0}", m_OrderNo); |
801 |
strSQL.AppendFormat(" WHERE PersonCode = {0}",m_PersonCode); |
|
813 |
strSQL.AppendFormat(" WHERE PersonCode = {0}", m_PersonCode);
|
|
802 | 814 |
strSQL.AppendFormat(" AND DATE(AttendanceMonth) = STR_TO_DATE('{0}' ,'%Y/%m/%d')", m_SearchDate.ToShortDateString()); |
815 |
if (!AppDB.ExecuteNonQuery(strSQL.ToString())) return false; |
|
803 | 816 |
break; |
804 | 817 |
case (int)ClsExcute.ApprovalListNo.CostomerRegistApproval: |
818 |
// 発注者登録申請 |
|
805 | 819 |
strSQL.AppendFormat("UPDATE COSTOMERREGIST SET ORDERDATE = STR_TO_DATE('{0}','%Y/%m/%d'),", m_OrderDate.ToShortDateString()); |
806 | 820 |
strSQL.AppendFormat(" ORDERNO = {0}", m_OrderNo); |
807 | 821 |
strSQL.AppendFormat(" WHERE PersonCode = {0}", m_PersonCode); |
808 | 822 |
strSQL.AppendFormat(" AND DATE(CREATEDATE) = STR_TO_DATE('{0}' ,'%Y/%m/%d')", m_SearchDate.ToShortDateString()); |
809 | 823 |
strSQL.AppendFormat(" AND SEQNO = {0}", m_SearchSeqNo); |
824 |
if (!AppDB.ExecuteNonQuery(strSQL.ToString())) return false; |
|
810 | 825 |
break; |
811 | 826 |
case (int)ClsExcute.ApprovalListNo.SubConstregistApproval: |
827 |
// 協力会社登録申請 |
|
812 | 828 |
strSQL.AppendFormat("UPDATE SUBCONSTRREGIST SET ORDERDATE = STR_TO_DATE('{0}','%Y/%m/%d'),", m_OrderDate.ToShortDateString()); |
813 | 829 |
strSQL.AppendFormat(" ORDERNO = {0}", m_OrderNo); |
814 | 830 |
strSQL.AppendFormat(" WHERE PersonCode = {0}", m_PersonCode); |
815 | 831 |
strSQL.AppendFormat(" AND DATE(CREATEDATE) = STR_TO_DATE('{0}' ,'%Y/%m/%d')", m_SearchDate.ToShortDateString()); |
816 | 832 |
strSQL.AppendFormat(" AND SEQNO = {0}", m_SearchSeqNo); |
833 |
if (!AppDB.ExecuteNonQuery(strSQL.ToString())) return false; |
|
817 | 834 |
break; |
818 | 835 |
case (int)ClsExcute.ApprovalListNo.FeePayment: // 手間支払承認 |
819 | 836 |
case (int)ClsExcute.ApprovalListNo.SubConstrPayment: // 業者支払承認 |
820 | 837 |
// 手間・業者支払データ更新・作成処理 |
821 |
if (!ApprovalFeePayment(AppAction)) return false;
|
|
838 |
if (!PettionFeePayment(AppAction)) return false;
|
|
822 | 839 |
break; |
823 | 840 |
default: |
824 | 841 |
break; |
825 | 842 |
} |
826 | 843 |
|
827 |
if (strSQL.ToString().Length == 0) return true; |
|
828 |
|
|
829 |
if (!AppDB.ExecuteNonQuery(strSQL.ToString())) return false; |
|
830 |
|
|
831 | 844 |
return true; |
832 | 845 |
} |
833 | 846 |
catch (System.Exception ex) |
... | ... | |
889 | 902 |
} |
890 | 903 |
#endregion |
891 | 904 |
|
892 |
#region 元データの更新処理
|
|
905 |
#region 申請時:手間・業者支払データ作成処理
|
|
893 | 906 |
/// <summary> |
894 |
/// 元データの更新処理
|
|
907 |
/// 申請時:手間・業者支払データ作成処理
|
|
895 | 908 |
/// </summary> |
896 | 909 |
/// <returns></returns> |
897 |
private bool SorceDataBuild(int AppAction)
|
|
910 |
private bool PettionFeePayment(int AppAction)
|
|
898 | 911 |
{ |
899 |
try |
|
900 |
{ |
|
901 |
switch (m_ApprovalCode) |
|
902 |
{ |
|
903 |
case (int)ClsExcute.ApprovalListNo.FeePayment: // 手間支払承認 |
|
904 |
case (int)ClsExcute.ApprovalListNo.SubConstrPayment: // 業者支払承認 |
|
905 |
// 手間・業者支払データ更新・作成処理 |
|
906 |
if (!ApprovalFeePayment(AppAction)) return false; |
|
907 |
break; |
|
908 |
default: |
|
909 |
break; |
|
910 |
} |
|
911 |
|
|
912 |
return true; |
|
913 |
} |
|
914 |
catch (System.Exception ex) |
|
915 |
{ |
|
916 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
917 |
return false; |
|
918 |
} |
|
919 |
} |
|
920 |
#endregion |
|
921 |
|
|
922 |
#region 手間・業者支払データ更新・作成処理 |
|
923 |
/// <summary> |
|
924 |
/// 手間・業者支払データ更新・作成処理 |
|
925 |
/// </summary> |
|
926 |
/// <returns></returns> |
|
927 |
private bool ApprovalFeePayment(int AppAction) |
|
928 |
{ |
|
929 | 912 |
IOPaymentDataDetail PayDetailDB = new IOPaymentDataDetail(); |
930 | 913 |
IOPaymentApprovalInfo PayAppDB = new IOPaymentApprovalInfo(); |
931 | 914 |
try |
932 | 915 |
{ |
916 |
PayDetailDB.connect(); PayDetailDB.beginTran(); |
|
917 |
PayAppDB.connect(); PayAppDB.beginTran(); |
|
918 |
|
|
933 | 919 |
// 手間・業者支払承認情報取得 |
934 |
int NowPoint = ClsExcute.GetNowProcessPoint(); |
|
935 |
List<ArrayList> Arlist = ClsExcute.ProcControlPara[NowPoint].ArrayParameter; |
|
936 |
|
|
937 | 920 |
bool bSuccess = true; |
938 |
for (int i = 0; i < Arlist.Count; i++) |
|
921 |
int nBCompanyCode = 0; // 協力会社コード |
|
922 |
int nBTargetDate = 0; // 対象年月 |
|
923 |
int nBSeqNo = 0; // 連番 |
|
924 |
int nBLineCount = 0; // 行番号 |
|
925 |
ArrayList arData = m_ArrayParam[0]; |
|
926 |
for (int i = 0; i < arData.Count; i++) |
|
939 | 927 |
{ |
940 |
ArrayList arData = Arlist[i]; |
|
941 |
PaymentApprovalInfo PaIWork = (PaymentApprovalInfo)arData[0]; |
|
928 |
PaymentApprovalInfo PaIWork = (PaymentApprovalInfo)arData[i]; |
|
942 | 929 |
|
943 |
if (AppAction == (int)CommonDefine.ApprovalStatus.Petition) |
|
944 |
{ // 申請時のみ |
|
930 |
if (nBCompanyCode == PaIWork.CompanyCode // 協力会社コード |
|
931 |
&& nBTargetDate == PaIWork.TargetDate // 対象年月 |
|
932 |
&& nBLineCount == PaIWork.LineCount) // 行番号 |
|
933 |
{ |
|
934 |
} |
|
935 |
else |
|
936 |
{ |
|
945 | 937 |
// 業者請求明細データ更新 |
946 | 938 |
if (!PaymentDataDetailUpdate(PayDetailDB, PaIWork)) |
947 | 939 |
{ |
948 | 940 |
bSuccess = false; |
949 | 941 |
break; |
950 | 942 |
} |
943 |
|
|
944 |
nBCompanyCode = PaIWork.CompanyCode; |
|
945 |
nBTargetDate = PaIWork.TargetDate; |
|
946 |
nBLineCount = PaIWork.LineCount; |
|
947 |
nBSeqNo = 0; |
|
951 | 948 |
} |
952 | 949 |
|
953 |
if (AppAction == (int)CommonDefine.ApprovalStatus.Petition
|
|
954 |
|| AppAction == (int)CommonDefine.ApprovalStatus.Approval)
|
|
950 |
// 支払承認情報データ作成
|
|
951 |
if (!PaymentApprovalInfoCreate(PayAppDB, PaIWork, ++nBSeqNo))
|
|
955 | 952 |
{ |
956 |
// 支払承認情報データ作成 |
|
957 |
if (!PaymentApprovalInfoCreate(PayAppDB, PaIWork)) |
|
958 |
{ |
|
959 |
bSuccess = false; |
|
960 |
break; |
|
961 |
} |
|
953 |
bSuccess = false; |
|
954 |
break; |
|
962 | 955 |
} |
963 |
else |
|
964 |
{ |
|
965 |
// 支払承認情報データ削除 |
|
966 |
if (!PaymentApprovalInfoRemove(PayAppDB, PaIWork)) |
|
967 |
{ |
|
968 |
bSuccess = false; |
|
969 |
break; |
|
970 |
} |
|
971 |
} |
|
972 | 956 |
} |
973 | 957 |
if (!bSuccess) |
974 | 958 |
{ |
... | ... | |
992 | 976 |
} |
993 | 977 |
#endregion |
994 | 978 |
|
995 |
#region 支払明細データ更新 |
|
979 |
#region 申請時:支払明細データ更新
|
|
996 | 980 |
/// <summary> |
997 |
/// 支払明細データ更新 |
|
981 |
/// 申請時:支払明細データ更新
|
|
998 | 982 |
/// </summary> |
999 | 983 |
/// <returns></returns> |
1000 |
private bool PaymentDataDetailUpdate(IOPaymentDataDetail PayDetailDB, PaymentApprovalInfo PaIWork) |
|
984 |
private bool PaymentDataDetailUpdate(IOPaymentDataDetail PayDetailDB, |
|
985 |
PaymentApprovalInfo PaIWork) |
|
1001 | 986 |
{ |
1002 | 987 |
try |
1003 | 988 |
{ |
1004 | 989 |
StringBuilder strSQL = new StringBuilder(); |
1005 |
|
|
1006 |
strSQL.Clear(); |
|
990 |
// 支払明細データ更新 |
|
1007 | 991 |
strSQL.Append("UPDATE paymentdatadetail SET"); |
1008 |
strSQL.AppendFormat(" APPROVALPERSONCODE = {0}", PaIWork.ApprovalPerson); // 承認担当者コード
|
|
992 |
strSQL.AppendFormat(" APPROVALPERSONCODE = {0}", CommonMotions.LoginUserData.PersonCode); // 承認担当者コード
|
|
1009 | 993 |
strSQL.AppendFormat(", APPROVALDATE = STR_TO_DATE('{0}','%Y/%m/%d')" |
1010 |
, DateTime.Now.ToShortDateString()); // 担当者承認日付 |
|
1011 |
strSQL.Append(", APPROVALENDFLG = 1"); // 承認完了フラグ |
|
994 |
, DateTime.Now.ToShortDateString()); // 担当者承認日付
|
|
995 |
strSQL.Append(", APPROVALENDFLG = 1"); // 承認完了フラグ
|
|
1012 | 996 |
strSQL.Append(PayDetailDB.CreatePrimarykeyString(PaIWork.CompanyCode, PaIWork.TargetDate, PaIWork.SeqNo, PaIWork.LineCount)); |
1013 | 997 |
|
1014 | 998 |
if (!PayDetailDB.ExecuteNonQuery(strSQL.ToString(), false)) return false; |
... | ... | |
1022 | 1006 |
} |
1023 | 1007 |
#endregion |
1024 | 1008 |
|
1025 |
#region 支払承認情報データ作成 |
|
1009 |
#region 申請時:支払承認情報データ作成
|
|
1026 | 1010 |
/// <summary> |
1027 |
/// 支払承認情報データ作成 |
|
1011 |
/// 申請時:支払承認情報データ作成
|
|
1028 | 1012 |
/// </summary> |
1029 | 1013 |
/// <returns></returns> |
1030 |
private bool PaymentApprovalInfoCreate(IOPaymentApprovalInfo PayAppDB, PaymentApprovalInfo PaIWork) |
|
1014 |
private bool PaymentApprovalInfoCreate(IOPaymentApprovalInfo PayAppDB, |
|
1015 |
PaymentApprovalInfo PaIWork, |
|
1016 |
int nBSeqNo) |
|
1031 | 1017 |
{ |
1032 | 1018 |
try |
1033 | 1019 |
{ |
1034 |
List<PaymentApprovalInfo> InfoList = new List<PaymentApprovalInfo>(); |
|
1035 |
InfoList.Add(PaIWork); |
|
1020 |
// 連番を変更する |
|
1021 |
PaIWork.SeqNo = nBSeqNo; |
|
1022 |
// 日付を初期値にする |
|
1023 |
PaIWork.ApprovalDate = new DateTime(2001, 1, 1); |
|
1024 |
if (!PayAppDB.InsertAction(PaIWork, false)) return false; |
|
1036 | 1025 |
|
1037 |
if (!PayAppDB.InsertAction(InfoList, false)) return false; |
|
1026 |
return true; |
|
1027 |
} |
|
1028 |
catch (System.Exception ex) |
|
1029 |
{ |
|
1030 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
1031 |
return false; |
|
1032 |
} |
|
1033 |
} |
|
1034 |
#endregion |
|
1038 | 1035 |
|
1036 |
#region 支払承認情報データ更新処理 |
|
1037 |
/// <summary> |
|
1038 |
/// 支払承認情報データ更新処理 |
|
1039 |
/// </summary> |
|
1040 |
/// <param name="PayAppDB"></param> |
|
1041 |
/// <param name="PaIWork"></param> |
|
1042 |
/// <returns></returns> |
|
1043 |
private bool ApprovalFeePayment() |
|
1044 |
{ |
|
1045 |
IOPaymentApprovalInfo PayAppDB = new IOPaymentApprovalInfo(); |
|
1046 |
try |
|
1047 |
{ |
|
1048 |
PayAppDB.connect(); PayAppDB.beginTran(); |
|
1049 |
|
|
1050 |
bool bSuccess = true; |
|
1051 |
ArrayList arData = m_ArrayParam[0]; |
|
1052 |
// 手間・業者支払承認情報取得 |
|
1053 |
for (int i = 0; i < arData.Count; i++) |
|
1054 |
{ |
|
1055 |
PaymentApprovalInfo PaIWork = (PaymentApprovalInfo)arData[i]; |
|
1056 |
|
|
1057 |
StringBuilder strSQL = new StringBuilder(); |
|
1058 |
List<PaymentApprovalInfo> AddList = new List<PaymentApprovalInfo>(); |
|
1059 |
// 支払承認情報データ検索 |
|
1060 |
strSQL.Append(PayAppDB.CreatePrimarykeyString(PaIWork.CompanyCode, PaIWork.TargetDate, PaIWork.SeqNo, PaIWork.LineCount, PaIWork.ApprovalNo)); |
|
1061 |
List<PaymentApprovalInfo> PayAppList = new List<PaymentApprovalInfo>(); |
|
1062 |
if (!PayAppDB.SelectAction(strSQL.ToString(), ref PayAppList)) return false; |
|
1063 |
bool bExist = true; |
|
1064 |
if (PayAppList.Count == 0) bExist = false; |
|
1065 |
|
|
1066 |
if (bExist) |
|
1067 |
{ // データがあれば承認日付を変更する |
|
1068 |
strSQL.Clear(); |
|
1069 |
PayAppList[0].ApprovalDate = DateTime.Now.Date; |
|
1070 |
if (!PayAppDB.UpdateAction(strSQL.ToString(), PayAppList[0], false)) |
|
1071 |
{ |
|
1072 |
bSuccess = false; |
|
1073 |
break; |
|
1074 |
} |
|
1075 |
} |
|
1076 |
else |
|
1077 |
{ // データが無ければ承認者データを作成する |
|
1078 |
PaIWork.ApprovalDate = DateTime.Now.Date; |
|
1079 |
if (!PayAppDB.InsertAction(PaIWork, false)) |
|
1080 |
{ |
|
1081 |
bSuccess = false; |
|
1082 |
break; |
|
1083 |
} |
|
1084 |
} |
|
1085 |
} |
|
1086 |
|
|
1087 |
if (!bSuccess) |
|
1088 |
{ |
|
1089 |
PayAppDB.rollback(); |
|
1090 |
return false; |
|
1091 |
} |
|
1092 |
|
|
1039 | 1093 |
return true; |
1040 | 1094 |
} |
1041 | 1095 |
catch (System.Exception ex) |
... | ... | |
1043 | 1097 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
1044 | 1098 |
return false; |
1045 | 1099 |
} |
1100 |
finally |
|
1101 |
{ |
|
1102 |
PayAppDB.commit(); PayAppDB.close(); PayAppDB = null; |
|
1103 |
} |
|
1046 | 1104 |
} |
1047 | 1105 |
#endregion |
1048 | 1106 |
|
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntry.cs | ||
---|---|---|
744 | 744 |
try |
745 | 745 |
{ |
746 | 746 |
// 注文書データが無い場合は登録する |
747 |
string strSQL = OrderDB.CreatePrimarykeyString(m_ConstructionCode); |
|
747 |
StringBuilder strSQL = new StringBuilder(); |
|
748 |
strSQL.Append(OrderDB.CreatePrimarykeyString(m_ConstructionCode)); |
|
748 | 749 |
PurchaseOrder DataRec = new PurchaseOrder(); |
749 |
if (!OrderDB.SelectAction(strSQL, ref DataRec)) m_bChengeAns = true; |
|
750 |
if (!OrderDB.SelectAction(strSQL.ToString(), ref DataRec)) m_bChengeAns = true;
|
|
750 | 751 |
|
751 | 752 |
// データ変更有時はデータ登録 |
752 | 753 |
if (m_bChengeAns) |
branches/src/ProcessManagement/ProcessManagement/Forms/DataEntry/PurchaseOrderEntry/FrmPurchaseOrderEntryAuxiliary.cs | ||
---|---|---|
29 | 29 |
IOConstructionBaseInfo cbDB = new IOConstructionBaseInfo(); |
30 | 30 |
try |
31 | 31 |
{ |
32 |
string strSQL = cbDB.CreatePrimarykeyString(m_ConstructionCode); |
|
33 |
if (!cbDB.SelectAction(strSQL, ref m_ConstructionBaseInfo)) return false; |
|
32 |
StringBuilder strSQL = new StringBuilder(); |
|
33 |
strSQL.Append(cbDB.CreatePrimarykeyString(m_ConstructionCode)); |
|
34 |
if (!cbDB.SelectAction(strSQL.ToString(), ref m_ConstructionBaseInfo)) return false; |
|
34 | 35 |
|
35 | 36 |
return true; |
36 | 37 |
} |
... | ... | |
137 | 138 |
{ |
138 | 139 |
|
139 | 140 |
// 一覧リストを作成する |
140 |
string strSQL = AppDetailDB.CreatePrimarykeyString(m_ConstructionCode, (int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval, m_OrderNo); |
|
141 |
strSQL += " ORDER BY ORDERNO"; |
|
141 |
StringBuilder strSQL = new StringBuilder(); |
|
142 |
strSQL.Append(AppDetailDB.CreatePrimarykeyString(m_ConstructionCode, |
|
143 |
(int)ClsExcute.ApprovalListNo.PurchaseOrderEntryApproval, m_OrderNo)); |
|
144 |
strSQL.Append(" ORDER BY ORDERNO"); |
|
142 | 145 |
List<ProcessApprovalDetail> DetailList = new List<ProcessApprovalDetail>(); |
143 |
if (!AppDetailDB.SelectAction(strSQL, ref DetailList)) return; |
|
146 |
if (!AppDetailDB.SelectAction(strSQL.ToString(), ref DetailList)) return;
|
|
144 | 147 |
|
145 | 148 |
m_DetailList.Clear(); |
146 | 149 |
foreach (ProcessApprovalDetail CurRec in DetailList) |
... | ... | |
287 | 290 |
m_DspLabelCtrl[(int)DspLblCtrlName.ConstCode].Text = CommonMotions.cnvStringCodeFromInt(m_ConstructionBaseInfo.ConstructionCode, "-", 8); // 工事コード |
288 | 291 |
|
289 | 292 |
// 工事基本情報明細取得 |
290 |
string strSQL = cbidDB.CreatePrimarykeyString(m_ConstructionCode, (int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName); |
|
293 |
StringBuilder strSQL = new StringBuilder(); |
|
294 |
strSQL.Append(cbidDB.CreatePrimarykeyString(m_ConstructionCode, |
|
295 |
(int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionName)); |
|
291 | 296 |
ConstructionBaseInfoDetail workRec = new ConstructionBaseInfoDetail(); |
292 |
if (!cbidDB.SelectAction(strSQL, ref workRec)) return; |
|
297 |
if (!cbidDB.SelectAction(strSQL.ToString(), ref workRec)) return; |
|
298 |
|
|
293 | 299 |
m_DspLabelCtrl[(int)DspLblCtrlName.ConstName].Text = workRec.DetailString; // 工事名称 |
294 |
strSQL = cbidDB.CreatePrimarykeyString(m_ConstructionCode); |
|
295 |
strSQL += string.Format(" And (DetailNo = {0} Or DetailNo = {1} Or DetailNo = {2})", |
|
300 |
strSQL.Clear(); |
|
301 |
strSQL.Append(cbidDB.CreatePrimarykeyString(m_ConstructionCode)); |
|
302 |
strSQL.AppendFormat(" And (DetailNo = {0} Or DetailNo = {1} Or DetailNo = {2})", |
|
296 | 303 |
(int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionPlace1, // 工事場所1 |
297 | 304 |
(int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionPlace2, // 工事場所2 |
298 | 305 |
(int)ConstructionBaseInfoDetail.DetailDataNo.ConstructionPlace3); // 工事場所3 |
299 |
strSQL += " Order By DetailNo";
|
|
306 |
strSQL.Append(" Order By DetailNo");
|
|
300 | 307 |
List<ConstructionBaseInfoDetail> workList = new List<ConstructionBaseInfoDetail>(); |
301 |
cbidDB.SelectAction(strSQL, ref workList); |
|
308 |
cbidDB.SelectAction(strSQL.ToString(), ref workList);
|
|
302 | 309 |
string Place = string.Empty; |
303 | 310 |
foreach (ConstructionBaseInfoDetail wrkRec in workList) |
304 | 311 |
{ |
... | ... | |
307 | 314 |
m_DspLabelCtrl[(int)DspLblCtrlName.ConstPlace].Text = Place; // 工事場所 |
308 | 315 |
|
309 | 316 |
// 工事担当者取得 |
310 |
strSQL = picDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionPersonCode); |
|
317 |
strSQL.Clear(); |
|
318 |
strSQL.Append(picDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionPersonCode)); |
|
311 | 319 |
PersonInChargeMaster personRec = new PersonInChargeMaster(); |
312 |
picDB.SelectAction(strSQL, ref personRec); |
|
320 |
picDB.SelectAction(strSQL.ToString(), ref personRec);
|
|
313 | 321 |
|
314 | 322 |
m_DspLabelCtrl[(int)DspLblCtrlName.CreatorName].Text = personRec.PersonName; // 工事担当者 |
315 | 323 |
|
316 | 324 |
// 注文書タイプ取得 |
317 |
strSQL = OrderDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionPersonCode); |
|
325 |
strSQL.Clear(); |
|
326 |
strSQL.Append(OrderDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionPersonCode)); |
|
318 | 327 |
List<PurchaseOrder> OrderList = new List<PurchaseOrder>(); |
319 |
OrderDB.SelectAction(strSQL, ref OrderList); |
|
328 |
OrderDB.SelectAction(strSQL.ToString(), ref OrderList);
|
|
320 | 329 |
PurchaseOrder OrderRec = new PurchaseOrder(); |
321 | 330 |
if (OrderList.Count != 0) |
322 | 331 |
{ |
... | ... | |
342 | 351 |
//} |
343 | 352 |
|
344 | 353 |
// 工事種別マスタ取得 |
345 |
strSQL = ctypeDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionType); |
|
354 |
strSQL.Clear(); |
|
355 |
strSQL.Append(ctypeDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionType)); |
|
346 | 356 |
ConstructionTypeMaster ctypeRec = new ConstructionTypeMaster(); |
347 |
ctypeDB.SelectAction(strSQL, ref ctypeRec); |
|
357 |
ctypeDB.SelectAction(strSQL.ToString(), ref ctypeRec);
|
|
348 | 358 |
m_DspLabelCtrl[(int)DspLblCtrlName.ConstructionType].Text = ctypeRec.NameString; // 工事種別 |
349 | 359 |
|
350 | 360 |
DateTime StDate = m_ConstructionBaseInfo.ConstructionPeriodStart; |
... | ... | |
412 | 422 |
/// 工事詳細台帳より読み込むSQLを作成する |
413 | 423 |
/// </summary> |
414 | 424 |
/// <param name="strSQL"></param> |
415 |
private void CreateNewDataSQL(ref string strSQL)
|
|
425 |
private void CreateNewDataSQL(ref StringBuilder strSQL)
|
|
416 | 426 |
{ |
417 | 427 |
try |
418 | 428 |
{ |
419 | 429 |
// 工事台帳コードのセット |
420 | 430 |
object[] ParentRec = (object[])m_DetailList[0]; |
421 |
strSQL = string.Format(" WHERE CONSTRUCTIONCODE = {0}", |
|
431 |
strSQL.Clear(); |
|
432 |
strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", |
|
422 | 433 |
CommonMotions.cnvInt(ParentRec[(int)FrmOrderEntryList.ReadDBColumn.ConstructionCode])); |
423 | 434 |
|
424 | 435 |
int SourceCode = 0; |
... | ... | |
437 | 448 |
{ |
438 | 449 |
if (bFirstCode) |
439 | 450 |
{ |
440 |
strSQL += " AND";
|
|
451 |
strSQL.Append(" AND");
|
|
441 | 452 |
bFirstCode = false; |
442 | 453 |
} |
443 | 454 |
else |
444 | 455 |
{ |
445 |
strSQL += ")) OR";
|
|
456 |
strSQL.Append(")) OR");
|
|
446 | 457 |
} |
447 | 458 |
|
448 |
strSQL += string.Format(" (SOURCECODE = {0} AND (", SourceCode);
|
|
459 |
strSQL.AppendFormat(" (SOURCECODE = {0} AND (", SourceCode);
|
|
449 | 460 |
|
450 | 461 |
brkSourceCode = SourceCode; |
451 | 462 |
bFirstCompany = true; |
452 | 463 |
} |
453 | 464 |
// 会社番号のセット |
454 |
if (!bFirstCompany) strSQL += " OR";
|
|
465 |
if (!bFirstCompany) strSQL.Append(" OR");
|
|
455 | 466 |
|
456 |
strSQL += string.Format(" (COMPANYCODE = {0} AND LINECOUNT = {1})", CompanyCode, LineNo);
|
|
467 |
strSQL.AppendFormat(" (COMPANYCODE = {0} AND LINECOUNT = {1})", CompanyCode, LineNo);
|
|
457 | 468 |
|
458 | 469 |
bFirstCompany = false; |
459 | 470 |
} |
460 |
strSQL += ")) ORDER BY COMPANYCODE";
|
|
471 |
strSQL.Append(")) ORDER BY COMPANYCODE");
|
|
461 | 472 |
} |
462 | 473 |
catch (System.Exception ex) |
463 | 474 |
{ |
... | ... | |
480 | 491 |
if (m_DetailList.Count == 0) return false; |
481 | 492 |
|
482 | 493 |
// 対象データSQL作成 |
483 |
string strSQL = string.Empty;
|
|
494 |
StringBuilder strSQL = new StringBuilder();
|
|
484 | 495 |
CreateNewDataSQL(ref strSQL); |
485 | 496 |
// 工事詳細台帳データ読込 |
486 | 497 |
List<ConstructionLedgerDetail> DetailList = new List<ConstructionLedgerDetail>(); |
487 |
if (!DetailDB.SelectAction(strSQL, ref DetailList)) return false; |
|
498 |
if (!DetailDB.SelectAction(strSQL.ToString(), ref DetailList)) return false;
|
|
488 | 499 |
if (DetailList.Count == 0) return false; |
489 | 500 |
|
490 | 501 |
// デフォルトページを削除する |
... | ... | |
735 | 746 |
try |
736 | 747 |
{ |
737 | 748 |
// 注文書データ読込 |
738 |
string strSQL = " WHERE"; |
|
749 |
StringBuilder strSQL = new StringBuilder(); |
|
750 |
strSQL.Append(" WHERE"); |
|
739 | 751 |
bool bFirst = true; |
740 | 752 |
foreach (object[] objRec in m_DetailList) |
741 | 753 |
{ |
742 |
if (!bFirst) strSQL += " Or";
|
|
743 |
strSQL += string.Format(" (CONSTRUCTIONCODE = {0}", CommonMotions.cnvInt(objRec[(int)FrmOrderEntryList.ReadDBColumn.SourceCode]));
|
|
744 |
strSQL += string.Format(" AND SEQNO = {0})", CommonMotions.cnvInt(objRec[(int)FrmOrderEntryList.ReadDBColumn.PurchaseSeqNo]));
|
|
754 |
if (!bFirst) strSQL.Append(" Or");
|
|
755 |
strSQL.AppendFormat(" (CONSTRUCTIONCODE = {0}", CommonMotions.cnvInt(objRec[(int)FrmOrderEntryList.ReadDBColumn.SourceCode]));
|
|
756 |
strSQL.AppendFormat(" AND SEQNO = {0})", CommonMotions.cnvInt(objRec[(int)FrmOrderEntryList.ReadDBColumn.PurchaseSeqNo]));
|
|
745 | 757 |
bFirst = false; |
746 | 758 |
} |
747 |
strSQL += " ORDER BY CONSTRUCTIONCODE, SEQNO";
|
|
759 |
strSQL.Append(" ORDER BY CONSTRUCTIONCODE, SEQNO");
|
|
748 | 760 |
|
749 | 761 |
List<PurchaseOrder> OrderList = new List<PurchaseOrder>(); |
750 |
if (!OrderDB.SelectAction(strSQL, ref OrderList)) return false; |
|
762 |
if (!OrderDB.SelectAction(strSQL.ToString(), ref OrderList)) return false;
|
|
751 | 763 |
if (OrderList.Count == 0) return false; |
752 | 764 |
|
753 | 765 |
// デフォルトページを削除する |
... | ... | |
757 | 769 |
foreach (PurchaseOrder OrderRec in OrderList) |
758 | 770 |
{ |
759 | 771 |
List<PurchaseOrderDetail> DetailData = new List<PurchaseOrderDetail>(); |
760 |
strSQL = DetailDB.CreatePrimarykeyString(OrderRec.ConstructionCode, OrderRec.SeqNo); |
|
761 |
strSQL += " ORDER BY GroupCount ASC, LineCount ASC"; |
|
762 |
if (!DetailDB.SelectAction(strSQL, ref DetailData)) continue; |
|
772 |
strSQL.Clear(); |
|
773 |
strSQL.Append(DetailDB.CreatePrimarykeyString(OrderRec.ConstructionCode, OrderRec.SeqNo)); |
|
774 |
strSQL.Append(" ORDER BY GroupCount ASC, LineCount ASC"); |
|
775 |
if (!DetailDB.SelectAction(strSQL.ToString(), ref DetailData)) continue; |
|
763 | 776 |
|
764 | 777 |
// ページ追加 |
765 | 778 |
PurchaseOrderInputPage inputpage = new PurchaseOrderInputPage(); |
... | ... | |
805 | 818 |
inputpage.SeqNo = DataRec.SeqNo; |
806 | 819 |
|
807 | 820 |
SubContractorMaster SubRec = new SubContractorMaster(); |
808 |
string strSQL = SubCDB.CreatePrimarykeyString(DataRec.CompanyCode); |
|
809 |
SubCDB.SelectAction(strSQL, ref SubRec); |
|
821 |
StringBuilder strSQL = new StringBuilder(); |
|
822 |
strSQL.Append(SubCDB.CreatePrimarykeyString(DataRec.CompanyCode)); |
|
823 |
SubCDB.SelectAction(strSQL.ToString(), ref SubRec); |
|
810 | 824 |
|
811 | 825 |
// 台帳発注金額テーブル作成 |
812 | 826 |
ReadLedgerOrder(); |
... | ... | |
976 | 990 |
{ |
977 | 991 |
LedgerOrderPrice.Clear(); |
978 | 992 |
|
979 |
string strSQL = "SELECT COMPANYCODE, SUM(EXECUTIONAMOUNT) FROM CONSTRUCTIONLEDGERDETAIL"; |
|
980 |
strSQL += string.Format(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode); |
|
981 |
strSQL += string.Format(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts); |
|
982 |
strSQL += string.Format(" AND PURCHASEORDERFLG = {0}", (int)CommonDefine.PurchaseOrderFlg.Making); |
|
983 |
strSQL += " GROUP BY COMPANYCODE ORDER BY COMPANYCODE"; |
|
993 |
StringBuilder strSQL = new StringBuilder(); |
|
994 |
strSQL.Append("SELECT COMPANYCODE, SUM(EXECUTIONAMOUNT) FROM CONSTRUCTIONLEDGERDETAIL"); |
|
995 |
strSQL.AppendFormat(" WHERE CONSTRUCTIONCODE = {0}", m_ConstructionCode); |
|
996 |
strSQL.AppendFormat(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts); |
|
997 |
strSQL.AppendFormat(" AND PURCHASEORDERFLG = {0}", (int)CommonDefine.PurchaseOrderFlg.Making); |
|
998 |
strSQL.Append(" GROUP BY COMPANYCODE ORDER BY COMPANYCODE"); |
|
984 | 999 |
ArrayList arList = new ArrayList(); |
985 |
LedgerDDB.ExecuteReader(strSQL, ref arList); |
|
1000 |
LedgerDDB.ExecuteReader(strSQL.ToString(), ref arList);
|
|
986 | 1001 |
foreach (object[] objRec in arList) |
987 | 1002 |
{ |
988 | 1003 |
LedgerOrderPrice.Add(new KeyValuePair<int, int>(CommonMotions.cnvInt(objRec[0]), CommonMotions.cnvInt(objRec[1]))); |
... | ... | |
1105 | 1120 |
IOMConstructionType TypeDB = new IOMConstructionType(); |
1106 | 1121 |
try |
1107 | 1122 |
{ |
1108 |
string strSQL = TypeDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionType); |
|
1109 |
strSQL += string.Format(" AND PUBLICFLG = {0}", (int)CommonDefine.ConstructionType.Community); |
|
1123 |
StringBuilder strSQL = new StringBuilder(); |
|
1124 |
strSQL.Append(TypeDB.CreatePrimarykeyString(m_ConstructionBaseInfo.ConstructionType)); |
|
1125 |
strSQL.AppendFormat(" AND PUBLICFLG = {0}", (int)CommonDefine.ConstructionType.Community); |
|
1110 | 1126 |
ConstructionTypeMaster TypeRec = new ConstructionTypeMaster(); |
1111 |
if (!TypeDB.SelectAction(strSQL, ref TypeRec)) return false; |
|
1127 |
if (!TypeDB.SelectAction(strSQL.ToString(), ref TypeRec)) return false;
|
|
1112 | 1128 |
|
1113 | 1129 |
return true; |
1114 | 1130 |
} |
... | ... | |
1240 | 1256 |
bPageAns &= CommonMotions.DispFieldDateCheck(CurPage.Group1TextBox); |
1241 | 1257 |
|
1242 | 1258 |
// 注文書データ読込 |
1243 |
string strSQL = LedgerDB.CreatePrimarykeyString(m_ConstructionCode); |
|
1259 |
StringBuilder strSQL = new StringBuilder(); |
|
1260 |
strSQL.Append(LedgerDB.CreatePrimarykeyString(m_ConstructionCode)); |
|
1244 | 1261 |
ConstructionLedger LedgerRec = new ConstructionLedger(); |
1245 |
if (!LedgerDB.SelectAction(strSQL, ref LedgerRec)) continue; |
|
1262 |
if (!LedgerDB.SelectAction(strSQL.ToString(), ref LedgerRec)) continue;
|
|
1246 | 1263 |
|
1247 | 1264 |
// 発注金額・合計金額のチェック(入力金額が大きくなった場合はエラー) |
1248 | 1265 |
bool bNotErr = true; |
... | ... | |
1469 | 1486 |
// データ存在確認 |
1470 | 1487 |
bool DataExists = false; |
1471 | 1488 |
PurchaseOrder DataRec = new PurchaseOrder(); |
1472 |
string strSQL = OrderDB.CreatePrimarykeyString(m_ConstructionCode, SeqNo); |
|
1473 |
if (OrderDB.SelectAction(strSQL, ref DataRec, false)) DataExists = true; |
|
1489 |
StringBuilder strSQL = new StringBuilder(); |
|
1490 |
strSQL.Append(OrderDB.CreatePrimarykeyString(m_ConstructionCode, SeqNo)); |
|
1491 |
if (OrderDB.SelectAction(strSQL.ToString(), ref DataRec, false)) DataExists = true; |
|
1474 | 1492 |
|
1475 | 1493 |
if (!DataExists) |
1476 | 1494 |
{ |
... | ... | |
1538 | 1556 |
if (DataExists) |
1539 | 1557 |
{ |
1540 | 1558 |
// データ更新 |
1541 |
if (!OrderDB.UpdateAction(strSQL, DataRec, false)) |
|
1559 |
if (!OrderDB.UpdateAction(strSQL.ToString(), DataRec, false))
|
|
1542 | 1560 |
{ |
1543 | 1561 |
LogicalErrorMessage("注文書データ:更新に失敗しました。", "更新エラー", CommonMotions.GetMethodName()); |
1544 | 1562 |
return false; |
... | ... | |
1574 | 1592 |
try |
1575 | 1593 |
{ |
1576 | 1594 |
// データ削除 |
1577 |
string strSQL = DetailDB.CreatePrimarykeyString(m_ConstructionCode, SeqNo); |
|
1578 |
DetailDB.DeleteAction(strSQL, false); |
|
1595 |
StringBuilder strSQL = new StringBuilder(); |
|
1596 |
strSQL.Append(DetailDB.CreatePrimarykeyString(m_ConstructionCode, SeqNo)); |
|
1597 |
DetailDB.DeleteAction(strSQL.ToString(), false); |
|
1579 | 1598 |
|
1580 | 1599 |
// 明細グリッド書込み |
1581 | 1600 |
for (int i = 0; i < DataTab.Group1DataGridView.RowCount; i++) |
... | ... | |
1667 | 1686 |
int LedgerLine = 0; |
1668 | 1687 |
bool ChangeCompany = false; |
1669 | 1688 |
int BeforeCode = 0; |
1670 |
string strSQL = string.Empty;
|
|
1689 |
StringBuilder strSQL = new StringBuilder();
|
|
1671 | 1690 |
int TargetCode = ClsProcessExist.GetParentConstrCode(m_ConstructionCode); |
1672 | 1691 |
int TargetField = 0; |
1673 | 1692 |
|
... | ... | |
1692 | 1711 |
{ |
1693 | 1712 |
// 協力会社名変更 |
1694 | 1713 |
TargetField = (int)IOConstructionLedgerDetail.TableColumn.CompanyName; |
1695 |
strSQL = LDetailDB.CreatePrimarykeyString(TargetCode); |
|
1696 |
strSQL += string.Format(" AND SOURCECODE = {0}", m_ConstructionCode); |
|
1697 |
strSQL += string.Format(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts); |
|
1698 |
strSQL += string.Format(" AND COMPANYCODE = {0}", BeforeCode); |
|
1714 |
strSQL.Clear(); |
|
1715 |
strSQL.Append(LDetailDB.CreatePrimarykeyString(TargetCode)); |
|
1716 |
strSQL.AppendFormat(" AND SOURCECODE = {0}", m_ConstructionCode); |
|
1717 |
strSQL.AppendFormat(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts); |
|
1718 |
strSQL.AppendFormat(" AND COMPANYCODE = {0}", BeforeCode); |
|
1699 | 1719 |
//strSQL += string.Format(" AND EXECUTIONAMOUNT = {0}", PriceVal); |
1700 |
if (LedgerLine != 0) strSQL += string.Format(" AND LINECOUNT = {0}", LedgerLine);
|
|
1701 |
if (!LDetailDB.UpdateFeild(strSQL, TargetField, DataTab.EntryTab.Text, false)) |
|
1720 |
if (LedgerLine != 0) strSQL.AppendFormat(" AND LINECOUNT = {0}", LedgerLine);
|
|
1721 |
if (!LDetailDB.UpdateFeild(strSQL.ToString(), TargetField, DataTab.EntryTab.Text, false))
|
|
1702 | 1722 |
{ |
1703 | 1723 |
LogicalErrorMessage("注文書データ:協力会社名称変更に失敗しました。", "更新エラー", CommonMotions.GetMethodName()); |
1704 | 1724 |
return false; |
1705 | 1725 |
} |
1706 | 1726 |
// 協力会社コード変更 |
1707 | 1727 |
TargetField = (int)IOConstructionLedgerDetail.TableColumn.CompanyCode; |
1708 |
if (!LDetailDB.UpdateFeild(strSQL, TargetField, DataTab.OrderCompanyCode, false)) |
|
1728 |
if (!LDetailDB.UpdateFeild(strSQL.ToString(), TargetField, DataTab.OrderCompanyCode, false))
|
|
1709 | 1729 |
{ |
1710 | 1730 |
LogicalErrorMessage("注文書データ:協力会社コード変更に失敗しました。", "更新エラー", CommonMotions.GetMethodName()); |
1711 | 1731 |
return false; |
... | ... | |
1713 | 1733 |
} |
1714 | 1734 |
// 注文書作成フラグON |
1715 | 1735 |
TargetField = (int)IOConstructionLedgerDetail.TableColumn.PurchaseOrderFlg; |
1716 |
strSQL = LDetailDB.CreatePrimarykeyString(TargetCode); |
|
1717 |
strSQL += string.Format(" AND SOURCECODE = {0}", m_ConstructionCode); |
|
1718 |
strSQL += string.Format(" AND GROUPCOUNT = {0}", (int)FrmConstructionLedger.DataGroup.ConstructionCosts); |
|
1719 |
strSQL += string.Format(" AND COMPANYCODE = {0}", DataTab.OrderCompanyCode); |
|
1736 |
strSQL.Clear(); |
|
1737 |
strSQL.Append(LDetailDB.CreatePrimarykeyString(TargetCode)); |
他の形式にエクスポート: Unified diff