예제 #1
0
        private void WinMain_OnLoad(object sender, RoutedEventArgs e)
        {
            CConfig.ConfigRead();

            initStatusBar();

            WinLogin wLogin = new WinLogin();

            wLogin.ShowDialog();
            Boolean isOK = wLogin.LoginOK;

            if (isOK)
            {
                stbiUserValue.Content = OnixWebServiceAPI.GetLastUserLogin();
                isLogin = true;

                configureMenu();

                //Load user variables
                if (!OnixWebServiceAPI.UserID().Equals(""))
                {
                    currentUser = new CTable("USER");
                    currentUser.SetFieldValue("USER_ID", OnixWebServiceAPI.UserID());
                    currentUser = OnixWebServiceAPI.GetUserInfo(currentUser);
                    CConfig.LoadLastValueSaved(currentUser);
                }

                CReportFactory.InitReports();
                CMasterReference.LoadCompanyProfile();
                CGlobalVariable.InitGlobalVariables();
                CMasterReference.LoadAllMasterRefItems(OnixWebServiceAPI.GetAllMasterRefList);
                CUtil.ExportLoadingImage();
            }
        }
예제 #2
0
        private void mnuMenu_Click(object sender, RoutedEventArgs e)
        {
            MenuItem mnu = (MenuItem)sender;

            if (mnu.Name.Equals("mnuExit"))
            {
                this.Close();
            }
            else if (mnu.Name.Equals("mnuPasswd"))
            {
                WinEditUser w = new WinEditUser();
                w.Caption = CLanguage.getValue("ADMIN_PASSWD");
                w.ShowDialog();
            }
            else if (mnu.Name.Equals("mnuServer"))
            {
                WinServerSetting w = new WinServerSetting();
                w.ShowDialog();
            }
            else if (mnu.Name.Equals("mnuCompanyProfile"))
            {
                if (CHelper.VerifyAccessRight("GENERAL_COMPANY_EDIT"))
                {
                    WinAddEditCompanyProf cp = new WinAddEditCompanyProf();
                    cp.Title = (String)mnu.Header;
                    cp.ShowDialog();

                    if (cp.DialogOK)
                    {
                        CMasterReference.LoadCompanyProfile();
                    }
                }
            }
            else if (mnu.Name.Equals("mnuFormatDoc"))
            {
                if (CHelper.VerifyAccessRight("GENERAL_FMTDOC_EDIT"))
                {
                    WinDocumentConfig fd = new WinDocumentConfig((String)mnu.Header);
                    fd.ShowDialog();
                }
            }
            else if (mnu.Name.Equals("mnuGlobalVariable"))
            {
                if (CHelper.VerifyAccessRight("GENERAL_GLOBAL_VARIABLE_EDIT"))
                {
                    WinGlobalVariable ga = new WinGlobalVariable((String)mnu.Header);
                    ga.ShowDialog();
                }
            }
        }