コード例 #1
0
        private void SetUpForm_Load(object sender, EventArgs e)
        {
            dcConfig.DataType = typeof(AppConfigEntity);
            cmd = new Xr.Common.Controls.OpaqueCommand(this);
            cmd.ShowOpaqueLayer(0f);
            //查询医院下拉框数据
            String url = AppContext.AppConfig.serverUrl + "itf/intro/hospital/findAll";

            this.DoWorkAsync(500, (o) =>
            {
                String data = HttpClass.httpPost(url);
                return(data);
            }, null, (data) =>
            {
                JObject objT = JObject.Parse(data.ToString());
                if (string.Compare(objT["state"].ToString(), "true", true) == 0)
                {
                    lueHospital.Properties.DataSource    = objT["result"].ToObject <List <HospitalInfoEntity> >();
                    lueHospital.Properties.DisplayMember = "name";
                    lueHospital.Properties.ValueMember   = "code";
                    config = AppContext.AppConfig;
                    dcConfig.SetValue(config);
                    cmd.HideOpaqueLayer();
                }
                else
                {
                    MessageBoxUtils.Show(objT["message"].ToString(), MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, this);
                    return;
                }
            });
        }
コード例 #2
0
        /// <summary>
        /// 修改配置文件的方法
        /// </summary>
        /// <param name="config"></param>
        public static void updateAppConfig(AppConfigEntity config)
        {
            string          file      = System.Windows.Forms.Application.StartupPath + "\\Xr.RtManager.exe";
            WebConfigHelper appConfig = new WebConfigHelper(file, ConfigType.ExeConfig);

            appConfig.ModifyAppSetting("hospitalCode", config.hospitalCode);
            appConfig.ModifyAppSetting("PrinterName", config.PrinterName);
            appConfig.ModifyAppSetting("firstStart", config.firstStart);
            appConfig.Save();
        }
コード例 #3
0
        /// <summary>
        /// 加载本地配置信息
        /// </summary>
        private static void loadAppConfig()
        {
            String          file      = System.Windows.Forms.Application.StartupPath + "\\Xr.RtManager.exe";
            WebConfigHelper appConfig = new WebConfigHelper(file, ConfigType.ExeConfig);

            AppConfig              = new AppConfigEntity();
            AppConfig.serverUrl    = appConfig.GetValueByKey("serverUrl");
            AppConfig.hospitalCode = appConfig.GetValueByKey("hospitalCode");
            AppConfig.PrinterName  = appConfig.GetValueByKey("PrinterName");
            AppConfig.firstStart   = appConfig.GetValueByKey("firstStart");
            AppConfig.pagesize     = appConfig.GetValueByKey("pagesize");
        }
コード例 #4
0
        /// <summary>
        /// 加载本地配置信息
        /// </summary>
        private static void loadAppConfig()
        {
            String          file      = System.Windows.Forms.Application.StartupPath + "\\Xr.RtManager.exe";
            WebConfigHelper appConfig = new WebConfigHelper(file, ConfigType.ExeConfig);

            AppConfig                  = new AppConfigEntity();
            AppConfig.serverUrl        = appConfig.GetValueByKey("serverUrl");
            AppConfig.hospitalCode     = appConfig.GetValueByKey("hospitalCode");
            AppConfig.PrinterName      = appConfig.GetValueByKey("PrinterName");
            AppConfig.firstStart       = appConfig.GetValueByKey("firstStart");
            AppConfig.pagesize         = appConfig.GetValueByKey("pagesize");
            AppConfig.serverIp         = Xr.Common.Utils.Utils.StartSubString(AppConfig.serverUrl, 0, "/") + Xr.Common.Utils.Utils.SubBetweenString(AppConfig.serverUrl, "//", "/", true, true);
            AppConfig.showUpdateNotice = appConfig.GetValueByKey("showUpdateNotice");
            AppConfig.LocalDeptName    = appConfig.GetValueByKey("LocalDeptName");
            AppConfig.CheckInAgain     = appConfig.GetValueByKey("CheckInAgain");
            //AppConfig.RefreshTime = appConfig.GetValueByKey("RefreshTime");
        }