Dear Graham,
Keep a button in your form and then on button click event write this code for getting the values from the fields and passing them to Sharepoint list.
public void btn_AdminSend_Clicked(object sender, ClickedEventArgs e)
{
XPathNavigator Root = MainDataSource.CreateNavigator();
string TravelRequestnumber = Root.SelectSingleNode("/my:travelRequest/my:TravelRequestNumber", NamespaceManager).Value;
string EmployeeName = Root.SelectSingleNode("/my:travelRequest/my:Name", NamespaceManager).Value;
string Approver = Root.SelectSingleNode("/my:travelRequest/my:ddbApprover", NamespaceManager).Value; ;
string EmailID = Root.SelectSingleNode("/my:travelRequest/my:EmailID", NamespaceManager).Value; ;
string Designation = Root.SelectSingleNode("/my:travelRequest/my:Designation", NamespaceManager).Value; ;
string ClassTravel = Root.SelectSingleNode("/my:travelRequest/my:TravelerInformation/my:TravelClass", NamespaceManager).Value; ;
string ModeTravel = Root.SelectSingleNode("/my:travelRequest/my:TravelMode", NamespaceManager).Value; ;
XPathNodeIterator iter = Root.Select("/my:travelRequest/my:trips/my:trip", NamespaceManager);
XPathNavigator DealInfo = null;
XPathNavigator TripInfo = null;
using (SPWeb Rootweb = SPContext.Current.Web)
{
Rootweb.AllowUnsafeUpdates = true;
SPList SourceList = Rootweb.Lists["Deal Cost Information"];
SPListItem newItem = null;
while (iter.MoveNext())
{
TripInfo = iter.Current.CreateNavigator();
XPathNodeIterator iter1 = iter.Current.Select("my:DealDetails/my:DealCostInfo", NamespaceManager);
while (iter1.MoveNext())
{
newItem = SourceList.Items.Add();
DealInfo = iter1.Current.CreateNavigator();
newItem["Travel Request Number"] = TravelRequestnumber;
newItem["Employee Name"] = EmployeeName;
newItem["Approver Name"] = Approver;
newItem["Email ID"] = EmailID;
newItem["Designation"] = Designation;
newItem["Class Of Travel"] = ClassTravel;
newItem["Travel Mode"] = ModeTravel;
newItem["Trip ID"] = TripInfo.SelectSingleNode("my:TripID", NamespaceManager).Value;
newItem["Travel From"] = TripInfo.SelectSingleNode("my:TravelFrom", NamespaceManager).Value;
newItem["Travel To"] = TripInfo.SelectSingleNode("my:TravelTo", NamespaceManager).Value;
newItem["Departure Date"] = TripInfo.SelectSingleNode("my:departureDate", NamespaceManager).Value;
newItem["Departure Time"] = TripInfo.SelectSingleNode("my:DepartureTime", NamespaceManager).Value;
//string Departure = TripInfo.SelectSingleNode("my:DepartureTime", NamespaceManager).Value;
//newItem["Return Date"] = TripInfo.SelectSingleNode("my:returnDate", NamespaceManager).Value;
//newItem["Return Time"] = TripInfo.SelectSingleNode("my:ReturnTime", NamespaceManager).Value;
newItem["Legal Entity"] = DealInfo.SelectSingleNode("my:ddbEntity", NamespaceManager).Value;
//string LegaLEntity = DealInfo.SelectSingleNode("my:ddbEntity", NamespaceManager).Value;
newItem["Category"] = DealInfo.SelectSingleNode("my:ddbCategory", NamespaceManager).Value;
//string Category = DealInfo.SelectSingleNode("my:ddbCategory", NamespaceManager).Value;
newItem["Sub-Category"] = DealInfo.SelectSingleNode("my:CategoriesSub", NamespaceManager).Value;
//string SubCategory = DealInfo.SelectSingleNode("my:CategoriesSub", NamespaceManager).Value;
newItem["Deals/BD"] = DealInfo.SelectSingleNode("my:BDDeals", NamespaceManager).Value;
//string Deals = DealInfo.SelectSingleNode("my:BDDeals", NamespaceManager).Value;
newItem["Cost Allocation"] = DealInfo.SelectSingleNode("my:CostAllocation", NamespaceManager).Value;
//string CostAllocation = DealInfo.SelectSingleNode("my:CostAllocation", NamespaceManager).Value;
newItem["Cost Per Deal"] = DealInfo.SelectSingleNode("my:CostperDeal", NamespaceManager).Value;
newItem.Update();
SourceList.Update();
}
}
}
this.Submit();
}
Here when an Admin is clicking the button i'm moving the information from "my Trips" repeating table to the List "Travel Info for Deals". if you dont want to get the duplicates keep a check there,In my case, Admin Clicking is the last step after which there are no scopes of further change and Form would b sealed and final,that is why there are no chances of getting the duplicates items.Hope it may help you.