Ejemplo n.º 1
0
 void m_bosControlObject_SignIn(object sender, AuthenticationComponent.UI.SignInArgs e)
 {
     try
     {
         if (e.IsSuccess)
         {
             List <Module> mList = Authenticate.AccessibleModules(AuthenticationComponent.BusinessObjects.Authenticate.LoggedInUser, Common.LocationCode);
             mnuNewMenu.Enabled = true;
             foreach (Module m in mList)
             {
                 if (mnuNewMenu.Items.Find(m.Code, true).Count() > 0)
                 {
                     ToolStripItem t = mnuNewMenu.Items.Find(m.Code, true)[0];
                     if (t.Name == Common.LoginModuleCode)
                     {
                         t.Visible = false;
                     }
                     else
                     {
                         ToolStripItem parent = t.OwnerItem;
                         while (parent != null)
                         {
                             if (parent.Name == string.Empty)
                             {
                                 parent.Enabled = true;
                                 parent         = parent.OwnerItem;
                             }
                             else
                             {
                                 parent = null;
                             }
                         }
                         //if (t.OwnerItem.Name == string.Empty)
                         //{
                         //    t.OwnerItem.Enabled = true;
                         //}
                         t.Enabled = true;
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(Common.GetMessage("10002"), Common.GetMessage("30007"), MessageBoxButtons.OK, MessageBoxIcon.Error);
         Common.LogException(ex);
     }
 }