Exemplo n.º 1
0
    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");
            TransitAccountPropertyGroup group = (TransitAccountPropertyGroup)e.Item.DataItem;
            if (group != null)
            {
                IList <TransitAccountPropertyValue> propertyvalues = SessionManager.GetCollection <TransitAccountPropertyValue, int, int>(
                    AccountId, group.Id, (ServiceQueryOptions)null, SessionManager.AccountService.GetAccountPropertyValues);

                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;
        }
    }
Exemplo n.º 2
0
    public void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            SiteMapDataAttribute sitemapdata = new SiteMapDataAttribute();
            sitemapdata.Add(new SiteMapDataAttributeNode("Me Me", Request, "AccountManage.aspx"));

            if (RequestId > 0)
            {
                TransitAccountPropertyGroup tag = SessionManager.AccountService.GetAccountPropertyGroupById(
                    SessionManager.Ticket, RequestId);
                labelName.Text        = Render(tag.Name);
                labelDescription.Text = Render(tag.Description);
                sitemapdata.Add(new SiteMapDataAttributeNode(tag.Name, Request.Url));
            }
            else
            {
                labelName.Text = "All Property Groups";
                sitemapdata.Add(new SiteMapDataAttributeNode("Properties", Request.Url));
            }

            StackSiteMap(sitemapdata);

            gridManage.DataSource = SessionManager.AccountService.GetAllAccountPropertyValues(
                SessionManager.Ticket, SessionManager.AccountId, RequestId);
            gridManage.DataBind();
        }

        SetDefaultButton(save);
    }
    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("Account Property Groups", Request, "SystemAccountPropertyGroupsManage.aspx"));

            if (RequestId > 0)
            {
                TransitAccountPropertyGroup t = SessionManager.AccountService.GetAccountPropertyGroupById(
                    SessionManager.Ticket, RequestId);
                inputName.Text        = t.Name;
                inputDescription.Text = t.Description;
                gridProperties_OnGetDataSource(this, null);
                gridProperties.DataBind();
                linkNewProperty.NavigateUrl = string.Format("SystemAccountPropertyEdit.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)
 {
     TransitAccountPropertyGroup t = new TransitAccountPropertyGroup();
     t.Name = inputName.Text;
     t.Description = inputDescription.Text;
     t.Id = RequestId;
     SessionManager.CreateOrUpdate<TransitAccountPropertyGroup>(
         t, SessionManager.AccountService.CreateOrUpdateAccountPropertyGroup);
     Redirect("SystemAccountPropertyGroupsManage.aspx");
 }
    public void save_Click(object sender, EventArgs e)
    {
        TransitAccountPropertyGroup t = new TransitAccountPropertyGroup();

        t.Name        = inputName.Text;
        t.Description = inputDescription.Text;
        t.Id          = RequestId;
        SessionManager.CreateOrUpdate <TransitAccountPropertyGroup>(
            t, SessionManager.AccountService.CreateOrUpdateAccountPropertyGroup);
        Redirect("SystemAccountPropertyGroupsManage.aspx");
    }
Exemplo n.º 6
0
 public int CreateOrUpdateAccountPropertyGroup(string ticket, TransitAccountPropertyGroup pg)
 {
     return WebServiceImpl<TransitAccountPropertyGroup, ManagedAccountPropertyGroup, AccountPropertyGroup>.CreateOrUpdate(
         ticket, pg);
 }