public GetViewLaneFileHistoryDataResponse GetViewLaneFileHistoryData (WebServiceLogin login, int lanefile_id)
		{
			GetViewLaneFileHistoryDataResponse response = new GetViewLaneFileHistoryDataResponse ();

			using (DB db = new DB ()) {
				VerifyUserInRole (db, login, Roles.Administrator);

				response.Lanefiles = new List<DBLanefile> ();

				using (IDbCommand cmd = db.CreateCommand ()) {
					cmd.CommandText = "SELECT * FROM LaneFile WHERE original_id = @lanefile_id;";
					DB.CreateParameter (cmd, "lanefile_id", lanefile_id);
					using (IDataReader reader = cmd.ExecuteReader ()) {
						while (reader.Read ()) {
							response.Lanefiles.Add (new DBLanefile (reader));
						}
					}
				}
			}

			return response;
		}
Beispiel #2
0
		public GetViewLaneFileHistoryDataResponse GetViewLaneFileHistoryData (WebServiceLogin login, int lanefile_id)
		{
			GetViewLaneFileHistoryDataResponse response = new GetViewLaneFileHistoryDataResponse ();

			using (DB db = new DB ()) {
				// Get the original file, so we can see who can access the history.
				var originalFile = DBLanefile_Extensions.Create (db, lanefile_id);

				VerifyUserInRoles (db, login, originalFile.additional_roles, false);

				response.Lanefiles = new List<DBLanefile> ();

				using (IDbCommand cmd = db.CreateCommand ()) {
					cmd.CommandText = "SELECT * FROM LaneFile WHERE original_id = @lanefile_id;";
					DB.CreateParameter (cmd, "lanefile_id", lanefile_id);
					using (IDataReader reader = cmd.ExecuteReader ()) {
						while (reader.Read ()) {
							response.Lanefiles.Add (new DBLanefile (reader));
						}
					}
				}
			}

			return response;
		}