public void AddDependencyToLane (WebServiceLogin login, int lane_id, int dependent_lane_id, int? host_id, DBLaneDependencyCondition condition)
		{
			if (!Enum.IsDefined (typeof (DBLaneDependencyCondition), condition))
				throw new ArgumentOutOfRangeException ("condition");

			using (DB db = new DB ()) {
				VerifyUserInRole (db, login, Roles.Administrator);
				DBLaneDependency dep = new DBLaneDependency ();
				dep.Condition = condition;
				dep.dependent_lane_id = dependent_lane_id;
				dep.lane_id = lane_id;
				dep.dependent_host_id = host_id;
				dep.Save (db);
			}
		}
Example #2
0
		public void AddDependencyToLane (WebServiceLogin login, int lane_id, int dependent_lane_id, int? host_id, DBLaneDependencyCondition condition)
		{
			if (!Enum.IsDefined (typeof (DBLaneDependencyCondition), condition))
				throw new ArgumentOutOfRangeException ("condition");

			using (DB db = new DB ()) {
				var lane = DBLane_Extensions.Create (db, lane_id);
				VerifyUserInRoles (db, login, lane.additional_roles, false);
				DBLaneDependency dep = new DBLaneDependency ();
				dep.Condition = condition;
				dep.dependent_lane_id = dependent_lane_id;
				dep.lane_id = lane.id;
				dep.dependent_host_id = host_id;
				dep.Save (db);
			}
		}