public void groups_ItemCreated(object sender, DataGridItemEventArgs e) { switch (e.Item.ItemType) { case ListItemType.Item: case ListItemType.AlternatingItem: case ListItemType.SelectedItem: DataGrid values = (DataGrid)e.Item.FindControl("values"); TransitPlacePropertyGroup group = (TransitPlacePropertyGroup)e.Item.DataItem; if (group != null) { IList <TransitPlacePropertyValue> propertyvalues = SessionManager.GetCollection <TransitPlacePropertyValue, int, int>( PlaceId, group.Id, null, SessionManager.PlaceService.GetPlacePropertyValues); for (int i = propertyvalues.Count - 1; i >= 0; i--) { if (string.IsNullOrEmpty(propertyvalues[i].Value)) { propertyvalues.RemoveAt(i); } } if (propertyvalues.Count == 0) { values.Visible = false; } values.DataSource = propertyvalues; HtmlControl title = (HtmlControl)e.Item.FindControl("title"); title.Visible = (propertyvalues.Count > 0); } break; } }
public void Page_Load(object sender, EventArgs e) { gridProperties.OnGetDataSource += new EventHandler(gridProperties_OnGetDataSource); if (!IsPostBack) { SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute(); sitemapdata.Add(new SiteMapDataAttributeNode("System Preferences", Request, "SystemPreferencesManage.aspx")); sitemapdata.Add(new SiteMapDataAttributeNode("Place Property Groups", Request, "SystemPlacePropertyGroupsManage.aspx")); DomainClass cs = SessionManager.GetDomainClass("PlacePropertyGroup"); inputName.MaxLength = cs["Name"].MaxLengthInChars; if (RequestId > 0) { TransitPlacePropertyGroup t = SessionManager.PlaceService.GetPlacePropertyGroupById( SessionManager.Ticket, RequestId); inputName.Text = t.Name; inputDescription.Text = t.Description; gridProperties_OnGetDataSource(this, null); gridProperties.DataBind(); linkNewProperty.NavigateUrl = string.Format("SystemPlacePropertyEdit.aspx?pid={0}", RequestId); sitemapdata.Add(new SiteMapDataAttributeNode(t.Name, Request.Url)); } else { panelProperties.Visible = false; sitemapdata.Add(new SiteMapDataAttributeNode("New Property Group", Request.Url)); } StackSiteMap(sitemapdata); } SetDefaultButton(manageAdd); }
public void save_Click(object sender, EventArgs e) { TransitPlacePropertyGroup t = new TransitPlacePropertyGroup(); t.Name = inputName.Text; t.Description = inputDescription.Text; t.Id = RequestId; SessionManager.CreateOrUpdate<TransitPlacePropertyGroup>( t, SessionManager.PlaceService.CreateOrUpdatePlacePropertyGroup); Redirect("SystemPlacePropertyGroupsManage.aspx"); }
public void save_Click(object sender, EventArgs e) { TransitPlacePropertyGroup t = new TransitPlacePropertyGroup(); t.Name = inputName.Text; t.Description = inputDescription.Text; t.Id = RequestId; SessionManager.CreateOrUpdate <TransitPlacePropertyGroup>( t, SessionManager.PlaceService.CreateOrUpdatePlacePropertyGroup); Redirect("SystemPlacePropertyGroupsManage.aspx"); }
public int CreateOrUpdatePlacePropertyGroup(string ticket, TransitPlacePropertyGroup pg) { return WebServiceImpl<TransitPlacePropertyGroup, ManagedPlacePropertyGroup, PlacePropertyGroup>.CreateOrUpdate( ticket, pg); }