using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Controls_WeatherPart : System.Web.UI.UserControl
{
   private IZipCode zipProvider = null;

   [ConnectionConsumer("Odbiorca kodu pocztowego", "ZipCodeConsumer")]
   public void GetIZipCode(IZipCode Provider)
   {
      zipProvider = Provider;
   }

   protected override void OnPreRender(EventArgs e)
   {
      base.OnPreRender(e);
      // wykorzystaj strategię skróconego obliczania wartości wyrażeń logicznych
      if ((zipProvider != null) && (zipProvider.ZipCode != string.Empty))
         lblZip.Text = zipProvider.ZipCode;
      else
         lblZip.Text = "(Brak danych)";
   }

   protected void Page_Load(object sender, EventArgs e)
   {

   }
}
