public response GetSpecificStoryDropdownStatus(int ID) { var dataTable = new System.Data.DataTable(); dataTable = new System.Data.DataTable { TableName = "JakataMaster" }; string connString = URLInfo.GetDataBaseConnectionString(); System.IO.StringWriter writer = new System.IO.StringWriter(); string returnString = ""; response response = new response(); response.result = 0; using (System.Data.SqlClient.SqlConnection con = new System.Data.SqlClient.SqlConnection(connString)) { using (System.Data.SqlClient.SqlCommand cmd = new System.Data.SqlClient.SqlCommand("GetSpecificStoryDropdownStatus", con)) { cmd.CommandType = System.Data.CommandType.StoredProcedure; cmd.Parameters.Add("@StoryImported", System.Data.SqlDbType.NVarChar).Value = ID; con.Open(); var dataReader = cmd.ExecuteReader(); dataTable.Load(dataReader); dataTable.WriteXml(writer, System.Data.XmlWriteMode.WriteSchema, false); returnString = writer.ToString(); int numberOfRecords = dataTable.Rows.Count; response.result = numberOfRecords; //JakataMasterList list = new JakataMasterList(); //foreach (DataRow row in dataTable.Rows) //{ // jakataMaster myprod = new jakataMaster(); // myprod.ID = row["JakataID"].ToString(); // myprod.Title = row["Title"].ToString(); // list.jakataMasterLists.Add(myprod); //} ToDoList list = new ToDoList(); foreach (System.Data.DataRow row in dataTable.Rows) { toDo myprod = new toDo(); myprod.ID = row["JakataID"].ToString(); myprod.Title = row["Title"].ToString(); list.toDoLists.Add(myprod); } //response.AddJakataMasterList(list); response.AddToDoList(list); //response.AddToDoList(list); response.log.Add(numberOfRecords + " Records found"); } } return(response); }
public System.Collections.IList AddToDoList(ToDoList list) { data.Add(list); return(data); }