예제 #1
0
    private void BindOrganizations()
    {
        //Get the list of organizations
        List <Organization> theOrganizations = new List <Organization>();

        try
        {
            theOrganizations = OrganizationBLL.GetOrganizationsByUser(OrgSearchControl.Sql);
        }
        catch (Exception exc)
        {
            SystemMessages.DisplaySystemErrorMessage(exc.Message);
            return;
        }

        OrganizationsRepeater.DataSource = theOrganizations;
        OrganizationsRepeater.DataBind();

        try
        {
            int userId = UserBLL.GetUserIdByUsername(User.Identity.Name);
            Tour.UserId = userId;
        }
        catch (Exception ex)
        {
            log.Error("Error getting userId from session", ex);
        }

        if (theOrganizations.Count == 0)
        {
            Tour.Hide();
        }
        if (theOrganizations.Count > 0)
        {
            Tour.Show();
        }
    }
 protected void Page_Load(object sender, EventArgs e)
 {
     OrganizationsRepeater.DataSource = db.OrganizationsTypes.ToList();
     OrganizationsRepeater.DataBind();
 }