It would definitely help if you just read the API documentation, but here is some sample code that should give you an idea:

<!-- language: lang-cs -->

    [TcmExtension("ExampleEventHandlerExtension")]
    public class EventHandler : TcmExtension
    {
      public EventHandler()
      {
        EventSystem.Subscribe<Component, SaveEventArgs>(ComponentSaveAction, EventPhases.Processed);
      }

      public static void ComponentSaveAction(Component subject, SaveEventArgs args, EventPhases phases)
      {
        // the ID of the Publication from this item
        string contextRepository = subject.ContextRepository.Id.ToString();
		
        // the ID of the Publication where this item was localized (possibly created)
        string owningRepository = subject.OwningRepository.Id.ToString();
      }
    }

If you are looking for the BluePrint Parent (the location where the Component was originally created), you need to use the method `Component.GetBluePrintChain()`, see also my answer
http://tridion.stackexchange.com/questions/4520/how-to-get-the-owning-publication-of-a-component-via-the-core-service (in the Core Service that is directly available).