예제 #1
0
 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();
 }
예제 #2
0
 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;
         }
     }
 }