protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { List <Organization> theOrganizations = new List <Organization>(); try { theOrganizations = OrganizationBLL.GetOrganizationsByUser("1 = 1"); } catch (Exception exc) { SystemMessages.DisplaySystemErrorMessage(exc.Message); return; } if (theOrganizations.Count > 0) { OrganizationsExists.Value = "true"; } else { addIcon.Attributes["class"] = "zmdi zmdi-plus-circle-o zmdi-hc-fw animated pulse"; } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { OrganizationTextBox.Attributes.Add("onchange", "OrganizationTextBox_OnChange()"); AreaTextBox.Attributes.Add("onchange", "AreaTextBox_OnChange()"); ProjectTextBox.Attributes.Add("onchange", "ProjectTextBox_OnChange()"); LoadKPI(); LoadPerson(); LoadActivity(); LoadProject(); LoadArea(); LoadOrganization(); if (OrganizationId == 0) { List <Organization> theOrgList = new List <Organization>(); try { theOrgList = OrganizationBLL.GetOrganizationsByUser("1 = 1"); } catch { } if (theOrgList.Count == 1) { OrganizationTextBox.Text = theOrgList[0].Name; OrganizationId = theOrgList[0].OrganizationID; } } } }
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(); } }