create child records for master class how in wcf service

Posted by Mandlaa under WCF on 7/2/2014 | Points: 10 | Views : 354 | Status : [Member] | Replies : 4
Load
Order Number
Oname
Freight (0..n)
Load Requirement (0..n)
Stop (1..n)
Event (1..n)
Schedule (0..n)
Reference Number (0..n)
Note (0..n)
Freight
Commodity
Count
Weight

Load Requirement
Applies To
Requirement
Qty
Range
Stop
Company Id
Sequence
Schedule (1..n)
Event (1..n)

Event
Type
Commodity
Driver Count
Count
Weight
Pieces
Cubes


These are the Master and corresponding child classes,

I want use this one create wcf service?

My question is,How to create master and child

I am creating one Class EX:Load like below

[DataContract]
public class Load
{
[DataMember]
public int OrderNumber { get; set; }

[DataMember]
public DateTime BookDate { get; set; }

[DataMember]
public string Oname { get; set; }

[DataMember]
public string Freight { get; set; }

[DataMember]
public string LoadRequirement { get; set; }

[DataMember]
public string Stop { get; set; }

[DataMember]
public string ReferenceNumber { get; set; }

[DataMember]
public string Note { get; set; }

}
public partial class LoadData
{
private static readonly LoadData _instance = new LoadData();

private LoadData() { }

public static LoadData Instance
{
get
{
return _instance;
}
}
I want to create renaming Freight,Load Requirement,Stop etc how can i create?




Responses

Posted by: Bandi on: 7/3/2014 [Member] [MVP] Platinum | Points: 25

Up
0
Down
This link might help you
http://www.devcurry.com/2011/05/silverlight-4-nested-datagrid-for.html

Mark This Response as Answer
--
Chandu
http://www.dotnetfunda.com/images/dnfmvp.gif

Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mandlaa on: 7/3/2014 [Member] Starter | Points: 25

Up
0
Down
thank you for replying
[DataContract]
public class Load
{
[DataMember]
public int OrderNumber { get; set; }
[DataMember]
public DateTime BookDate { get; set; }

[DataMember]
public string Freight { get; set; }
[DataMember]
public string LoadRequirement { get; set; }
[DataMember]
public string Stop { get; set; }
[DataMember]
public string ReferenceNumber { get; set; }
[DataMember]
public string Note { get; set; }
public List<Freight> AllotedFreghts { get; set; }

}

[DataContract]
public class Freight
{
[DataMember]
public string Commodity { get; set; }

[DataMember]
public string Count { get; set; }
[DataMember]
public string CountUnit { get; set; }

[DataMember]
public string JIT { get; set; }
[DataMember]
public string Expedited { get; set; }

}
public partial class LoadData
{
private static readonly LoadData _instance = new LoadData();

private LoadData() { }

public static LoadData Instance
{
get
{
return _instance;
}
}
private List<Load> loadList = new List<Load>
{
new Load() { OrderNumber=1,BookDate=new DateTime(2014,7, 21),BookedBy="Sampath",Status="Process...",InvoiceStatus="p",PaperWorkStatus="Wait",BillTo="Sa",StartDate=new DateTime(2014,5,3),
CompletionDate=new DateTime(2014,4,23),TotalMiles="10mi",Trailer="sample",Priority="First",Freight="sa",LoadRequirement="sam",Stop="No",
ReferenceNumber="123nn",Note="varify",
AllotedFreghts=new List<Freight>
{ new Freight () { Commodity="Books",Count="2bun",CountUnit="7unit",Weight="30kg",WeightUnit="300mill",HasMat="US",HighValue="10mi",JIT="sample",Expedited="with in twodays"}

}}
};

public List<Load> LoadList
{
get
{
return loadList;
}
}
}
The above two class i am doing like this,
This is correct what i am doing?
anything wrong correct my code

Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mandlaa on: 7/3/2014 [Member] Starter | Points: 25

Up
0
Down
I am running what i am writing code getting bellow output

-<Load>


-<AllotedFreghts>


-<Freight>

<Commodity>Books</Commodity>

<Count>2bun</Count>

<CountUnit>7unit</CountUnit>

<Expedited>with in twodays</Expedited>

<HasMat>US</HasMat>

<HighValue>10mi</HighValue>

<JIT>sample</JIT>

<Weight>30kg</Weight>

<WeightUnit>300mill</WeightUnit>

</Freight>


+<Freight>

</AllotedFreghts>

<BillTo>Sa</BillTo>

<BookDate>2014-07-21T00:00:00</BookDate>

<BookedBy>Sampath</BookedBy>

<CompletionDate>2014-04-23T00:00:00</CompletionDate>

<Freight>sa</Freight>

<InvoiceStatus>p</InvoiceStatus>

<LoadRequirement>sam</LoadRequirement>

<Note>varify</Note>

<OrderNumber>1</OrderNumber>

<PaperWorkStatus>Wait</PaperWorkStatus>

<Priority>First</Priority>

<ReferenceNumber>123nn</ReferenceNumber>

<StartDate>2014-05-03T00:00:00</StartDate>

<Status>Process...</Status>

<Stop>No</Stop>

<TotalMiles>10mi</TotalMiles>

<Trailer>sample</Trailer>

</Load>

I want this type of OUT PUT

<OrderNumber>1</OrderNumber>
<BookDate>2014-07-21T00:00:00</BookDate>

<BookedBy>Sampath</BookedBy>

<CompletionDate>2014-04-23T00:00:00</CompletionDate>

<Freight>
<Commodity>...</Commodity>
<Count>...</Count>
<CountUnit>...</CountUnit> ...
</Freight>

<InvoiceStatus>p</InvoiceStatus>

<LoadRequirement>sam</LoadRequirement>

<Note>varify</Note>


<PaperWorkStatus>Wait</PaperWorkStatus>

<Priority>First</Priority>

<ReferenceNumber>123nn</ReferenceNumber>

<StartDate>2014-05-03T00:00:00</StartDate>

<Status>Process...</Status>

<Stop>No</Stop>

<TotalMiles>10mi</TotalMiles>

<Trailer>sample</Trailer>

Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Mandlaa on: 7/4/2014 [Member] Starter | Points: 25

Up
0
Down
any one please help me
Once see my code here

https://onedrive.live.com/redir?resid=112C637580ED1B00!22388&authkey=!AIE7KqcML2Nrn_Y&ithint=file%2c.rar


Mandlaa, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response