/// <summary> /// 共通追加SQL(WHO COLUMS)取得 /// </summary> /// <param name="intKbn"></param> /// <param name="pgid"></param> /// <param name="tblName"></param> /// <param name="person_id"></param> /// <param name="denNo"></param> /// <param name="ipAdress"></param> /// <param name="userId"></param> /// <returns></returns> public static string GetInsSQLCommonColums(UpdKbn intKbn, string pgid, string tblName, int person_id, string denNo, string ipAdress, string userId) { // 日時取得 DateTime now = DateTime.Now; string date = now.ToString("yyyy/MM/dd"); string time = now.ToString("HH:mm:ss"); StringBuilder sb = new StringBuilder(); if (intKbn == UpdKbn.Ins) { // insert sb.Append(" ,0" + Environment.NewLine); // UPDATE_FLG sb.Append(" ,0" + Environment.NewLine); // DELETE_FLG sb.Append(" ," + ExEscape.zRepStr(pgid) + Environment.NewLine); // CREATE_PG_ID sb.Append(" ," + ExEscape.zRepStr(ipAdress) + Environment.NewLine); // CREATE_ADRESS sb.Append(" ," + ExEscape.zRepStr(userId) + Environment.NewLine); // CREATE_USER_ID sb.Append(" ," + ExEscape.zRepStr(person_id.ToString()) + Environment.NewLine); // CREATE_PERSON_ID sb.Append(" ," + ExEscape.zRepStr(date) + Environment.NewLine); // CREATE_DATE sb.Append(" ," + ExEscape.zRepStr(time) + Environment.NewLine); // CREATE_TIME sb.Append(" ," + ExEscape.zRepStr(pgid) + Environment.NewLine); // UPDATE_PG_ID sb.Append(" ," + ExEscape.zRepStr(ipAdress) + Environment.NewLine); // UPDATE_ADRESS sb.Append(" ," + ExEscape.zRepStr(userId) + Environment.NewLine); // UPDATE_USER_ID sb.Append(" ," + ExEscape.zRepStr(person_id) + Environment.NewLine); // UPDATE_PERSON_ID sb.Append(" ," + ExEscape.zRepStr(date) + Environment.NewLine); // UPDATE_DATE sb.Append(" ," + ExEscape.zRepStr(time) + Environment.NewLine); // UPDATE_TIME } else { // Update string _pgId = ""; string _adress = ""; string _userId = ""; string _personId = ""; string _date = ""; string _time = ""; GetSQLCommonUpdate(denNo, tblName, ref _pgId, ref _adress, ref _userId, ref _personId, ref _date, ref _time); sb.Append(" ,1" + Environment.NewLine); // UPDATE_FLG sb.Append(" ,0" + Environment.NewLine); // DELETE_FLG sb.Append(" ," + ExEscape.zRepStr(_pgId) + Environment.NewLine); // CREATE_PG_ID sb.Append(" ," + ExEscape.zRepStr(_adress) + Environment.NewLine); // CREATE_ADRESS sb.Append(" ," + ExEscape.zRepStr(_userId) + Environment.NewLine); // CREATE_USER_ID sb.Append(" ," + ExEscape.zRepStr(_personId) + Environment.NewLine); // CREATE_PERSON_ID sb.Append(" ," + ExEscape.zRepStr(ExCast.zDateNullToDefault(_date)) + Environment.NewLine); // CREATE_DATE sb.Append(" ," + ExEscape.zRepStr(ExCast.zTimeNullToDefault(_time)) + Environment.NewLine); // CREATE_TIME sb.Append(" ," + ExEscape.zRepStr(pgid) + Environment.NewLine); // UPDATE_PG_ID sb.Append(" ," + ExEscape.zRepStr(ipAdress) + Environment.NewLine); // UPDATE_ADRESS sb.Append(" ," + ExEscape.zRepStr(userId) + Environment.NewLine); // UPDATE_USER_ID sb.Append(" ," + ExEscape.zRepStr(person_id) + Environment.NewLine); // UPDATE_PERSON_ID sb.Append(" ," + ExEscape.zRepStr(date) + Environment.NewLine); // UPDATE_DATE sb.Append(" ," + ExEscape.zRepStr(time) + Environment.NewLine); // UPDATE_TIME } return(sb.ToString()); }