Esempio n. 1
0
        void lgn_SignIn(object sender, AuthenticationComponent.UI.SignInArgs e)
        {
            if (e.IsSuccess)
            {
                tsbSign.Text = "Sign Out";
                tsbSign.Tag  = "SignOut";
                SetScreenMode(ScreenMode.LoggedIn);
                ms.SetScreenState(Common.ScreenMode.LoggedIn);

                (sender as POSClient.UI.Login).SignIn -= new AuthenticationComponent.UI.SignInHandler(lgn_SignIn);
                sender = null;
            }
        }
 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);
     }
 }