リビジョン 336
工事詳細台帳:一般工事のデータ作成時に列の作成が出来ていないので落ちるバグを修正
担当者検索SQL:今期検索時に工事情報にあるものしか検索できないバグ修正
CommonMotions.cs | ||
---|---|---|
2961 | 2961 |
} |
2962 | 2962 |
#endregion |
2963 | 2963 |
|
2964 |
#region 今期の判定を行う |
|
2965 |
/// <summary> |
|
2966 |
/// 今期の判定を行う |
|
2967 |
/// </summary> |
|
2968 |
/// <returns></returns> |
|
2969 |
private static bool CheckNowSeason(int nTarget) |
|
2970 |
{ |
|
2971 |
try |
|
2972 |
{ |
|
2973 |
if (m_systemMaster.ConstructionNoBase == (int)SystemMaster.ConstrNoBaseDef.BusinessPeriod) |
|
2974 |
{ // 営業期数 |
|
2975 |
if (nTarget != m_systemMaster.BusinessPeriod) return false; |
|
2976 |
} |
|
2977 |
else |
|
2978 |
{ // 工事年度 |
|
2979 |
if (nTarget != m_systemMaster.ConstrYear) return false; |
|
2980 |
} |
|
2981 |
return true; |
|
2982 |
} |
|
2983 |
catch (Exception ex) |
|
2984 |
{ |
|
2985 |
logger.ErrorFormat("システムエラー:{0}:{1}", CommonMotions.GetMethodName(), ex.Message); |
|
2986 |
return false; |
|
2987 |
} |
|
2988 |
} |
|
2989 |
#endregion |
|
2990 |
|
|
2964 | 2991 |
#region 部署コンボボックスデータ取得SQL作成 |
2965 | 2992 |
/// <summary> |
2966 | 2993 |
/// 部署コンボボックスデータ取得SQL作成 |
... | ... | |
2971 | 2998 |
try |
2972 | 2999 |
{ |
2973 | 3000 |
// 今期のデータかどうかを判定する |
2974 |
bool bNowSeason = true; |
|
2975 |
if (nTargetCount != CommonMotions.SystemMasterData.BusinessPeriod) bNowSeason = false; |
|
3001 |
bool bNowSeason = CheckNowSeason(nTargetCount); |
|
2976 | 3002 |
|
2977 | 3003 |
strSQL.Append("SELECT"); |
2978 | 3004 |
strSQL.Append(" A.DEPARTMENTCODE"); |
... | ... | |
3048 | 3074 |
|
3049 | 3075 |
if (bNowSeason) |
3050 | 3076 |
{ // 今期は削除されていないもの |
3051 |
//strSQL.Append(" A.DELETEFLG = 0");
|
|
3077 |
strSQL.Append(" A.DELETEFLG = 0"); |
|
3052 | 3078 |
DateTime dtDefaultEnd = CommonMotions.GetOpeningEndDate(nTargetCount, false); |
3053 | 3079 |
|
3054 |
strSQL.AppendFormat(" C.ConstructionPeriod = {0}", nTargetCount); |
|
3055 | 3080 |
strSQL.AppendFormat(" And DATE(A.StartDate) <= DATE('{0}')", dtDefaultEnd.ToShortDateString()); |
3081 |
|
|
3056 | 3082 |
// システム管理者以外は部署参照マスタよりデータ取得 |
3057 | 3083 |
if (CommonMotions.LoginUserData.PersonCode != CommonDefine.AdminCode) |
3058 | 3084 |
{ |
... | ... | |
3061 | 3087 |
strSQL.Append(" IN (SELECT A1.DEPARTMENTCODE FROM PERSONDEPARTMENTMASTER A1"); |
3062 | 3088 |
strSQL.AppendFormat(" WHERE A1.PERSONCODE = {0})", CommonMotions.LoginUserData.PersonCode); |
3063 | 3089 |
} |
3064 |
strSQL.Append(" AND"); |
|
3090 |
// strSQL.Append(" AND");
|
|
3065 | 3091 |
} |
3066 |
strSQL.Append(" A.DepartmentCode IN(C.SalesDepCode, C.ConstrDepCode, C.ConstrSubDepCode, C.ConstrInstrDepCode)"); |
|
3092 |
else |
|
3093 |
{ |
|
3094 |
strSQL.AppendFormat(" C.ConstructionPeriod = {0}", nTargetCount); |
|
3095 |
strSQL.Append(" And A.DepartmentCode IN(C.SalesDepCode, C.ConstrDepCode, C.ConstrSubDepCode, C.ConstrInstrDepCode)"); |
|
3096 |
} |
|
3067 | 3097 |
//strSQL.Append(" A.DEPARTMENTCODE = B.DEPARTMENTCODE"); |
3068 | 3098 |
//strSQL.Append(" AND B.PERSONCODE = C.CONSTRUCTIONPERSONCODE"); |
3069 | 3099 |
strSQL.Append(" GROUP BY A.DEPARTMENTCODE, A.DEPARTMENTSTRING, A.DISPLAYORDER"); |
他の形式にエクスポート: Unified diff