Beispiel #1
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();
                }
            }
        }
Beispiel #2
0
        private void Window_ContentRendered(object sender, EventArgs e)
        {
            CTextLabel.SetLanguage(CConfig.GetLanguage());
            String lng = CTextLabel.GetLanguage();

            //CConfig.SetLanguage(lng);

            if (lng.Equals("TH"))
            {
                radThai.IsChecked = true;
            }
            else
            {
                radEng.IsChecked = true;
            }

            OnixWebServiceAPI.Init(CConfig.GetKey(), CConfig.GetUrl());

            CUtil.EnableForm(false, this);
            if (OnixWebServiceAPI.Patch(new CTable("DUMMY")) == null)
            {
                CUtil.EnableForm(true, this);
                CMessageBox.Show(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR", MessageBoxButton.OK);

                WinServerSetting w = new WinServerSetting();
                w.ShowDialog();
            }

            CUtil.EnableForm(true, this);

            if (CHelper.VerifyVersion())
            {
                //Comment this line below in order to test auto update from IDE
                return;
            }

            String api = CConfig.APIVersion;

            if (!api.Equals(""))
            {
                CUtil.AutoUpdateProgram("OnixClientCenter.exe", "OnixCenter.zip");
            }

            isLogin = false;
            this.Close();
        }
Beispiel #3
0
        private void cmdSetting_Click(object sender, RoutedEventArgs e)
        {
            WinServerSetting w = new WinServerSetting();

            w.ShowDialog();
        }