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); }