public static bool UpdateScanAudit(RSReportsDataset.ScanAuditTableRow audit) { // bool updated = false; RSReportsServiceClient client = new RSReportsServiceClient(); try { ScanAudit sa = new ScanAudit(); sa.RecordID = audit.RecordID; sa.Arrive = !audit.IsArriveNull() ? audit.Arrive : ""; sa.Bell = !audit.IsBellNull() ? audit.Bell : ""; sa.DeliveryStart = !audit.IsDelStartNull() ? audit.DelStart : ""; sa.DeliveryEnd = !audit.IsDelEndNull() ? audit.DelEnd : ""; sa.Departure = !audit.IsDepartNull() ? audit.Depart : ""; sa.TimeEntryBy = !audit.IsTimeEntryByNull() ? audit.TimeEntryBy : ""; sa.OnTimeIssue = !audit.IsOnTimeIssueNull() ? audit.OnTimeIssue : ""; sa.AdditionalComments = !audit.IsAdditCommentsNull() ? audit.AdditComments : ""; updated = client.UpdateScanAudit(sa); client.Close(); } catch (TimeoutException te) { client.Abort(); throw new ApplicationException(te.Message); } catch (FaultException <RoadshowFault> rfe) { client.Abort(); throw new ApplicationException(rfe.Detail.Message); } catch (FaultException fe) { client.Abort(); throw new ApplicationException(fe.Message); } catch (CommunicationException ce) { client.Abort(); throw new ApplicationException(ce.Message); } return(updated); }
public static bool UpdateScanAudits(RSReportsDataset scans) { // bool ret = false; if (scans.HasChanges()) { RSReportsDataset _scans = (RSReportsDataset)scans.GetChanges(DataRowState.Modified); for (int i = 0; i < _scans.ScanAuditTable.Rows.Count; i++) { RSReportsDataset.ScanAuditTableRow scan = _scans.ScanAuditTable[i]; bool changed = UpdateScanAudit(scan); } scans.AcceptChanges(); } ret = true; return(ret); }