public static string GetSectionNames(NpgsqlConnection conn, string ids) { string localeCode = CommonUtil.GetAppLocaleCode(); string result_value; if (ids != null && ids != "") { if (ids.Contains(":")) { string valueFieldName = "section_name_" + localeCode; // 不在転送リストから部署名を取得 string[] values = ids.Split(':'); string name1 = BaseModel.GetFirstValue <string>(conn, SectionMaster.SelectNameSql(localeCode, values[0]), valueFieldName); string name2 = BaseModel.GetFirstValue <string>(conn, SectionMaster.SelectNameSql(localeCode, values[1]), valueFieldName); result_value = name1; if (name2 != null) { result_value += "(" + name2 + ")"; } } else { // 立ち寄り部署ID一覧から部署名をカンマ区切りで取得 result_value = BaseModel.GetFirstValue <string>(conn, SectionMaster.SelectNamesSql(localeCode, ids), "value"); } } else { result_value = ""; } return(result_value); }
/// <summary> /// 発部署名と着部署名を取得 /// </summary> /// <param name="order_id"></param> /// <returns></returns> static public (string fromSectNames, string toSectNames) GetSectNames(NpgsqlConnection conn, int order_id) { string fromSectNames = null; // 発部署名 string toSectNames = null; // 着部署名 if (order_id != 0) { OrderReserve order = BaseModel.GetFirst <OrderReserve>(conn, "SELECT * FROM order_reserve WHERE order_id=" + order_id); if (order != null) { string localeCode = CommonUtil.GetAppLocaleCode(); // 部署ID一覧から部署名をカンマ区切りで取得 fromSectNames = BaseModel.GetFirstValue <string>(conn, SectionMaster.SelectNamesSql(localeCode, order.order_from_sect.ToString()), "value"); string ids; if (order.order_round_flg == 1 || order.order_forward_list == null) { ids = order.order_stop_to_sects; } else { ids = order.order_forward_list; } // id一覧から部署名一覧に変換 toSectNames = SectionMaster.GetSectionNames(conn, ids); } } return(fromSectNames, toSectNames); }
public static string GetListSql(string cart_enable) { string localeCode = CommonUtil.GetAppLocaleCode(); string sql = "SELECT " + "lpad(cast(cart_id as text),4,'0') AS id" + ",cart_name_" + localeCode + " AS name" + ",CASE cart_use WHEN 0 THEN '" + Properties.Resources.CLV_USE_0 + "'" + "WHEN 1 THEN '" + Properties.Resources.CLV_USE_1 + "'" + "WHEN 2 THEN '" + Properties.Resources.CLV_USE_2 + "'" + "ELSE '' " + "END As use" + ",CASE WHEN cart_enable = 1 THEN '" + Properties.Resources.CLV_ENABLE_1 + "' ELSE '" + Properties.Resources.CLV_ENABLE_0 + "' END AS enable" + ",(" + SectionMaster.SelectNameSql(localeCode, "cart_master.cart_section_id") + ") AS belong_sect" + // 所属部署名 ",CASE WHEN cart_sect_restrict_flg = 0 THEN '" + Properties.Resources.CLV_RESTRICT_0 + "' ELSE '" + Properties.Resources.CLV_RESTRICT_NOT_0 + "' END AS belong_restrict" + // 所属部署制限 ",cart_master.cart_dest_id AS dest_sect" + // 行先部署 ",CASE WHEN cart_dest_restrict_flg = 0 THEN '" + Properties.Resources.CLV_RESTRICT_0 + "' ELSE '" + Properties.Resources.CLV_RESTRICT_NOT_0 + "' END AS dest_restrict" + // 行先部署制限 ",CASE cart_func WHEN 1 THEN '" + Properties.Resources.CLV_FUNC_1 + "'" + "WHEN 2 THEN '" + Properties.Resources.CLV_FUNC_2 + "'" + "ELSE '' " + "END As func" + ",'' AS key" + " FROM cart_master"; if (cart_enable != "all") { sql += " WHERE cart_enable=" + cart_enable; } sql += " ORDER BY cart_id ASC"; return(sql); }
public static string GetListSql(string conditionSql) { string localeCode = CommonUtil.GetAppLocaleCode(); string sql = "SELECT" + " to_char(order_result_reserve_datetime, '" + Properties.Resources.FORMAT_DATE + "') as reserve_date" + ",to_char(order_result_reserve_datetime, 'HH24:MI:SS') as reserve_time" + ",to_char(order_result_start_datetime, '" + Properties.Resources.FORMAT_DATE + "') as start_date" + ", to_char(order_result_start_datetime, 'HH24:MI:SS') as start_time" + ", to_char(order_result_datetime, '" + Properties.Resources.FORMAT_DATE + "') as result_date" + ", to_char(order_result_datetime, 'HH24:MI:SS') as result_time" + ", (" + SectionMaster.SelectNameSql(localeCode, "order_result_from_sect") + ") AS req_sect" + ", (" + StationMaster.SelectNameByPointSql(localeCode, "order_result_from_pt") + ") AS req_station" + ", CASE WHEN order_result_round_flg = 1 OR order_result_forward_list is NULL THEN order_result_stop_to_sects ELSE order_result_forward_list END AS to_sect" + ", order_result_stop_to_points AS to_station" + ", (" + CartMaster.SelectNameSql(localeCode, "order_result_cart_id") + ") AS cart_id" + ", (" + MuMaster.SelectNameSql(localeCode, "order_result_mu_id") + ") AS mu_id" + // ", order_result_cart_id AS cart_id" + // ", order_result_mu_id AS mu_id" + ", CASE order_result_status WHEN 0 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_0 + "' WHEN 1 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_1 + "' WHEN 10 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_10 + "' WHEN 20 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_20 + "' WHEN 100 THEN '" + Mocs.Properties.Resources.ORDER_RESULT_STATUS_100 + "' ELSE CAST(order_result_status AS text) END AS status" + " FROM order_result_log"; if (conditionSql == null || conditionSql.Length == 0) { conditionSql = DBAccess.GetTodayConditionSql("order_result_datetime"); } sql += " WHERE " + conditionSql; sql += " ORDER BY order_result_datetime DESC, order_result_start_datetime DESC, order_result_reserve_datetime DESC"; return(sql); }
public static string GetListSql(string conditionSql, string comboValue) { string localeCode = CommonUtil.GetAppLocaleCode(); string sql = "SELECT" + " to_char(sectlog_datetime, 'yyyy-MM-dd') as date" + ",to_char(sectlog_datetime, 'HH24:MI:SS') as time" + ", (" + SectionMaster.SelectNameSql(localeCode, "sectlog_sect_id") + ") AS sect" + // 部署名 ", CASE WHEN sectlog_absence_flg=1 THEN '" + Properties.Resources.ALV_ABSENCE_1 + "' ELSE '" + Properties.Resources.ALV_ABSENCE_0 + "' END AS absence" + ", (" + SectionMaster.SelectNameSql(localeCode, "sectlog_forward_sect") + ") AS forward_sect" + // 転送先部署名 " FROM sect_status_log"; string comboCondition = null; if (comboValue == "1") { comboCondition = "sectlog_absence_flg=1"; } else if (comboValue == "0") { comboCondition = "sectlog_absence_flg=0"; } if (conditionSql == null || conditionSql.Length == 0) { conditionSql = DBAccess.GetTodayConditionSql("sectlog_datetime"); } sql += " WHERE " + conditionSql; if (comboCondition != null) { sql += " AND " + comboCondition; } sql += " ORDER BY sectlog_datetime DESC"; return(sql); }