コード例 #1
0
        private void LoadForm()
        {
            ResetForm();

            STD_REGISTRY systemRegistry = ApplicationSession.SystemRegistry;

            AppSettings appSettings = ServiceInterfaceManager.APPSETTINGS_GET(HttpContext.Current.User.Identity.Name, systemRegistry.ID);

            if (appSettings != null)
            {
                txtSqlCommandTimeout.Text            = appSettings.SqlCommandTimeout.ToString();
                txtLogFileSize.Text                  = appSettings.LogFileSize.ToString();
                txtLogFileArchive.Text               = appSettings.LogFileArchive.ToString();
                listLogErrors.SelectedValue          = appSettings.LogErrors.ToString().ToLower();
                listLogInformation.SelectedValue     = appSettings.LogInformation.ToString().ToLower();
                listLogTiming.SelectedValue          = appSettings.LogTiming.ToString().ToLower();
                listDatabaseLogEnabled.SelectedValue = appSettings.DatabaseLogEnabled.ToString().ToLower();
                //listEventLogEnabled.SelectedValue = appSettings.EventLogEnabled.ToString().ToLower();
                listFileLogEnabled.SelectedValue = appSettings.FileLogEnabled.ToString().ToLower();
                txtFileLogPath.Text                 = appSettings.FileLogPath.ToString();
                listMviEnabled.SelectedValue        = appSettings.MviEnabled.ToString().ToLower();
                listMviProcessingCode.SelectedValue = appSettings.MviProcessingCode.ToString().ToUpper();
                txtMviCertName.Text                 = appSettings.MviCertName.ToString();
                txtMviServiceUrl.Text               = appSettings.MviServiceUrl.ToString();
                txtReportBuilderPath.Text           = appSettings.ReportBuilderPath.ToString();
                txtReportServerUrl.Text             = appSettings.ReportServerUrl.ToString();
                txtReportServicePath.Text           = appSettings.ReportServicePath.ToString();
                txtEtlSchedule.Text                 = appSettings.EtlSchedule;
                txtEtlRetryAttempts.Text            = appSettings.EtlRetryAttempts.ToString();
                txtEtlTimeBetweenAttempts.Text      = appSettings.EtlTimeBetweenAttempts.ToString();
                txtHomePageText.Text                = appSettings.HomePageText;
            }
        }
コード例 #2
0
        protected override void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                ServiceInterfaceManager.LogInformation("PAGE_LOAD", String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);
            }

            try
            {
                base.Page_Load(sender, e);

                STD_REGISTRY systemRegistry = ApplicationSession.SystemRegistry;
                AppSettings  appSetting     = ServiceInterfaceManager.APPSETTINGS_GET(HttpContext.Current.User.Identity.Name, systemRegistry.ID);
                if (appSetting != null)
                {
                    string query = "";
                    query = Request.QueryString["query"] as string;

                    switch (query)
                    {
                    case "1":     //File Log View
                        if (!string.IsNullOrEmpty(appSetting.FileLogPath.ToString()))
                        {
                            string logText = File.ReadAllText(appSetting.FileLogPath.ToString());

                            //string whitelist = "^[a-zA-Z0-9-,. ]+$";
                            //Regex pattern = new Regex(whitelist);

                            //if (!pattern.IsMatch(logText))
                            //    throw new Exception("Invalid Search Criteria");

                            txtOutput.Text = logText;
                        }
                        else
                        {
                            lblResult.Text    = "There is no File Log Path saved in Settings. A file could not be generated to view.<br /><br />";
                            txtOutput.Visible = false;
                        }
                        break;

                    default:
                    {
                        lblResult.Text    = "You have not selected a file to view. Please return to settings and pick a file.<br /><br />";
                        txtOutput.Visible = false;
                        break;
                    }
                    }
                }
            }
            catch (Exception ex)
            {
                ServiceInterfaceManager.LogError(ex.Message, String.Format("{0}.{1}", System.Reflection.MethodBase.GetCurrentMethod().DeclaringType.FullName, System.Reflection.MethodBase.GetCurrentMethod().Name), HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);
                throw ex;
            }
        }
コード例 #3
0
        private void LoadForm()
        {
            bool        mviEnabled = false;
            AppSettings settings   = ServiceInterfaceManager.APPSETTINGS_GET(HttpContext.Current.User.Identity.Name, UserSession.CurrentRegistryId);

            if (settings != null)
            {
                mviEnabled = settings.MviEnabled;
            }

            btnMvi.Visible = mviEnabled;

            viewPatient.LoadForm(UserSession.CurrentPatientId);
        }
コード例 #4
0
        private bool SaveForm()
        {
            bool objReturn = false;

            STD_REGISTRY systemRegistry = ApplicationSession.SystemRegistry;

            AppSettings oldAppSettings = ServiceInterfaceManager.APPSETTINGS_GET(HttpContext.Current.User.Identity.Name, systemRegistry.ID);

            AppSettings newAppSettings = new AppSettings();

            int iValue = 0;

            int.TryParse(txtSqlCommandTimeout.Text, out iValue);
            newAppSettings.SqlCommandTimeout = iValue;

            iValue = 0;
            int.TryParse(txtLogFileSize.Text, out iValue);
            newAppSettings.LogFileSize = iValue;

            iValue = 0;
            int.TryParse(txtLogFileArchive.Text, out iValue);
            newAppSettings.LogFileArchive = iValue;

            bool bValue = false;

            bool.TryParse(listLogErrors.SelectedValue, out bValue);
            newAppSettings.LogErrors = bValue;

            bValue = false;
            bool.TryParse(listLogInformation.SelectedValue, out bValue);
            newAppSettings.LogInformation = bValue;

            bValue = false;
            bool.TryParse(listLogTiming.SelectedValue, out bValue);
            newAppSettings.LogTiming = bValue;

            bValue = false;
            bool.TryParse(listDatabaseLogEnabled.SelectedValue, out bValue);
            newAppSettings.DatabaseLogEnabled = bValue;

            bValue = false;
            //bool.TryParse(listEventLogEnabled.SelectedValue, out bValue);
            newAppSettings.EventLogEnabled = bValue;

            bValue = false;
            bool.TryParse(listFileLogEnabled.SelectedValue, out bValue);
            newAppSettings.FileLogEnabled = bValue;

            if (ValidFileLogPath())
            {
                newAppSettings.FileLogPath = txtFileLogPath.Text;
            }
            else
            {
                return(false);
            }

            bValue = false;
            bool.TryParse(listMviEnabled.SelectedValue, out bValue);
            newAppSettings.MviEnabled = bValue;

            newAppSettings.MviProcessingCode = listMviProcessingCode.SelectedValue;
            newAppSettings.MviCertName       = this.txtMviCertName.Text;
            newAppSettings.MviServiceUrl     = this.txtMviServiceUrl.Text;

            newAppSettings.ReportBuilderPath = txtReportBuilderPath.Text;
            newAppSettings.ReportServerUrl   = txtReportServerUrl.Text;
            newAppSettings.ReportServicePath = txtReportServicePath.Text;

            newAppSettings.EtlSchedule = txtEtlSchedule.Text;

            iValue = 0;
            int.TryParse(txtEtlRetryAttempts.Text, out iValue);
            newAppSettings.EtlRetryAttempts = iValue;

            iValue = 0;
            int.TryParse(txtEtlTimeBetweenAttempts.Text, out iValue);
            newAppSettings.EtlTimeBetweenAttempts = iValue;

            newAppSettings.HomePageText = txtHomePageText.Text;

            objReturn = ServiceInterfaceManager.APPSETTINGS_SAVE(HttpContext.Current.User.Identity.Name, systemRegistry.ID, newAppSettings);

            if (objReturn)
            {
                DB_LOG newLog = new DB_LOG();
                newLog.STD_REGISTRY_ID = systemRegistry.ID;
                newLog.IS_ERROR        = false;
                newLog.PROCESS_NAME    = "CRSe_WEB.Settings.SaveForm";
                newLog.MESSAGE         = "CRSe app settings values have been updated (Old Values: " + WriteToXmlString(oldAppSettings) + ") to (New Values: " + WriteToXmlString(newAppSettings) + ")";
                newLog.CREATED         = DateTime.Now;
                newLog.CREATEDBY       = HttpContext.Current.User.Identity.Name;

                ServiceInterfaceManager.DB_LOG_SAVE(HttpContext.Current.User.Identity.Name, systemRegistry.ID, newLog);
            }
            return(objReturn);
        }