개정판 503cb09e
service controller 참조 DLL 추가
Change-Id: I71275da928adc2181aa4c8da4b377eccabe90669
KCOM_API/ServiceDeepView.svc.cs | ||
---|---|---|
2156 | 2156 |
[ServiceKnownType(typeof(MEMBER))] |
2157 | 2157 |
public MEMBER GetMember(string project_no, string user_id) |
2158 | 2158 |
{ |
2159 |
MEMBER rstmember = new MEMBER();
|
|
2159 |
MEMBER rstmember = null;
|
|
2160 | 2160 |
try |
2161 | 2161 |
{ |
2162 | 2162 |
string sCIConnString = ConfigurationManager.ConnectionStrings["CIConnectionString"].ConnectionString; |
2163 | 2163 |
using (CIEntities Entity = new CIEntities(sCIConnString)) |
2164 | 2164 |
{ |
2165 |
var tmp = (from member in Entity.MEMBER |
|
2166 |
where member.ID == user_id && member.PROJECT_NO == project_no |
|
2167 |
select member).FirstOrDefault(); |
|
2168 |
rstmember.DEPARTMENT = tmp.DEPARTMENT; |
|
2169 |
rstmember.ID = tmp.ID; |
|
2170 |
rstmember.NAME = tmp.NAME; |
|
2165 |
string query = "SELECT members.ID,members.NAME,members.DEPARTMENT FROM CIEntities.MEMBER as members where members.ID = @userId"; |
|
2166 |
|
|
2167 |
var param = new[] { new System.Data.Objects.ObjectParameter("userId", user_id) }; |
|
2168 |
|
|
2169 |
System.Data.Objects.ObjectQuery<System.Data.Common.DbDataRecord> memberQuery |
|
2170 |
= Entity.CreateQuery<System.Data.Common.DbDataRecord>(query, param); |
|
2171 |
|
|
2172 |
if (memberQuery.Count() > 0) |
|
2173 |
{ |
|
2174 |
string userName = memberQuery.First()["NAME"]?.ToString().Trim(); |
|
2175 |
string ID = memberQuery.First()["ID"]?.ToString().Trim(); |
|
2176 |
string depatment = memberQuery.First()["DEPARTMENT"]?.ToString().Trim(); |
|
2177 |
|
|
2178 |
rstmember.NAME = userName; |
|
2179 |
rstmember.ID = ID; |
|
2180 |
rstmember.DEPARTMENT = depatment; |
|
2181 |
} |
|
2171 | 2182 |
} |
2172 | 2183 |
} |
2173 | 2184 |
catch (Exception ex) |
내보내기 Unified diff