Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Data;
- using Microsoft.SharePoint;
- using BPAListViews.Utilities;
- namespace BPAListViews.Utilities
- {
- class IllnessIncidentSummaryFromInfoPath
- {
- //private const String TARGET_LIST = "Illness Incidents";
- public DataTable Data()
- {
- SPList currentList = SPContext.Current.Web.Lists["Contract Modification Request and Justification Entry"];
- SPQuery queryList = new SPQuery();
- queryList.Query = @"
- <OrderBy>
- <FieldRef Name='Report_x0020_Id' = 'FALSE' /> //CmrAssignedId
- </OrderBy>";
- DataTable dt = new DataTable();
- dt.Locale = System.Globalization.CultureInfo.InvariantCulture;
- dt.Columns.Add(new DataColumn("CmrAssignedId", Type.GetType("System.String")));
- dt.Columns.Add(new DataColumn("RfpAssignedId", Type.GetType("System.String")));
- dt.Columns.Add(new DataColumn("MocAssignedId", Type.GetType("System.String")));
- dt.Columns.Add(new DataColumn("OpenClosed", Type.GetType("System.String")));
- SPListItemCollection returnedItems = currentList.GetItems(queryList);
- DataRow currentRow;
- CAISUtilities.FormatUtilities fmt = new CAISUtilities.FormatUtilities();
- foreach (SPListItem Item in returnedItems)
- {
- currentRow = dt.NewRow();
- currentRow["CmrAssignedId"] = fmt.FormatAsString(Item["Report Id"]);
- dt.Rows.Add(currentRow);
- }
- SPListItemCollection returnedItems = SPContext.Current.Web.Lists
- ["Request For Proposal and Contract Modification Proposal Entry"];
- DataRow currentRow;
- CAISUtilities.FormatUtilities fmt = new CAISUtilities.FormatUtilities();
- foreach (SPListItem Item in returnedItems)
- {
- currentRow = dt.NewRow();
- currentRow["RfpAssignedId"] = fmt.FormatAsString(Item["Report Id"]);
- currentRow["OpenClosed"] = fmt.FormatAsString(Item["Open Closed"]);
- dt.Rows.Add(currentRow);
- }
- SPListItemCollection returnedItems = SPContext.Current.Web.Lists["MOC"];
- DataRow currentRow;
- CAISUtilities.FormatUtilities fmt = new CAISUtilities.FormatUtilities();
- foreach (SPListItem Item in returnedItems)
- {
- currentRow = dt.NewRow();
- currentRow["CmrAssignedId"] = fmt.FormatAsString(Item["Report Id"]);
- dt.Rows.Add(currentRow);
- }
- return dt;
- }
- }
- }
Add Comment
Please, Sign In to add comment