protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var data = new IgniteTourRepository(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString); ddlRegion.DataSource = data.GetRegions(); ddlRegion.DataBind(); } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { var data = new IgniteTourRepository(ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString); ddlRegion.DataSource = data.GetRegions(); ddlRegion.DataBind(); var city = data.GetCity(CityId); if (city != null) { txtName.Text = city.Name; txtDateDisplayed.Text = city.DateDisplayed; txtImage.Text = city.ImageUrl; txtName.Text = city.Name; dtDate.Date = city.StartDate; ddlRegion.SelectedValue = city.TourRegionId.ToString(); cbVisible.Checked = city.Visible; txtUserLastEdit.Text = city.LastUpdateUserName; txtDateLastEdit.Text = city.LastUpdateDate.ToString(); } } }