コード例 #1
0
ファイル: HROneConfig.cs プロジェクト: dhamotharang/H-R-One
        public void Save()
        {
            string errorMessage = null;

            if (!HROne.CommonLib.FileIOProcess.IsFolderAllowWritePermission(AppDomain.CurrentDomain.BaseDirectory, out errorMessage))
            {
                throw new Exception(errorMessage);
            }
            string filename = getFilename();


            System.Configuration.ConfigXmlDocument config = new System.Configuration.ConfigXmlDocument();
            XmlElement   settings = config.CreateElement("Settings");
            XmlAttribute version  = config.CreateAttribute("Version");

            version.Value = "2.0";
            settings.Attributes.Append(version);
            config.AppendChild(settings);
            SetDatabaseConfigList(settings);

            settings.AppendChild(config.CreateElement("ShutdownAfterUsed"));
            settings["ShutdownAfterUsed"].InnerText = ShutDownDomainAfterUsed ? "true" : "false";

            settings.AppendChild(config.CreateElement("AllowMultiDB"));
            settings["AllowMultiDB"].InnerText = AllowMultiDB ? "true" : "false";

            config.Save(filename);
        }
コード例 #2
0
        private void m_mthInit()
        {
            m_printDoc      = new PrintDocument();
            printDocBarcode = new PrintDocument();
            try
            {
                string strdtPat = Application.StartupPath + @"\LIS_GUI.dll.config";
                System.Configuration.ConfigXmlDocument appConfig = new System.Configuration.ConfigXmlDocument();
                appConfig.Load(strdtPat);
                strPrinterName = appConfig["configuration"]["appSettings"].SelectSingleNode("add[@key=\"PrinterName\"]").Attributes["value"].Value;
                if (!string.IsNullOrEmpty(strPrinterName))
                {
                    m_printDoc.PrinterSettings.PrinterName = strPrinterName;
                    //printDocBarcode.PrinterSettings.PrinterName = strPrinterName;
                }
            }
            catch
            { }

            m_objReportPrint           = new clsBIHApplySinglePrintTool();
            m_printDoc.PrintController = new System.Drawing.Printing.StandardPrintController();
            m_printDoc.BeginPrint     += new PrintEventHandler(m_printDoc_BeginPrint);
            m_printDoc.PrintPage      += new PrintPageEventHandler(m_printDoc_PrintPage);
            m_printDoc.EndPrint       += new PrintEventHandler(m_printDoc_EndPrint);

            printDocBarcode.BeginPrint += new PrintEventHandler(printDocBarcode_BeginPrint);
            printDocBarcode.PrintPage  += new PrintPageEventHandler(printDocBarcode_PrintPage);
        }
コード例 #3
0
        private void frmMK3ItemSet_Load(object sender, EventArgs e)
        {
            m_mthInitDataGridview();
            m_dgCheckItemCustom.AutoGenerateColumns = false;
            m_dgCheckItemResult.AutoGenerateColumns = false;
            m_dgCheckItemResult.AllowUserToAddRows  = false;
            m_dgCheckItemCustom.AllowUserToAddRows  = false;
            m_txtNo.Text = "1";
            m_cboResult.SelectedIndex = 0;
            string m_strDeviceModelID = null;

            try
            {
                string strConfigFilePath = Application.StartupPath + "\\MK3.config";
                System.Configuration.ConfigXmlDocument appConfig = new System.Configuration.ConfigXmlDocument();
                appConfig.Load(strConfigFilePath);
                m_strDeviceModelID = appConfig["configuration"]["appSettings"].SelectSingleNode("add[@key=\"strDeviceModelID\"]").Attributes["value"].Value.Trim();
            }
            catch
            {
                MessageBox.Show("³õʼ»¯Ê§°Ü£¡,ÇëÖØÐÂÆô¶¯", "ø±êÒDzÙ×÷Ìáʾ", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
            m_objController.m_mthGetAllCheckItem(m_strDeviceModelID);
        }
コード例 #4
0
 static ConfigurationLoader()
 {
     try
     {
         configXml = new System.Configuration.ConfigXmlDocument();
         configXml.Load(ConfigFilePath);
     }
     catch (FileNotFoundException ex)
     {
         ////加载文件出错,记录日志
     }
 }
コード例 #5
0
ファイル: UploadStorage.cs プロジェクト: pgava/FlowTasks
        public static UploadStorageProvider ProviderConfig(string path)
        {
            System.Configuration.ConfigXmlDocument e = new System.Configuration.ConfigXmlDocument();
            e.Load(path);

            Config config = Config.CreateFromConfigSection(null, e.FirstChild);

            if (config.DefaultStorageProviderName == null)
            {
                return(LastResortProvider);
            }
            return(config.StorageProviders[config.DefaultStorageProviderName]);
        }
コード例 #6
0
        private void m_btnConfirm_Click(object sender, System.EventArgs e)
        {
            try
            {
                string strConfigFilePath = Application.ExecutablePath + ".config";
                System.Configuration.ConfigXmlDocument appConfig = new System.Configuration.ConfigXmlDocument();
                appConfig.Load(strConfigFilePath);

                appConfig["configuration"]["appSettings"].SelectSingleNode("add[@key=\"Preference_frmReportInput_BatchConfirmStyle\"]").Attributes["value"].Value = this.m_chkUseBatchConfirmStyle.Checked.ToString();
                appConfig["configuration"]["appSettings"].SelectSingleNode("add[@key=\"Preference_frmReportInput_AutoPrint\"]").Attributes["value"].Value         = this.m_chkAutoPrint.Checked.ToString();

                appConfig.Save(strConfigFilePath);
            }
            catch (Exception ex)
            {
            }
        }
コード例 #7
0
        private void frmHandInputReportPreferences_Load(object sender, System.EventArgs e)
        {
            try
            {
                string strConfigFilePath = Application.ExecutablePath + ".config";
                System.Configuration.ConfigXmlDocument appConfig = new System.Configuration.ConfigXmlDocument();
                appConfig.Load(strConfigFilePath);

                string strBatchConfirm = appConfig["configuration"]["appSettings"].SelectSingleNode("add[@key=\"Preference_frmReportInput_BatchConfirmStyle\"]").Attributes["value"].Value;
                string strAutoPrint    = appConfig["configuration"]["appSettings"].SelectSingleNode("add[@key=\"Preference_frmReportInput_AutoPrint\"]").Attributes["value"].Value;

                this.m_chkUseBatchConfirmStyle.Checked = bool.Parse(strBatchConfirm);
                this.m_chkAutoPrint.Checked            = bool.Parse(strAutoPrint);
            }
            catch (Exception ex)
            {
            }
        }
コード例 #8
0
        private void frmLisBarcodeSort_Load(object sender, EventArgs e)
        {
            m_dgBarcodeSort.AutoGenerateColumns = false;
            m_dtToDate.Value   = DateTime.Now;
            m_dtFromDate.Value = DateTime.Now.AddDays(-1);
            m_dtBaricodeSort   = new DataTable();
            m_strLoginID       = this.LoginInfo.m_strEmpID;
            m_txtLoginEmp.Text = this.LoginInfo.m_strEmpName;
            DataColumn[] objColumnArr = new DataColumn[] { new DataColumn("PatientCard", typeof(string)), new DataColumn("PatientName", typeof(string)), new DataColumn("PatientSex", typeof(string)), new DataColumn("PatientAge", typeof(string)), new DataColumn("DateTime", typeof(DateTime)) };
            m_dtBaricodeSort.Columns.AddRange(objColumnArr);

            try
            {
                string strPath = Application.StartupPath + @"\LIS_GUI.dll.config";
                System.Configuration.ConfigXmlDocument appConfig = new System.Configuration.ConfigXmlDocument();
                appConfig.Load(strPath);
                string strIsBlood = appConfig["configuration"]["appSettings"].SelectSingleNode("add[@key=\"IsBlood\"]").Attributes["value"].Value.ToString();
                if (strIsBlood == "1")
                {
                    m_blnIsBlood = true;
                }
                else
                {
                    m_blnIsBlood = false;
                }
                clsLisMainSmp.s_obj.m_lngGetSysParm("6002", out m_strParmBlood);
                clsLisMainSmp.s_obj.m_lngGetSysParm("6007", out m_strParmBloodNo);
                m_xmlBarcodeSort = new XmlDocument();
                m_xmlBarcodeSort.Load(Application.StartupPath + @"\PatientBarcodeSort.XML");
                m_mthGetXMLData(m_xmlBarcodeSort);
            }
            catch (Exception objEx)
            {
                MessageBox.Show(this, objEx.Message, "检验条码打印排序提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }
        }
コード例 #9
0
        /*<===================================*/
        #endregion

        #region 打印报告的标题及基本信息
        private void m_mthPrintReportTop(System.Drawing.Printing.PrintPageEventArgs p_objPrintArgs)
        {
            m_lngY           = m_lngTitleTop;
            m_fltPrintWidth  = 452;
            m_fltPrintHeight = 320;
            if (m_fltPrintWidth == 0)
            {
                m_fltPrintWidth = p_objPrintArgs.PageBounds.Width * 0.8f;
            }
            if (m_fltPrintHeight == 0)
            {
                m_fltPrintHeight = p_objPrintArgs.PageBounds.Height;
            }

            #region 打印条型码
            float  X   = m_fltPrintWidth * 0.08f;
            float  Y   = m_fltPrintHeight * 0.02f + 45;
            string png = @"C:\IcarePNG\" + m_strBarCode + ".Png";

            SizeF sfBarCode = new SizeF(0, 0);
            if (m_strBarCode != null && m_strBarCode.Trim() != "")
            {
                System.Configuration.ConfigXmlDocument xmlConfig = new System.Configuration.ConfigXmlDocument();
                string strPath = System.AppDomain.CurrentDomain.BaseDirectory;
                strPath += "LoginFile.xml";
                xmlConfig.Load(strPath);
                string strBarCodeFont = xmlConfig["Main"]["lisBarCodeName"].Value;
                sfBarCode = p_objPrintArgs.Graphics.MeasureString(m_strBarCode, new Font(strBarCodeFont, 15.00f));
                p_objPrintArgs.Graphics.DrawString(m_strBarCode, new Font(strBarCodeFont, 15.00f), Brushes.Black, X, Y + 15);
            }

            if (File.Exists(png))
            {
                Image img = Image.FromFile(png);
                p_objPrintArgs.Graphics.DrawImage(img, X + sfBarCode.Width + 5, Y, 208, 40);
                img.Dispose();
            }

            #endregion

            SizeF sfTitle     = p_objPrintArgs.Graphics.MeasureString(m_strTitle, m_fntTitle);
            float fltCurrentX = (m_fltPrintWidth - sfTitle.Width) / 2 - 150;

            p_objPrintArgs.Graphics.DrawString(m_strTitle, m_fntTitle, Brushes.Black, m_fltPrintWidth * 0.08f, m_lngTitleTop);

            //add by wjqin(07-3-29)
            //本次打印时间
            m_lngY += (long)sfTitle.Height + 5;
            string m_strPrintDate = DateTime.Now.ToString("yyyy-MM-dd HH:mm");
            //if (m_strPRINTED_NUM.Equals("1"))
            //{
            //    m_strPrintDate += " 重打";
            //}
            //else
            //{
            //}
            SizeF sfWords = p_objPrintArgs.Graphics.MeasureString(m_strPrintDate, m_fntSmallNotBold);
            //p_objPrintArgs.Graphics.DrawString(m_strTitle, m_fntTitle, Brushes.Black, m_fltPrintWidth * 0.08f, m_lngTitleTop);
            p_objPrintArgs.Graphics.DrawString(m_strPrintDate, m_fntSmallNotBold, Brushes.Black, m_fltPrintWidth * 0.96f - sfWords.Width, m_lngY);
            /*<=================================*/
            //change by wjqin(07-3-29)
            //if (m_strBarCode != null && m_strBarCode.Trim() != "")
            //{
            //    m_lngY += 70;
            //}
            //else
            //    m_lngY += 30;
            if (m_strBarCode != null && m_strBarCode.Trim() != "")
            {
                m_lngY += 60;
            }
            else
            {
                m_lngY += 20;
            }
            /*<====================================*/
        }
コード例 #10
0
        string m_strBarCode = "";        //xing.chen add for print barcode
        #endregion

        #region 打印报告的标题及基本信息
        private void m_mthPrintReportTop(System.Drawing.Printing.PrintPageEventArgs p_objPrintArgs)
        {
            m_lngY = m_lngTitleTop;
            if (m_fltPrintWidth == 0)
            {
                m_fltPrintWidth = p_objPrintArgs.PageBounds.Width * 0.8f;
            }
            SizeF sfTitle     = p_objPrintArgs.Graphics.MeasureString(m_strTitle, m_fntTitle);
            float fltCurrentX = (p_objPrintArgs.PageBounds.Width - sfTitle.Width) / 2;

            p_objPrintArgs.Graphics.DrawString(m_strTitle, m_fntTitle, Brushes.Black, fltCurrentX, m_lngTitleTop);

            //门诊号
            SizeF sfWords = p_objPrintArgs.Graphics.MeasureString("门诊号:", m_fntSmallNotBold);

            m_lngY      = m_lngY + (long)sfTitle.Height - (long)sfWords.Height;
            fltCurrentX = m_fltPrintWidth * 0.08f;

            p_objPrintArgs.Graphics.DrawString("门诊号:", m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);
            fltCurrentX += sfWords.Width;
            p_objPrintArgs.Graphics.DrawString(m_strOutPatientNO, m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);

            //住院号
            m_lngY     += (long)sfWords.Height + 10;
            fltCurrentX = m_fltPrintWidth * 0.08f;

            p_objPrintArgs.Graphics.DrawString("住院号:", m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);
            fltCurrentX += sfWords.Width;
            p_objPrintArgs.Graphics.DrawString(m_strPatientInHospitalNO, m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);

            //科室
            fltCurrentX = m_fltPrintWidth * 0.36f;
            sfWords     = p_objPrintArgs.Graphics.MeasureString("科室:", m_fntSmallNotBold);

            p_objPrintArgs.Graphics.DrawString("科室:", m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);

            fltCurrentX += sfWords.Width;
            p_objPrintArgs.Graphics.DrawString(m_strApplyDept, m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);

            //床号
            fltCurrentX = m_fltPrintWidth * 0.66f;

            p_objPrintArgs.Graphics.DrawString("床号:", m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);

            fltCurrentX += sfWords.Width;
            p_objPrintArgs.Graphics.DrawString(m_strBedNO, m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);

            //申请单号
            fltCurrentX = m_fltPrintWidth * 0.88f;
            sfWords     = p_objPrintArgs.Graphics.MeasureString("申请单号:", m_fntSmallNotBold);

            p_objPrintArgs.Graphics.DrawString("申请单号:", m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);

            fltCurrentX += sfWords.Width;
            p_objPrintArgs.Graphics.DrawString(m_strApplicationNO, m_fntSmallNotBold, Brushes.Black, fltCurrentX, m_lngY);

            //xing.chen add for print barcode
            if (m_strBarCode != null && m_strBarCode.Trim() != "")
            {
                System.Configuration.ConfigXmlDocument xmlConfig = new System.Configuration.ConfigXmlDocument();
                string strPath = System.AppDomain.CurrentDomain.BaseDirectory;
                strPath += "LoginFile.xml";
                xmlConfig.Load(strPath);
                string strBarCodeFont = xmlConfig["Main"]["lisBarCodeName"].Value;
                m_strBarCode = "*" + m_strBarCode + "*";
                p_objPrintArgs.Graphics.DrawString(m_strBarCode, new Font(strBarCodeFont, 32.00f), Brushes.Black, fltCurrentX - 50, m_lngY - 60);
            }

            //底端的Y坐标
            m_lngY += (long)sfWords.Height;
        }
コード例 #11
0
ファイル: HROneConfig.cs プロジェクト: dhamotharang/H-R-One
 public void load(string filename)
 {
     System.Configuration.ConfigXmlDocument config = new System.Configuration.ConfigXmlDocument();
     try
     {
         config.Load(filename);
         if (config["Settings"] != null)
         {
             if (config["Settings"].Attributes["Version"] == null)
             {
                 DatabaseConfig dbconfig = LoadDatabaseConfig(config["Settings"]);
                 if (dbconfig != null)
                 {
                     DatabaseConfigList.Add(dbconfig);
                     //DBType = dbconfig.DBType;
                     //ConnectionString = dbconfig.ConnectionString;
                 }
                 if (config["Settings"]["ShutdownAfterUsed"] != null)
                 {
                     string strShutdownAfterUsed = config["Settings"]["ShutdownAfterUsed"].InnerText;
                     if (strShutdownAfterUsed.Equals("Yes", StringComparison.CurrentCultureIgnoreCase) ||
                         strShutdownAfterUsed.Equals("True", StringComparison.CurrentCultureIgnoreCase))
                     {
                         ShutDownDomainAfterUsed = true;
                     }
                     else
                     {
                         ShutDownDomainAfterUsed = false;
                     }
                 }
             }
             else if (config["Settings"].Attributes["Version"].Value == "2.0")
             {
                 XmlNodeList dbConfigXmlList = config["Settings"].GetElementsByTagName("DatabaseConfig");
                 foreach (XmlElement dbConfigXML in dbConfigXmlList)
                 {
                     DatabaseConfig dbconfig = LoadDatabaseConfig(dbConfigXML);
                     if (dbconfig != null)
                     {
                         DatabaseConfigList.Add(dbconfig);
                         //DBType = dbconfig.DBType;
                         //ConnectionString = dbconfig.ConnectionString;
                     }
                 }
                 if (config["Settings"]["ShutdownAfterUsed"] != null)
                 {
                     string strShutdownAfterUsed = config["Settings"]["ShutdownAfterUsed"].InnerText;
                     if (strShutdownAfterUsed.Equals("Yes", StringComparison.CurrentCultureIgnoreCase) ||
                         strShutdownAfterUsed.Equals("True", StringComparison.CurrentCultureIgnoreCase))
                     {
                         ShutDownDomainAfterUsed = true;
                     }
                     else
                     {
                         ShutDownDomainAfterUsed = false;
                     }
                 }
                 if (config["Settings"]["AllowMultiDB"] != null)
                 {
                     string strAllowMultiDB = config["Settings"]["AllowMultiDB"].InnerText;
                     if (strAllowMultiDB.Equals("Yes", StringComparison.CurrentCultureIgnoreCase) ||
                         strAllowMultiDB.Equals("True", StringComparison.CurrentCultureIgnoreCase))
                     {
                         AllowMultiDB = true;
                     }
                     else
                     {
                         AllowMultiDB = false;
                     }
                 }
             }
         }
     }
     catch
     {
     }
 }