public bool GetEntry(string RecordID)
{
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["DbConnection"].ConnectionString);
connection.Open();
SqlCommand command = new SqlCommand("u_GetRecordByID_s", connection);
command.CommandType = CommandType.StoredProcedure;
command.Parameters.Add(new SqlParameter("@ID", RecordID));
DataSet entry = new DataSet();
SqlDataAdapter adapter = new SqlDataAdapter(command);
adapter.Fill(entry);
if (entry.Tables[0].Rows[0]["ClientName"].ToString() != "")
{
_recordView.ClientName = entry.Tables[0].Rows[0]["ClientName"].ToString();
}
if (entry.Tables[0].Rows[0]["ClientNumber"].ToString() != "")
{
_recordView.ClientNumber = entry.Tables[0].Rows[0]["ClientNumber"].ToString();
}
if (entry.Tables[0].Rows[0]["ClientLeader"].ToString() != "")
{
_recordView.ClientLeader = entry.Tables[0].Rows[0]["ClientLeader"].ToString();
}
if (entry.Tables[0].Rows[0]["ReviewDate"].ToString() != "")
{
_recordView.reviewDate = (DateTime?)entry.Tables[0].Rows[0]["ReviewDate"];
}
if (entry.Tables[0].Rows[0]["CompletionDate"].ToString() != "")
{
_recordView.completionDate = (DateTime?)entry.Tables[0].Rows[0]["CompletionDate"];
}
if (entry.Tables[0].Rows[0]["Comments"].ToString() != "")
{
_recordView.comments = entry.Tables[0].Rows[0]["Comments"].ToString();
}
if (entry.Tables[0].Rows[0]["FileLocation"].ToString() != "")
{
_recordView.fileName = entry.Tables[0].Rows[0]["FileLocation"].ToString();
}
if (entry.Tables[0].Rows[0]["FileLocation2"].ToString() != "")
{
_recordView.fileName2 = entry.Tables[0].Rows[0]["FileLocation2"].ToString();
}
if (entry.Tables[0].Rows[0]["SecureStorage"].ToString() != "")
{
_recordView.SecureStorage = (bool)entry.Tables[0].Rows[0]["SecureStorage"];
}
if (entry.Tables[0].Rows[0]["BoxDetails"].ToString() != "")
{
_recordView.boxDetails = ConvertStringToKVP(entry.Tables[0].Rows[0]["BoxDetails"].ToString());
}
return true;
}