Приложение B. Листинг программы - 400 Bad Request

oklahomaflockΑσφάλεια

3 Νοε 2013 (πριν από 3 χρόνια και 5 μήνες)

131 εμφανίσεις

122

ВК2.008.104.ПЗ

Тула 2011

Приложение
B.
Листинг

программы

TechnicalSupportService.cs

namespace

TechnicalSupport.Web.Services {


using

System;


using

System.Collections.Generic;


using

System.ComponentModel;



using

System.ComponentModel.DataAnnotations;


using

System.Data;


using

System.Linq;


using

System.ServiceModel.DomainServices.EntityFramework;


using

System.ServiceModel.DomainServices.Hosting;


using

System.Ser
viceModel.DomainServices.Server;


using

TechnicalSupport.Web;


using

System.Web.Security;


using

System.Web.Profile;


using

System.Web;


using

TechnicalSupport.Web.Models;


using

System.Configuration;


using

Common;



[
RequiresAuthentication
]


[
EnableClientAccess
()]


public

class

TechnicalSupportService

:
LinqToEntitiesDomainService
<
TechnicalSupportContainer
> {



// TODO:


// Consider constraining the results of your query method. If you need
additio
nal input you can


// add parameters to this method or create additional query methods with
different names.


// To support paging you will need to add ordering to the 'AttachmentSet'
query.


public

IQueryable
<
Attachment
>
GetAttachmentSet() {


return

this
.ObjectContext.AttachmentSet;


}



public

void

InsertAttachment(
Attachment

attachment) {


if
((attachment.EntityState !=
EntityState
.Detached)) {


this
.ObjectContext.ObjectS
tateManager.ChangeObjectState(attachment,
EntityState
.Added);


}
else

{


this
.ObjectContext.AttachmentSet.AddObject(attachment);


}


}



public

void

UpdateAttachment(
Attachment

currentAttachment) {


this
.ObjectContext.AttachmentSet.AttachAsModified(currentAttachment,
this
.ChangeSet.GetOriginal(currentAttachment));


}



public

void

DeleteAttachment(
Attachment

attachment) {


if
((attachment.EntityState !=
EntityState
.
Detached)) {


this
.ObjectContext.ObjectStateManager.ChangeObjectState(attachment,
EntityState
.Deleted);


}
else

{


this
.ObjectContext.AttachmentSet.Attach(attachment);


this
.ObjectContext.AttachmentSe
t.DeleteObject(attachment);


}

123

ВК2.008.104.ПЗ


}



// TODO:


// Consider constraining the results of your query method. If you need
additional input you can


// add parameters to this method or create additional query methods with
different names.


// To support paging you will need to add ordering to the
'SupporterProfile_TechnologySet' query.


public

IQueryable
<
SupporterProfile_Technology
>
GetSupporterProfile_TechnologySet() {


return

this
.ObjectContext.SupporterProfile_TechnologySet;


}



public

void

InsertSupporterProfile_Technology(
SupporterProfile_Technology

supporterProfile_Technology) {


if
((supporterProfile_Technology.EntityState !=
EntityState
.Detached))
{



this
.ObjectContext.ObjectStateManager.ChangeObjectState(supporterProfile_Technolog
y,
EntityState
.Added);


}
else

{


this
.ObjectContext.SupporterProfile_TechnologySet.AddObject(supporterProfile_Techn
ology);



}


}



public

void

UpdateSupporterProfile_Technology(
SupporterProfile_Technology

currentSupporterProfile_Technology) {


this
.ObjectContext.SupporterProfile_TechnologySet.AttachAsModified(currentSupporte
rProfile_Technology,
this
.ChangeSet.GetOriginal(currentSupporterProfile_Technology));


}



public

void

DeleteSupporterProfile_Technology(
SupporterProfile_Technology

supporterProfile_Technology) {


if
((supporterProfile_Technology.EntityState !=
EntityState
.Detached))
{


this
.ObjectContext.ObjectStateManager.ChangeObjectState(supporterProfile_Technolog
y,
EntityState
.Deleted);


}
else

{


this
.ObjectContext.SupporterProfile_TechnologySet.Attach(supporterProfile_Technolo
gy);


this
.ObjectContext.SupporterProfile_TechnologySet.DeleteObject(supporterProfile_Te
chnology);


}


}



// TODO:


// Consider constraining the results of your query method. If you need
additional input you

can


// add parameters to this method or create additional query methods with
different names.


// To support paging you will need to add ordering to the 'TechnologySet'
query.


public

IQueryable
<
Technology
> GetTechnologySet() {



return

this
.ObjectContext.TechnologySet;


}



public

void

InsertTechnology(
Technology

technology) {

124

ВК2.008.104.ПЗ


if
((technology.EntityState !=
EntityState
.Detached)) {


this
.ObjectContext.ObjectStateManager.ChangeObjectState(technology,
EntityState
.Added);


}
else

{


this
.ObjectContext.TechnologySet.AddObject(technology);


}


}



public

void

UpdateTechnology(
Technology

currentTechnology) {


this
.ObjectContext.TechnologySet.AttachAsModified(currentTechnology,
this
.ChangeSet.GetOriginal(currentTechnology));


}



public

void

DeleteTechnology(
Technology

technology) {


if
((technology.Entit
yState !=
EntityState
.Detached)) {


this
.ObjectContext.ObjectStateManager.ChangeObjectState(technology,
EntityState
.Deleted);


}
else

{


this
.ObjectContext.TechnologySet.Attach(technology);


this
.ObjectContext.TechnologySet.DeleteObject(technology);


}


}



// TODO:


// Consider constraining the results of your query method. If you need
additional input you can


// add parameters to this method or create add
itional query methods with
different names.


// To support paging you will need to add ordering to the 'ThreadSet'
query.


public

IQueryable
<
Thread
> GetThreadSet() {


return

this
.ObjectContext.ThreadSet;


}



public

v
oid

InsertThread(
Thread

thread) {


if
(
Roles
.IsUserInRole(
RoleNames
.Customer))


thread.CustomerProfile = (
CustomerProfile
)GetCurrentUser();


thread.CreatedOn =
DateTime
.UtcNow;


if
(thread.Status ==
ThreadStatus
.Active.Value)


thread.SupporterProfileId =
FindAvailableSupporter(thread.TechnologyId);


if
(thread.EntityState !=
EntityState
.Detached)


this
.ObjectContext.ObjectStateManager.ChangeObjectState(thread,
E
ntityState
.Added);


else


this
.ObjectContext.ThreadSet.AddObject(thread);


}



int
? FindAvailableSupporter(
int
? technologyId) {


if
(technologyId ==
null
)


return

null
;


var

suppor
terDaysAnalize = GetSupporterDaysAnalize();



var

supporterIds = (
from

st
in

GetSupporterProfile_TechnologySet()


where

st.TechnologyId == technologyId


select

st.SupporterProfileId).ToArray();



double

minK =
double
.MaxValue;


var

minKSupporterId =
int
.MaxValue;



var

today =
DateTime
.UtcNow.Date;


var

now =
DateTime
.UtcNow;


125

ВК2.008.104.ПЗ


var

activeThreadStatus =
ThreadStatus
.Active.Value;



foreach
(
var

currentSupporterId
in

supporterIds) {


var

messagesCount = 0;


var

realDays = 0;



for
(
var

currentDate =
DateTime
.UtcNow.Date.AddDays(
-
supporterDaysAnalize);


currentDate <
DateTime
.UtcNow.Date;


currentDate = currentDate.AddDays(1)) {


var

endDate = currentDate.AddDays(1);


var

messageCountOnDate = (
from

m
in

GetThreadItemSet()


where

m.UserProfileId ==
currentSupporterId


&& m.Date > currentDate


&& m.Date < endDate



select

m).Count();


if
(messageCountOnDate > 0) {


messagesCount += messageCountOnDate;


realDays++;


}


}



var

performanc
e = (
double
)messagesCount / realDays;


var

answered = (
from

m
in

GetThreadItemSet()


where

m.UserProfileId == currentSupporterId


&& m.Date > today



&& m.Date <= now


select

m).Count();


answered += (
from

t
in

GetThreadSet()


where

t.SupporterProfileId == currentSupporterId


&&

t.Status == activeThreadStatus


select

t).Count();




double

k = (
double
.IsInfinity(performance) ||
double
.IsNaN(performance))


? answered


: answered / performance;


if
(k < minK) {


minK = k;


minKSupporterId = currentSupporterId;


}


}



if
(minKSupporterId ==
double
.MaxValue)



return

null
;


return

minKSupporterId;


}



static

int

GetSupporterDaysAnalize() {


var

value =
ConfigurationManager
.AppSettings[
"SupporterDaysAnalize"
];


int

result;


if
(value !=
null

&&
int
.TryParse(value,
out

result))


return

result;


return

3;


}



public

void

UpdateThread(
Thread

currentThread) {


this
.ObjectContext.ThreadSet.AttachAsModified(currentThread,
this
.ChangeSet.GetOriginal(cu
rrentThread));


}



public

void

DeleteThread(
Thread

thread) {


if
((thread.EntityState !=
EntityState
.Detached)) {

126

ВК2.008.104.ПЗ


this
.ObjectContext.ObjectStateManager.ChangeObjectState(thread,
EntityState
.Deleted);


}
else

{


this
.ObjectContext.ThreadSet.Attach(thread);


this
.ObjectContext.ThreadSet.DeleteObject(thread);


}


}



// TODO:


// Consider constraining the results of your query method. If you need

additional input you can


// add parameters to this method or create additional query methods with
different names.


// To support paging you will need to add ordering to the 'ThreadItemSet'
query.


public

IQueryable
<
ThreadItem
> GetTh
readItemSet() {


return

this
.ObjectContext.ThreadItemSet;


}



public

void

InsertThreadItem(
ThreadItem

threadItem) {


threadItem.Date =
DateTime
.UtcNow;


threadItem.UserProfile = GetCurrentUser();




if
((threadItem.EntityState !=
EntityState
.Detached)) {


this
.ObjectContext.ObjectStateManager.ChangeObjectState(threadItem,
EntityState
.Added);


}
else

{


this
.ObjectContext.ThreadItemSet.AddObject(threadItem);


}


}



public

void

UpdateThreadItem(
ThreadItem

currentThreadItem) {


this
.ObjectContext.ThreadItemSet.AttachAsModified(currentThreadItem,
this
.ChangeSet.GetOriginal(currentThreadItem));


}



public

void

De
leteThreadItem(
ThreadItem

threadItem) {


if
((threadItem.EntityState !=
EntityState
.Detached)) {


this
.ObjectContext.ObjectStateManager.ChangeObjectState(threadItem,
EntityState
.Deleted);


}
else

{


this
.ObjectContext.ThreadItemSet.Attach(threadItem);


this
.ObjectContext.ThreadItemSet.DeleteObject(threadItem);


}


}



// TODO:


// Consider constraining the results of your query method. If you need
additional

input you can


// add parameters to this method or create additional query methods with
different names.


// To support paging you will need to add ordering to the 'UserProfileSet'
query.


public

IQueryable
<
UserProfile
> GetUserProfile
Set() {


return

this
.ObjectContext.UserProfileSet;


}



public

UserProfile

GetCurrentUser() {


var

membershipId = (
Guid
)
Membership
.GetUser().ProviderUserKey;


return

(
from

p
in

GetUserProfileSet()


where

p.UserId == membershipId


select

p).FirstOrDefault();


}

127

ВК2.008.104.ПЗ



[
Query
(IsDefault =
true
)]


public

IQueryable
<
Thread
> GetQuestions() {


if
(
Roles
.IsUserInRole(
RoleNames
.Customer))


return

GetCurrentCustomerThreads();


else

if
(
Roles
.IsUserInRole(
RoleNames
.Support))


return

GetCurrentSupporterThreads();


return

new

Thread
[0].AsQueryable();


}



IQueryable
<
Thread
> GetCur
rentCustomerThreads() {


var

userId = GetCurrentUser().Id;


return

from

t
in

GetThreadSet()


where

t.CustomerProfileId == userId


orderby

t.Status, t.CreatedOn
descending


select

t;


}



IQueryable
<
Thread
> GetCurrentSupporterThreads() {


var

currentSupporter = (
SupporterProfile
)GetCurrentUser();


var

currentSupporterId = currentSupporter.Id;


var

activeThreadStatus =
ThreadStatus
.Acti
ve.Value;


if
(currentSupporter.IsCurator)


return

from

t
in

GetThreadSet()


where

t.Status == activeThreadStatus


&& (t.SupporterProfileId == currentSupporterId


|| t.TechnologyId ==
null


|| t.SupporterProfileId ==
null
)


orderby

t.CreatedOn
descending


select

t;


else


return

from

t
in

GetThreadSet()


where

t.Status == activeThreadStatus


&& t.SupporterProfileId == currentSupporterId


orderby

t.CreatedOn
descending


select

t;


}



[
Invoke
]


public

IEnumerable
<
ThreadItemProxy
> GetThreadItemProxies(
int

threadId) {


var

threadItems =
from

ti
in

GetThreadItemSet()


where

ti.ThreadId == threadId


orderby

ti.Date



select

ti;


var

result = threadItems.ToArray();


return

result.Select(ti => CreateThreadItemProxy(ti));


}



ThreadItemProxy

CreateThreadItemProxy(
ThreadItem

threadItem) {


var

userName = GetUserNameByProfileId(threadItem.UserProfileId);



return

new

ThreadItemProxy
() {


Id = threadItem.Id,


Date = threadItem.Date,


Text = threadItem.Text,


AttachmentId = threadItem.AttachmentId,


AttachmentName = GetAttachmentName(threadItem.AttachmentId),


IsCustomer =
Roles
.IsUserInRole(userName,
RoleNames
.Customer),


UserFriendlyName = GetUserFr
iendlyName(userName) ?? userName


};


}



string

GetAttachmentName(
int
? attachmentId) {


if
(attachmentId ==
null
)


return

null
;

128

ВК2.008.104.ПЗ


var

attachment = GetAttachmentSet().FirstOrDefault(a =>

a.Id ==
attachmentId);


return

attachment !=
null

? attachment.FileName :
null
;


}



string

GetUserNameByProfileId(
int

profileId) {


var

userId = (
from

u
in

GetUserProfileSet()


where

u.Id == pr
ofileId


select

u.UserId).FirstOrDefault();


return

Membership
.GetUser(userId).UserName;


}



string

GetUserFriendlyName(
Guid

userId) {


return

GetUserFriendlyName(
Membership
.GetUser(userId).User
Name);


}




string

GetUserFriendlyName(
string

userName) {


return

ProfileBase
.Create(userName).GetPropertyValue(
"FriendlyName"
)
as

string
;


}



[
Invoke
]


public

string

GetFriendlyNameByProfileId(
int

id) {


var

profile = GetUserProfileSet().Where(up => up.Id == id).First();


return

GetUserFriendlyName(
Membership
.GetUser(profile.UserId).UserName);


}



[
Invoke
]


[
RequiresRole
(
RoleNames
.Administrator,
RoleNames
.Support)]


public

IEnumerable
<
SupporterTechnology
> GetTechnologiesForSupporter(
int
?
supporterId) {


var

supporterIdInt = supporterId.HasValue


? supporterId.Value


: GetCurrentUser().Id;


return

from

t
in

GetTechnologySet()


join

st
in

GetSupporterProfile_TechnologySet()


on

t.Id
equals

st.TechnologyId
into

stGroup


select

new

SupporterTechnology

{


Id = t.Id,



Name = t.Name,


IsSupporterHas = stGroup.Any(stSub =>
stSub.SupporterProfileId == supporterIdInt)


};


}



[
Invoke
]


[
RequiresRole
(
RoleNames
.Administrator,
RoleNames
.Support)]


public

void

AssignSupporterTechnologies(
int
? supporterId,
int
[]
technologyIds) {


var

supporterIdInt = supporterId ==
null


? GetCurrentUser().Id


: supporterId.Value;


var

originalTechnologyIds =

from

st
in

GetSupporterProfile_TechnologySet()


where

st.SupporterProfileId ==
supporterIdInt


select

st.TechnologyId;


var

removedIds = originalTechnologyIds.Except(
technologyIds);


foreach
(
var

removeId
in

removedIds) {


var

removeSupporter_Technology = (
from

st
in

GetSupporterProfile_TechnologySet()


where

st.SupporterProfileId ==
supporterIdI
nt

129

ВК2.008.104.ПЗ


&& st.TechnologyId ==
removeId


select

st).FirstOrDefault();


if
(removeSupporter_Technology !=
null
)


ObjectContext.
DeleteObject(removeSupporter_Technology);


}



var

addedIds = technologyIds.Except(originalTechnologyIds);


foreach
(
var

addedId
in

addedIds)


ObjectContext.AddToSupporterProfile_TechnologySet(
new

SupporterProfile_Technology
() {


SupporterProfileId = supporterIdInt,


TechnologyId = addedId


});


ObjectContext.SaveChanges();


}



[
Invoke
]


[
RequiresRole
(
RoleNames
.Administrator)]


public

IEnumerable
<
SupporterSimple
> GetSupportersSimple() {


return

GetUserProfileSet()


.OfType<
SupporterProfile
>().ToArray()


.Select(s =>
new

SupporterSimple

{


Id = s.
Id,


IsCurator = s.IsCurator,


FriendlyName = GetUserFriendlyName(s.UserId)


});


}



[
Invoke
]


[
RequiresRole
(
RoleNames
.Administrator)]


public

void

AssignCurator(
int

supporterId) {


var

supporters = GetUserProfileSet().OfType<
SupporterProfile
>();


if
(!supporters.Any(s => s.Id == supporterId))


return
;


foreach
(
var

supporter
in

supporters) {


supporter.IsCu
rator = supporter.Id == supporterId;


ObjectContext.UserProfileSet.AttachAsModified(supporter);


}


ObjectContext.SaveChanges();


}



[
Invoke
]


[
RequiresRole
(
RoleNames
.Administrator)]


public

IEnumerable
<
TechnologiesReportRow
> GetTechnologiesReport() {


return

from

t
in

GetTechnologySet()


join

th
in

GetThreadSet()


on

t.Id
equals

th.TechnologyId
into

thGroup


where

thGroup.Any()


select

new

TechnologiesReportRow

{


TechnologyName = t.Name,


Value = thGroup.Count()


};


}



[
Invoke
]


[
RequiresRole
(
RoleNames
.Administrator)]


public

SupportReportRow
[] GetSupportReport(
int

monthCount) {


SupportReportRow
[] result =
null
;


var

currentMonthIndex = 0;


foreach
(
var

startDate
in

EnumerateDateRangesForSupportReport(monthCount)) {


var

endDate = startDate.AddMonths(1);



var

filteredThredItems =
from

ti
in

GetThreadItemSet()

130

ВК2.008.104.ПЗ


where

ti.Date >= startDate && ti.Date <
endDate


select

ti;




var

details = (
from

sp
in

GetUserProfileSet().OfType<
SupporterProfile
>()


join

tiFiltered
in

filteredThredItems


on

sp.Id
equals

tiFiltered.UserProfileId
into

tiGroup


orderby

sp.Id


select

new

SupportReportRowDetail

{


SupporterId = sp.Id,


Date = startDate,


Value = tiGroup.Count()


}).ToArray();


var

isResultEmpty = result ==
null
;


if
(isResultEmpty)


result =
new

SupportReportRow
[details.Length];


for
(
int

i = 0; i <

details.Length; i++) {


var

detail = details[i];


if
(isResultEmpty) {


var

supportReportRowDetail =
new

SupportReportRowDetail
[monthCount];


supportReportRowDetail[0] = detail;


result[i] =
new

SupportReportRow

{


SupporterName =
GetFriendlyNameByProfileId(detail.SupporterId),


Details =
new

Sup
portReportRowDetail
[monthCount]


};


}


result[i].Details[currentMonthIndex] = detail;


}


currentMonthIndex++;


}


return

result;


}



static

IEnumerable
<
DateTime
> EnumerateDateRangesForSupportReport(
int

monthCount) {


var

today =
DateTime
.UtcNow;


var

startDate = today.AddMonths(1
-

monthCount);


startDate =
new

DateTime
(startDate.Year, startDate.
Month, 1);



for
(
var

i = 0; i < monthCount; i++)


yield

return

startDate.AddMonths(i);


}


}

}


User.cs

namespace

TechnicalSupport.Web {


///

<summary>


///

Partial class extending the User type that adds shared properties and
methods.


///

These properties and methods will be available both to the server app and
the client app.


///

</summary>


public

partial

class

User

{


///

<summary>


///

Returns the user display name, which by default is its FriendlyName.


///

If FriendlyName is not set, the User Name is returned.


///

</summary>


public

string

DisplayName {

131

ВК2.008.104.ПЗ


get

{


if
(!
string
.IsNu
llOrEmpty(
this
.FriendlyName)) {


return

this
.FriendlyName;


}
else

{


return

this
.Name;


}


}


}


}

}



ProfileSimple.cs

using

System.Runtime.Serialization;


namespace

TechnicalSupport.Web {


[
DataContract
(IsReference =
true
)]


public

class

SupporterSimple

{


[
DataMember
]


public

int

Id {
get
;
set
; }



[
DataMember
]


public

string

FriendlyName {
get
;
set
; }




[
DataMember
]


public

bool

IsCurator {
get
;
set
; }



public

string

FriendlyName {
get
;
set
; }


}

}


RegistrationData.cs

namespace

TechnicalSupport.Web {


using

System.ComponentModel.DataAnnotations;


using

TechnicalSupport.Web.Resources;



///

<summary>


///

Class containing the values and validation rules for user registration.


///

</summary>


public

sealed

partial

class

RegistrationData

{


///

<summary>


///

Gets and sets the user name.


///

</summary>


[
Required
(ErrorMessageResourceName =
"ValidationErrorRequiredField"
,
ErrorMessageResourceType =
typeof
(
ValidationErrorResources
))]


[
Display
(Order = 0, Name =
"UserNameLabel"
, ResourceType =
typeof
(
RegistrationDataResources
))]


[
RegularExpression
(
"^[a
-
zA
-
Z0
-
9_]*$"
, ErrorMessageResourceName =
"ValidationErrorInvalidUserName"
, ErrorMessageResourceType =
typeof
(
ValidationErrorResources
))]


[
StringLength
(255, MinimumLength = 4, ErrorMessageResourceName =
"ValidationErrorBadUser
NameLength"
, ErrorMessageResourceType =
typeof
(
ValidationErrorResources
))]


public

string

UserName {
get
;
set
; }



///

<summary>


///

Gets and sets the email address.


///

</summary>


[
Required
(ErrorMessageResourceName =
"ValidationErrorRequiredField"
,
ErrorMessageResourceType =
typeof
(
ValidationErrorResources
))]

132

ВК2.008.104.ПЗ


[
Display
(Order = 2, Name =
"EmailLabel"
, ResourceType =
typeof
(
RegistrationDataResources
))]


[
RegularExpression
(
@"^([
\
w
-
\
.]+)@((
\
[[0
-
9]{1,3}
\
.[0
-
9]
{1,3}
\
.[0
-
9]{1,3}
\
.)|(([
\
w
-
]+
\
.)+))([a
-
zA
-
Z]{2,4}|[0
-
9]{1,3})(
\
]?)$"
,


ErrorMessageResourceName =
"ValidationErrorInvalidEmail"
, ErrorMessageResourceType =
typeof
(
ValidationErrorResources
))]


public

string

Email {
get
;
set
;

}



///

<summary>


///

Gets and sets the friendly name of the user.


///

</summary>


[
Display
(Order = 1, Name =
"FriendlyNameLabel"
, Description =
"FriendlyNameDescription"
, ResourceType =
typeof
(
RegistrationDataResources
))]


[
StringLength
(255, MinimumLength = 0, ErrorMessageResourceName =
"ValidationErrorBadFriendlyNameLength"
, ErrorMessageResourceType =
typeof
(
ValidationErrorResources
))]


public

string

FriendlyName {
get
;
set
; }



///// <summary>



///// Gets and sets the security question.


///// </summary>


//[Required(ErrorMessageResourceName = "ValidationErrorRequiredField",
ErrorMessageResourceType = typeof(ValidationErrorResources))]


//[Display(Order = 5, Name = "Security
QuestionLabel", ResourceType =
typeof(RegistrationDataResources))]


//public string Question { get; set; }



///// <summary>


///// Gets and sets the answer to the security question.


///// </summary>


//[Required(ErrorMessageResourceName = "ValidationErrorRequiredField",
ErrorMessageResourceType = typeof(ValidationErrorResources))]


//[Display(Order = 6, Name = "SecurityAnswerLabel", ResourceType =
typeof(RegistrationDataResources))]


//[S
tringLength(128, ErrorMessageResourceName =
"ValidationErrorBadAnswerLength", ErrorMessageResourceType =
typeof(ValidationErrorResources))]


//public string Answer { get; set; }


}

}



RoleNames.cs

namespace

TechnicalSupport.Web.Models {


sealed

class

RoleNames

{


public

const

string

Administrator =
"Administrator"
;


public

const

string

Support =
"Support"
;


public

const

string

Customer =
"Customer"
;


}

}



SupporterTechnology.cs

using

System.Runtime.Serialization;


namespace

TechnicalSupport.Web {


[
DataContract
(IsReference =
true
)]


public

class

SupporterTechnology

{


[
DataMember
]

133

ВК2.008.104.ПЗ


public

int

Id {
get
;
set
; }



[
DataMember
]


public

string

Name {
get
;
set
; }



[
DataMember
]


public

bool

IsSupporterHas {
get
;
set
; }


}

}


SupportReportRow.cs

using

System.Collections.Generic;

using

System.Runtime.Serialization;


namespace

TechnicalSupport.Web {


[
DataContract
(IsReference =
true
)]


public

class

SupportReportRow

{


public

int

SupporterId {
get
;
set
; }



[
DataMember
]


public

string

SupporterName {
get
;
set
; }



[
DataMember
]


public

SupportReportRowDetail
[] Details {
get
;
set
; }


}

}


SupportReportRowDetail.cs

using

System;

using

System.Runtime.Serialization;


namespace

TechnicalSupport.Web {


[
DataContract
(IsReference =
true
)]


public

class

SupportReportRowDetail

{


public

int

SupporterId {
get
;
set
; }



[
DataMember
]


public

DateTime

Date {
get
;
set
; }



[
DataMember
]


public

int

Value {
get
;
set
; }


}

}


TechnologiesReportRow.cs

using

System.Runtime.Serialization;


namespace

TechnicalSupport.Web {


[
DataContract
(IsReference =
true
)]


public

class

TechnologiesReportRow

{


[
DataMember
]


public

string

TechnologyName {
get
;
set
; }



[
DataMember
]


public

int

Value {
get
;
set
; }


}

}

134

ВК2.008.104.ПЗ


ThreadItemProxy.cs

using

System.Runtime.Serialization;

using

System;


namespace

TechnicalSupport.Web {


[
DataContract
(IsReference =
true
)]


public

class

ThreadItemProxy

{


[
DataMember
]


public

int

Id {
get
;
set
;}



[
DataMember
]


public

DateTime

Date {
get
;
set
; }



[
DataMember
]


public

string

Text {
get
;
set
; }



[
DataMember
]


public

int
? AttachmentId {
get
;
set
; }



[
DataMember
]


public

string

AttachmentName {
get
;
set
; }




[
DataMember
]


public

bool

IsCustomer {
get
;
set
; }



[
DataMember
]


public

string

UserFriendlyName {
get
;
set
; }


}

}


Global.asax.cs

using

System;

using

System.Diagnostics;

using

System.Threading;


namespace

TechnicalSupport.Web {


public

class

Global

: System.Web.
HttpApplication

{



protected

void

Application_Start(
objec
t

sender,
EventArgs

e) {



}



protected

void

Session_Start(
object

sender,
EventArgs

e) {



}



protected

void

Application_BeginRequest(
object

sender,
EventArgs

e) {



}



protected

void

Application_AuthenticateRequest(
object

sender,
EventArgs

e)
{



}



protected

void

Application_Error(
object

sender,
EventArgs

e) {


var

exception = Server.GetLastError();


if
(exception
is

ThreadAbortException
)



return
;

135

ВК2.008.104.ПЗ


Trace
.WriteLine(
"
Серверная

ошибка
: "

+ exception);


}



protected

void

Session_End(
object

sender,
EventArgs

e) {



}



protected

void

Application_End(
object

sender,
EventArgs

e) {



}


}

}


SilverlightFaultBehavior.cs

// This is an auto
-
generated file to enable WCF faults to reach Silverlight
clients.


using

System;

using

System.Collections.Generic;

using

System.Collections.ObjectModel;

using

System.Linq;

using

System.Runtime.Serialization;

using

System.Net;

using

System.ServiceModel;

using

System.ServiceModel.Channels;

using

System.ServiceModel.Description;

using

System.ServiceModel.Dispatcher;


namespace

TechnicalSupport.Web {


public

class

SilverlightFaultBehavior

:
Attribute
,
IServiceB
ehavior

{


private

class

SilverlightFaultEndpointBehavior

:
IEndpointBehavior

{


public

void

AddBindingParameters(
ServiceEndpoint

endpoint,
BindingParameterCollection

bindingParameters) {


}



public

void

ApplyClientBehavior(
ServiceEndpoint

endpoint,
ClientRuntime

clientRuntime) {


}



public

void

ApplyDispatchBehavior(
ServiceEndpoint

endpoint,
EndpointDispatcher

endpointDispatcher) {


endpointDispatcher.DispatchRuntime
.MessageInspectors.Add(
new

SilverlightFaultMessageInspector
());


}



public

void

Validate(
ServiceEndpoint

endpoint) {


}



private

class

SilverlightFaultMessageInspector

:
IDispatchMessageInspector

{


public

object

AfterReceiveRequest(
ref

Message

request,
IClientChannel

channel,
InstanceContext

instanceContext) {


return

null
;


}



public

void

BeforeSendReply(
ref

Message

reply,
object

correlationState) {


if
((reply !=
null
) && reply.IsFault) {


HttpResponseMessageProperty

property =
new

HttpResponseMessageProperty
();


property.StatusCode =
HttpStatusCode
.OK;

136

ВК2.008.104.ПЗ



reply.Properties[
HttpResponseMessageProperty
.Name] =
property;


}


}


}


}



public

void

AddBindingParameters(
ServiceDescription

serviceDescription,
ServiceHostBase

serviceHostBase,
Collection
<
ServiceEndpoint
> endpoints,
BindingParameterCollection

bindingParameters) {


}



public

void

ApplyDispatchBehavior(
ServiceDescription

serviceDescription,
ServiceHostBase

serviceHostBase) {


foreach
(
ServiceEndpoint

endpoi
nt
in

serviceDescription.Endpoints) {


endpoint.Behaviors.Add(
new

SilverlightFaultEndpointBehavior
());


}


}



public

void

Validate(
ServiceDescription

serviceDescription,
ServiceHostBase

serviceHostBase) {


}


}

}



TechnicalSupport.Designer.cs

//
------------------------------------------------------------------------------

// <auto
-
generated>

// This code was generated from a template.

//

// Manual changes to this file may cause unexpected behavior in

your
application.

// Manual changes to this file will be overwritten if the code is regenerated.

// </auto
-
generated>

//
------------------------------------------------------------------------------


using

System;

using

System.Data.Objects;

using

Syste
m.Data.Objects.DataClasses;

using

System.Data.EntityClient;

using

System.ComponentModel;

using

System.Xml.Serialization;

using

System.Runtime.Serialization;


[
assembly
:
EdmSchemaAttribute
()]

#region

EDM Relationship Metadata


[
assembly
:
EdmRelationshipAttr
ibute
(
"TechnicalSupport"
,
"ThreadThreadItem"
,
"Thread"
, System.Data.Metadata.Edm.
RelationshipMultiplicity
.One,
typeof
(TechnicalSupport.Web.
Thread
),
"ThreadItem"
,
System.Data.Metadata.Edm.
RelationshipMultiplicity
.Many,
typeof
(TechnicalSupport.Web.
ThreadItem
),
true
)]

[
assembly
:
EdmRelationshipAttribute
(
"TechnicalSupport"
,
"TechnologyThread"
,
"Technology"
, System.Data.Metadata.Edm.
RelationshipMultiplicity
.ZeroOrOne,
typeof
(TechnicalSupport.Web.
Technology
),
"Thread"
,
System.Data.Metadata.Edm.
RelationshipMultipl
icity
.Many,
typeof
(TechnicalSupport.Web.
Thread
),
true
)]

[
assembly
:
EdmRelationshipAttribute
(
"TechnicalSupport"
,
"ThreadItemUserProfile"
,
"ThreadItem"
, System.Data.Metadata.Edm.
RelationshipMultiplicity
.Many,
typeof
(TechnicalSupport.Web.
ThreadItem
),
"UserProfile"
,
137

ВК2.008.104.ПЗ

System.Data.Metadata.Edm.
RelationshipMultiplicity
.One,
typeof
(TechnicalSupport.Web.
UserProfile
),
true
)]

[
assembly
:
EdmRelationshipAttribute
(
"TechnicalSupport"
,
"SupporterProfile_TechnologyTechnology"
,
"SupporterProfile_Technology"
,
System.Da
ta.Metadata.Edm.
RelationshipMultiplicity
.Many,
typeof
(TechnicalSupport.Web.
SupporterProfile_Technology
),
"Technology"
,
System.Data.Metadata.Edm.
RelationshipMultiplicity
.One,
typeof
(TechnicalSupport.Web.
Technology
),
true
)]

[
assembly
:
EdmRelationshipAttribut
e
(
"TechnicalSupport"
,
"SupporterProfile_TechnologySupporterProfile"
,
"SupporterProfile_Technology"
,
System.Data.Metadata.Edm.
RelationshipMultiplicity
.Many,
typeof
(TechnicalSupport.Web.
SupporterProfile_Technology
),
"SupporterProfile"
,
System.Data.Metadata.Edm.
RelationshipMultiplicity
.One,
typeof
(TechnicalSupport.Web.
SupporterProfile
),
true
)]

[
assembly
:
EdmRelationshipAttribute
(
"TechnicalSupport"
,
"ThreadCustomerProfile"
,
"Thread"
, System.Data.Metadata.Edm.
RelationshipMultiplicity
.Many,
typeof
(TechnicalSupport.Web.
Thread
),
"CustomerProfile"
,
System.Data.Metadata.Edm.
RelationshipMultiplicity
.One,
typeof
(TechnicalSupport.Web.
CustomerProfile
),
true
)]

[
assembly
:
EdmRelationshipAttribute
(
"TechnicalSupport"
,
"ThreadSupporterProfile"
,
"Thread"
,
System.Data.Metadata.Edm.
RelationshipMultiplicity
.Many,
typeof
(TechnicalSupport.Web.
Thread
),
"SupporterProfile"
,
System.Data.Metadata.Edm.
RelationshipMultiplicity
.ZeroOrOne,
typeof
(TechnicalSupport.Web.
SupporterProfile
),
true
)]

[
assembly
:
EdmRelationshipAttribute
(
"TechnicalSupport"
,
"AttachmentThreadItem"
,
"Attachment"
, System.Data.Metadata.Edm.
RelationshipMultiplicity
.ZeroOrOne,
typeof
(TechnicalSupport.Web.
Attachment
),
"ThreadItem"
,
System.Data.Metadata.Edm.
RelationshipMultiplicity
.Many,
t
ypeof
(TechnicalSupport.Web.
ThreadItem
),
true
)]


#endregion


namespace

TechnicalSupport.Web

{


#region

Contexts




///

<summary>


///

No Metadata Documentation available.


///

</summary>


public

partial

class

TechnicalSupportContainer

:
ObjectContext


{


#region

Constructors




///

<summary>


///

Initializes a new TechnicalSupportContainer object using the
connection string found in the 'TechnicalSupportContainer' section of the
application configuration file.



///

</summary>


public

TechnicalSupportContainer() :
base
(
"name=TechnicalSupportContainer"
,
"TechnicalSupportContainer"
)


{


this
.ContextOptions.LazyLoadingEnabled =
true
;


OnContextCreated();


}




///

<summary>


///

Initialize a new TechnicalSupportContainer object.


///

</summary>


public

TechnicalSupportContainer(
string

connectionString) :
base
(connectionString,
"TechnicalSupportContainer"
)


{


this
.ContextOptions.LazyLoadingEnabled =
true
;


OnContextCreated();


}



138

ВК2.008.104.ПЗ


///

<summary>


///

Initialize a new TechnicalSupportContainer object.


///

</summary>


public

TechnicalSupportContainer(
EntityConnection

connection) :
base
(connection,
"TechnicalSupportContainer"
)


{


this
.ContextOptions.LazyLoadingEnabled =
true
;


OnContextCreated();


}




#endregion




#region

Partial Methods




partial

void

OnContextCreated();




#endregion




#region

ObjectSet Properties




///

<summary>


///

No Metadata Documentation available.


///

</summary>


public

ObjectSet
<
Thread
> ThreadSet


{


get


{


if

((_ThreadSet ==
null
))


{


_ThreadSet =
base
.CreateObjectSet<
Thread
>(
"ThreadSet"
);


}


return

_ThreadSet;


}


}


private

ObjectSet
<
Thread
> _ThreadSet;




///

<summary>


///

No Metadata Documentation available.


///

</summary>


public

ObjectSet
<
Technology
> TechnologySet


{


get


{


if

((_TechnologySet ==
null
))


{


_TechnologySet =
base
.CreateObjectSet<
Technology
>(
"TechnologySet"
);


}


return

_TechnologySet;


}


}


private

ObjectSet
<
Technology
> _TechnologySet;




///

<summary>


///

No Metadata Documentation available.


///

</summary>


public

ObjectSet
<
UserProfile
> UserProfileSet


{


get


{


if

((_UserProfileSet ==
null
))


{


_UserProfileSet =
base
.CreateObjectSet<
UserProfile
>(
"UserProfileSet"
);


}

139

ВК2.008.104.ПЗ


return

_UserProfileSet;


}


}


private

ObjectSet
<
UserProfile
> _UserProfileSet;




///

<summary>


///

No Metadata Documentation available.


///

</summary>


public

ObjectSet
<
ThreadItem
> ThreadItemSet


{


get


{


if

((_ThreadItemSet ==
null
))


{


_ThreadItemSet =
base
.CreateObjectSet<
ThreadItem
>(
"ThreadItemSet"
);


}


return

_ThreadItemSet;


}


}


private

ObjectSet
<
ThreadItem
> _ThreadItemSet;




///

<summary>


///

No Metadata Documentation available.


///

</summary>


public

ObjectSet
<
Attachment
> AttachmentSet


{


get


{


if

((_AttachmentSet ==
null
))


{


_AttachmentSet =
base
.CreateObjectSet<
Attachment
>(
"AttachmentSet"
);


}


return

_AttachmentSet;


}


}


private

ObjectSet
<
Attachment
> _AttachmentSet;




///

<summary>


///

No Metadata Documentation available.


///

</summary>


public

ObjectSet
<
SupporterProfile_Technology
>
SupporterProfile_TechnologySet


{


get


{


if

((_SupporterProfile_TechnologySet ==
nul
l
))


{


_SupporterProfile_TechnologySet =
base
.CreateObjectSet<
SupporterProfile_Technology
>(
"SupporterProfile_TechnologySet"
);


}


return

_SupporterProfile_TechnologySet;


}


}


private

ObjectSet
<
SupporterProfile_Technology
>
_SupporterProfile_TechnologySet;



#endregion


#region

AddTo Methods




///

<summary>

140

ВК2.008.104.ПЗ


///

Deprecated Method for adding a new object to the ThreadSet EntitySet.

Consider using the .Add method of the associated ObjectSet&lt;T&gt; property
instead.


///

</summary>


public

void

AddToThreadSet(
Thread

thread)


{


base
.AddObject(
"ThreadSet"
, thread);


}




///

<summary>


///

Deprecated Method for adding a new object to the TechnologySet
EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt;
property instead.


///

</summary>


public

void

AddToTechnologySet(
Technology

technology)


{


base
.AddObject(
"TechnologySet"
, technology);


}




///

<summary>


///

Deprecated Method for adding a new object to the UserProfileSet
EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&
gt;
property instead.


///

</summary>


public

void

AddToUserProfileSet(
UserProfile

userProfile)


{


base
.AddObject(
"UserProfileSet"
, userProfile);


}




///

<summary>


///

Deprecated Method for adding a new object to the ThreadItemSet
EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt;
property instead.


///

</summary>


public

void

AddToThreadItemSet(
ThreadItem

threadItem)


{


base
.AddObject(
"ThreadItemSet"
, threadItem);


}




///

<summary>


///

Deprecated Method for adding a new object to the AttachmentSet
EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&
gt;
property instead.


///

</summary>


public

void

AddToAttachmentSet(
Attachment

attachment)


{


base
.AddObject(
"AttachmentSet"
, attachment);


}




///

<summary>


///

Deprecated Method for adding a new object to the
SupporterProfile_TechnologySet EntitySet. Consider using the .Add method of the
associated ObjectSet&lt;T&gt; property instead.


///

</summary>


public

void

AddToSupporterProfile_TechnologySet
(
SupporterProfile_Technology

supporterProfile_Technology)


{


base
.AddObject(
"SupporterProfile_TechnologySet"
,
supporterProfile_Technology);


}



#endregion


}



141

ВК2.008.104.ПЗ



#endregion




#region

Entities




///

<
summary>


///

No Metadata Documentation available.


///

</summary>


[
EdmEntityTypeAttribute
(NamespaceName=
"TechnicalSupport"
, Name=
"Attachment"
)]


[
Serializable
()]


[
DataContractAttribute
(IsReference=
true
)]


public

partial

class

Attachment

:
EntityObject


{


#region

Factory Method




///

<summary>


///

Create a new Attachment object.


///

</summary>


///

<param name="id">
Initial value of the Id property.
</param>


///

<param name="fil
eName">
Initial value of the FileName property.
</param>


///

<param name="content">
Initial value of the Content property.
</param>


public

static

Attachment

CreateAttachment(
global
::System.
Int32

id,
global
::System.
String

fileName,
global
::System.
Byte
[] content)


{


Attachment

attachment =
new

Attachment
();


attachment.Id = id;


attachment.FileName = fileName;


attachment.Content = content;


return

attachment;


}



#endregion


#region

Primitive Properties




///

<summary>


///

No Metadata Documentation available.


///

</summary>


[
EdmScalarPropertyAttribute
(EntityKeyProperty=
true
, IsNullable=
false
)]


[
DataMemberAttribute
()]


public

global
::System.
Int32

Id


{


get


{


return

_Id;


}


set


{


if

(_Id !=
value
)


{


OnIdChanging(
value
);


ReportPropertyChanging(
"Id"
);


_Id =
StructuralObject
.SetValidValue(
value
);


ReportPropertyChanged(
"Id"
);


OnIdChanged();


}


}


}


private

global
::System.
Int32

_Id;


partial

void

OnIdChanging(
global
::System.
Int32

value);


partial

void

OnIdChanged();




///

<summary>


///

No Metadata Documentation available.


///

<
/summary>


[
EdmScalarPropertyAttribute
(EntityKeyProperty=
false
, IsNullable=
false
)]

142

ВК2.008.104.ПЗ


[
DataMemberAttribute
()]


public

global
::System.
String

FileName


{


get


{


return

_FileName;


}


set


{


OnFileNameChanging(
value
);


ReportPropertyChanging(
"FileName"
);


_FileName =
StructuralObject
.SetValidValue(
value
,
false
);


ReportPropertyChanged(
"FileName"
);



OnFileNameChanged();


}


}


private

global
::System.
String

_FileName;


partial

void

OnFileNameChanging(
global
::System.
String

value);


partial

void

OnFileNameChanged();




///

<summary>


///

No Metadata Documentation available.


///

</summary>


[
EdmScalarPropertyAttribute
(EntityKeyProperty=
false
, IsNullable=
false
)]


[
DataMemberAttribute
()]


public

global
::System.
Byte
[] Content


{


get


{


return

StructuralObject
.GetValidValue(_Content);


}


set


{


OnContentChanging(
value
);


ReportPropertyChanging(
"Content"
);


_Content =
StructuralObj
ect
.SetValidValue(
value
,
false
);


ReportPropertyChanged(
"Content"
);


OnContentChanged();


}


}


private

global
::System.
Byte
[] _Content;


partial

void

OnContentChanging(
global
::System.
Byte
[]
value);


partial

void

OnContentChanged();



#endregion




#region

Navigation Properties




///

<summary>


///

No Metadata Documentation available.


///

</summary>


[
XmlIgnoreAttribute
()]


[
SoapI
gnoreAttribute
()]


[
DataMemberAttribute
()]


[
EdmRelationshipNavigationPropertyAttribute
(
"TechnicalSupport"
,
"AttachmentThreadItem"
,
"ThreadItem"
)]


public

EntityCollection
<
ThreadItem
> ThreadItem


{


get


{


return

((
IEntityWithRelationships
)
this
).RelationshipManager.GetRelatedCollection<
ThreadIt
em
>(
"TechnicalSupport.AttachmentThreadItem"
,
"ThreadItem"
);


}


set

143

ВК2.008.104.ПЗ


{


if

((
value

!=
null
))



{


((
IEntityWithRelationships
)
this
).RelationshipManager.InitializeRelatedCollection<
T
hreadItem
>(
"TechnicalSupport.AttachmentThreadItem"
,
"ThreadItem"
,
value
);


}


}


}



#endregion


}




///

<summary>


///

No Metadata Documentation available.


///

</summary>


[
EdmEntityTypeAttribute
(NamespaceName=
"TechnicalSupport"
,
Name=
"CustomerProfile"
)]


[
Serializable
()]


[
DataContractAttribute
(IsReference=
true
)]


public

partial

class

CustomerProfile

:
UserProfile


{


#region

Factory Method




///

<summary>


///

Create a new CustomerProfile object.


///

</summary>


///

<param name="id">
Initial value of the Id property.
</param>


///

<
param name="userId">
Initial value of the UserId property.
</param>


public

static

CustomerProfile

CreateCustomerProfile(
global
::System.
Int32

id,
global
::System.
Guid

userId)


{


CustomerProfile

customerProfile =
new

CustomerProfile
()
;


customerProfile.Id = id;


customerProfile.UserId = userId;


return

customerProfile;


}



#endregion




#region

Navigation Properties




///

<summary>


///

No Metadata Documentation available.


///

</summary>


[
XmlIgnoreAttribute
()]


[
SoapIgnoreAttribute
()]


[
DataMemberAttribute
()]


[
EdmRelationshipNavigationPropertyAttribute
(
"TechnicalSupport"
,
"ThreadCustomerProfile"
,
"Thread"
)]


public

EntityCollection
<
Thread
> Thread


{


get


{


return

((
IEntityWithRelationships
)
this
).RelationshipManager.GetRelatedCollection<
Thread
>(
"TechnicalSupport.ThreadCustomerProfile"
,
"Thread"
);


}


set


{


if

((
value

!=
null
))


{


((
IEntityWithRelationships
)
this
).RelationshipManager.InitializeRelatedCollection<
T
hread
>(
"TechnicalSupport.ThreadCustomerProfile"
,
"Thread"
,
value
);

144

ВК2.008.104.ПЗ


}


}


}



#endregion


}




///

<summary>


///

No Metadata Documentation available.


///

</summary>


[
EdmEntityTypeAttribute
(NamespaceName=
"TechnicalSupport"
,
Name=
"SupporterProfile"
)]


[
Serializable
()]


[
DataContractAttribute
(IsReference=
true
)]


public

partial

class

SupporterProfile

:
UserProfile


{


#region

Factory Method




///

<summary>


///

Create a new SupporterProfile object.


///

</summary>


///

<param name="id">
Initial value of the Id property.
</param>


///

<param name="userId">
Initial value of the UserId property.
</param>


///

<param name="isCurator">
Initial
value of the IsCurator
property.
</param>


public

static

SupporterProfile

CreateSupporterProfile(
global
::System.
Int32

id,
global
::System.
Guid

userId,
global
::System.
Boolean

isCurator)


{


SupporterProfile

supporterProfile =
new

SupporterProfile
();


supporterProfile.Id = id;


supporterProfile.UserId = userId;


supporterProfile.IsCurator = isCurator;


return

supporterProfile;


}



#endregion


#region

Primitive Propert
ies




///

<summary>


///

No Metadata Documentation available.


///

</summary>


[
EdmScalarPropertyAttribute
(EntityKeyProperty=
false
, IsNullable=
false
)]


[
DataMemberAttribute
()]


public

global
::System.
Boolean

IsCurator


{


get


{


return

_IsCurator;


}


set


{


OnIsCuratorChanging(
value
);


ReportPropertyChanging(
"IsCurator"
);


_IsCurator =
StructuralObject
.SetValidValue(
value
);


ReportPropertyChanged(
"IsCurator"
);


OnIsCuratorChanged();


}


}


private

global
::System.
Boolean

_IsCurator;


partial

void

OnIsCuratorChanging(
global
::System.
Boolean

value);


partial

void

OnIsCuratorChanged();



#endregion




#region

Navigation Properties

145

ВК2.008.104.ПЗ




///

<summary>


///

No Metadata Documentation available.


///

</summary>


[
XmlIgnoreAttribute
()]


[
SoapIgnoreAttribute
()]


[
DataMemberAttribute
()]


[
EdmRelationshipNavigationPropertyAttribute
(
"TechnicalSupport"
,
"SupporterProfile_TechnologySupporterProfile"
,
"SupporterProfile_Technology"
)]


public

EntityCollection
<
SupporterProfile_Technology
>
SupporterProfile_Technology


{


get


{


return

((
IEntityWithRelationships
)
this
).RelationshipManager.GetRelatedCollection<
Supporte
rProfile_Technology
>(
"TechnicalSuppor
t.SupporterProfile_TechnologySupporterProfile
"
,
"SupporterProfile_Technology"
);


}


set


{


if

((
value

!=
null
))


{


((
IEntityWithRelationships
)
this
).RelationshipManager.InitializeRelatedCollection<
S
upporterProfile_Technology
>(
"TechnicalSupport.SupporterProfile_TechnologySupporter
Profile"
,
"SupporterProfile_Technology"
,
value
);


}


}


}




///

<summary>



///

No Metadata Documentation available.


///

</summary>


[
XmlIgnoreAttribute
()]


[
SoapIgnoreAttribute
()]


[
DataMemberAttribute
()]


[
EdmRelationshipNavigationPropertyAttribute
(
"TechnicalSupport"
,
"ThreadSupporterProfile"
,
"Thread"
)]


public

EntityCollection
<
Thread
> Thread


{


get


{


return

((
IEntityWithRelationships
)
this
)