private void FillDropDownCompany() { //make new table Permission cboCompanyName.Items.Clear(); if (HttpContext.Current.User.Identity.IsAuthenticated) { var listCompany = UserPermission.GetListCompanyFromUser(HttpContext.Current.User.Identity.Name); foreach (Company i in listCompany) { cboCompanyName.Items.Add(new ListItem(i.CompanyName, i.CompanyId.ToString())); } } cboCompanyName.SelectedValue = GetCompany(); }
private void FillDropDownCompany() { //make new table Permission cboCompanyName.Items.Clear(); if (HttpContext.Current.User.Identity.IsAuthenticated) { var listCompany = UserPermission.GetListCompanyFromUser(HttpContext.Current.User.Identity.Name); foreach (Company i in listCompany) { cboCompanyName.Items.Add(new ListItem(i.CompanyName, i.CompanyId.ToString())); } if (cboCompanyName.Items.Count == 0) { panelMenuWorkZone.Visible = panelMenuMaster.Visible = panelMenuUser.Visible = false; } HttpCookie cookie = Request.Cookies["CurrentCompany"]; if (cookie != null) { cboCompanyName.SelectedValue = cookie.Value; } } }