private Boolean SaveData(String approveFlag)
        {
            if (!CHelper.VerifyAccessRight("GENERAL_VARIABLE_EDIT"))
            {
                return(false);
            }

            //Edit mode, always

            if (vw.IsModified)
            {
                Boolean result = SaveToView();
                if (result)
                {
                    CUtil.EnableForm(false, this);
                    CTable t = OnixWebServiceAPI.UpdateGlobalVariable(vw.GetDbObject());
                    CUtil.EnableForm(true, this);
                    if (t != null)
                    {
                        CGlobalVariable.InitGlobalVariables();

                        return(true);
                    }
                    CHelper.ShowErorMessage(OnixWebServiceAPI.GetLastErrorDescription(), "ERROR_USER_EDIT", null);
                }
                return(false);
            }

            return(true);
        }
Exemple #2
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();
            }
        }