/// <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); }
internal static T Find <T>(NpgsqlConnection conn, int id) where T : BaseMasterModel, new() { T row = new T(); if (id == 0) { return(row); } string sql = row.GetFindSql(id); return(BaseModel.GetFirst <T>(conn, sql)); }