Am calling an existing wcf service to select records once the record is pulled over thru wcf i do my logic(kinda upload),once its done i have to update the record in the DB.
Here is the way am calling the wcf service
GatewayService.ServiceClient proxy = new ServiceClient("IService");
SearchCriteria criteria = new SearchCriteria();
criteria.UserRoles = new string[]{"*"};
var stories = proxy.GetStoryItemsByCriteria(criteria);
var programs = proxy.GetPrograms();
var readyToDistribute = from story in stories
where story.Submitted
&& story.Status == "Open"
select story;
var joined = from story in readyToDistribute
join program in programs on story.ProgramId equals program.Id
select new StoryProgram(story, program);
foreach (StoryProgram sp in joined)
{
Distribute(sp.Story, sp.Program);
//update the status here in DB
}
Below is the WCF Service and Controller details
Below code in the Service
public void UpdateProgram(ProgramData prg)
{
ServiceController.UpdateProgram(prg);
}
below code in the service Controller
internal static void UpdateProgram(ProgramData prg)
{
IProgramDAO prgDAO = DataAccessObjectFactory.GetProgramDAO();
prgDAO.Update(prg);
}
I have the status column in my story table i have to update once the distribute function done.
Any help please.Thanks in Advance
You would need to add an Update method to your WCF service, and call that, with the new data, to update the DB records.
Upate
Given your comment, you should be able to do something like this: