public void save_Click(object sender, EventArgs e)
 {
     TransitNeighborhood tc = new TransitNeighborhood();
     tc.Name = inputName.Text;
     tc.Id = RequestId;
     tc.Country = inputCountry.SelectedValue;
     tc.State = inputState.SelectedValue;
     tc.City = inputCity.SelectedValue;
     if (string.IsNullOrEmpty(tc.City))
     {
         throw new Exception("City is required.");
     }
     SessionManager.CreateOrUpdate<TransitNeighborhood>(
         tc, SessionManager.LocationService.CreateOrUpdateNeighborhood);
     Redirect("SystemNeighborhoodsManage.aspx");
 }
    public void save_Click(object sender, EventArgs e)
    {
        TransitNeighborhood tc = new TransitNeighborhood();

        tc.Name    = inputName.Text;
        tc.Id      = RequestId;
        tc.Country = inputCountry.SelectedValue;
        tc.State   = inputState.SelectedValue;
        tc.City    = inputCity.SelectedValue;
        if (string.IsNullOrEmpty(tc.City))
        {
            throw new Exception("City is required.");
        }
        SessionManager.CreateOrUpdate <TransitNeighborhood>(
            tc, SessionManager.LocationService.CreateOrUpdateNeighborhood);
        Redirect("SystemNeighborhoodsManage.aspx");
    }
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx"));
            sitemapdata.Add(new SiteMapDataAttributeNode("Neighborhoods", Request, "SystemNeighborhoodsManage.aspx"));

            DomainClass cs = SessionManager.GetDomainClass("Neighborhood");
            inputName.MaxLength = cs["Name"].MaxLengthInChars;

            string defaultcountry = SessionManager.GetCachedConfiguration("SnCore.Country.Default", "United States");
            inputCountry.DataSource = SessionManager.GetCollection <TransitCountry, string>(
                defaultcountry, (ServiceQueryOptions)null, SessionManager.LocationService.GetCountriesWithDefault);
            inputCountry.DataBind();

            if (RequestId > 0)
            {
                TransitNeighborhood tc = SessionManager.LocationService.GetNeighborhoodById(
                    SessionManager.Ticket, RequestId);
                inputName.Text = tc.Name;
                ListItemManager.TrySelect(inputCountry, tc.Country);
                inputCountry_SelectedIndexChanged(sender, e);
                ListItemManager.TrySelect(inputState, tc.State);
                inputState_SelectedIndexChanged(sender, e);
                ListItemManager.TrySelect(inputCity, tc.City);
                sitemapdata.Add(new SiteMapDataAttributeNode(tc.Name, Request.Url));
            }
            else
            {
                inputCountry_SelectedIndexChanged(sender, e);
                panelMerge.Visible = false;
                sitemapdata.Add(new SiteMapDataAttributeNode("New Neighborhood", Request.Url));
            }

            StackSiteMap(sitemapdata);
        }

        SetDefaultButton(manageAdd);
        PageManager.SetDefaultButton(mergeLookup, panelMerge.Controls);
    }
Beispiel #4
0
 public int CreateOrUpdateNeighborhood(string ticket, TransitNeighborhood neighborhood)
 {
     return(WebServiceImpl <TransitNeighborhood, ManagedNeighborhood, Neighborhood> .CreateOrUpdate(
                ticket, neighborhood));
 }
Beispiel #5
0
 public LocationEventArgs(TransitNeighborhood neighborhood)
     : this(neighborhood.Country, neighborhood.State, neighborhood.City, neighborhood.Name)
 {
 }
Beispiel #6
0
    public LocationEventArgs(TransitNeighborhood neighborhood)
        : this(neighborhood.Country, neighborhood.State, neighborhood.City, neighborhood.Name)
    {

    }
Beispiel #7
0
 public int CreateOrUpdateNeighborhood(string ticket, TransitNeighborhood neighborhood)
 {
     return WebServiceImpl<TransitNeighborhood, ManagedNeighborhood, Neighborhood>.CreateOrUpdate(
         ticket, neighborhood);
 }