public void Zy_ExportPatientFee(int ybId, List <DataTable> dtList, string CaseNumber)
        {
            //if (dt == null || dt.Rows.Count == 0)
            //{
            //    MessageBox.Show("数据源为空!");
            //    return;
            //}

            string sColumnName = "";

            try
            {
                string sType = M_GetMedicalInsuranceData(ybId, "ExportPatientFee", "filetype");

                sColumnName = M_GetMedicalInsuranceData(ybId, "ExportPatientFee", "columnNames");

                string sSeparator = M_GetMedicalInsuranceData(ybId, "ExportPatientFee", "separator");

                List <Dictionary <string, string> > columnNamesList = new List <Dictionary <string, string> >();

                string[] sColumnNames = sColumnName.Split('^');
                for (int i = 0; i < sColumnNames.Length; i++)
                {
                    Dictionary <string, string> dss = new Dictionary <string, string>();
                    string[] sColumnNamess          = sColumnNames[i].Split('|');

                    foreach (string s in sColumnNamess)
                    {
                        dss.Add(s.Split(',')[0], s.Split(',')[1]);
                    }
                    columnNamesList.Add(dss);
                }

                ExportFile doExport    = new ExportFile("zyfj" + CaseNumber, columnNamesList, sSeparator);
                ExportType _exportType = sType.Trim() == "1" ? ExportType.Excel : ExportType.Txt;
                if (doExport.InitShowDialog(_exportType))
                {
                    if (doExport.DoExportWork(dtList))
                    {
                        doExport.OpenFile();
                        Zy_UploadzyPatFee(Convert.ToInt32(dtList[1].Rows[0]["PatListID"].ToString()), 1);
                    }
                }
            }
            catch
            {
                MessageBox.Show("导出失败!");
                return;
            }
        }
        public void Mz_ExportPatientFee(int ybId, DataTable dt)
        {
            string sColumnName = "";

            try
            {
                string sType = M_GetMedicalInsuranceData(ybId, "ExportPatientFee", "filetype");

                sColumnName = M_GetMedicalInsuranceData(ybId, "ExportPatientFee", "columnNames");

                string sSeparator = M_GetMedicalInsuranceData(ybId, "ExportPatientFee", "separator");

                List <Dictionary <string, string> > columnNamesList = new List <Dictionary <string, string> >();

                string[] sColumnNames = sColumnName.Split('^');
                for (int i = 0; i < sColumnNames.Length; i++)
                {
                    Dictionary <string, string> dss = new Dictionary <string, string>();
                    string[] sColumnNamess          = sColumnNames[i].Split('|');

                    foreach (string s in sColumnNamess)
                    {
                        dss.Add(s.Split(',')[0], s.Split(',')[1]);
                    }
                    columnNamesList.Add(dss);
                }

                ExportFile doExport    = new ExportFile("HIS病人费用目录", columnNamesList, sSeparator);
                ExportType _exportType = sType.Trim() == "1" ? ExportType.Excel : ExportType.Txt;
                if (doExport.InitShowDialog(_exportType))
                {
                    //if (doExport.DoExportWork(dt))
                    //    doExport.OpenFile();
                }
            }
            catch
            {
                MessageBox.Show("导出失败!");
                return;
            }

            //if (Zy_UploadzyPatFee(Convert.ToInt32(dtList[1].Rows[0]["PatListID"].ToString())))
            //{
            //    iFrmMICostUpload.Refresh();
            //}
        }
        /// <summary>
        /// 调用读取卡片信息接口
        /// </summary>
        /// <param name="sDll"></param>
        /// <returns></returns>
        public void MZ_ExportJzxx(DateTime sDate)
        {
            List <DataTable>           dtList        = new List <DataTable>();
            Action <ClientRequestData> requestAction = ((ClientRequestData request) =>
            {
                request.AddData(sDate);
            });

            ServiceResponseData retdataMember = InvokeWcfService("MIProject.Service", "CommitTradeStateController", "MZ_ExportJzxx", requestAction);
            bool b = retdataMember.GetData <bool>(0);

            if (b)
            {
                DataTable dt = retdataMember.GetData <DataTable>(1);
                dtList.Add(dt);
            }
            else
            {
                MessageBoxShowError("无数据!");
                return;
            }



            string sColumnName = "";

            try
            {
                string sType = M_GetMedicalInsuranceData(1, "ExportJZXX", "filetype");

                sColumnName = M_GetMedicalInsuranceData(1, "ExportJZXX", "ColumnNames");

                string sSeparator = M_GetMedicalInsuranceData(1, "ExportJZXX", "separator");

                List <Dictionary <string, string> > columnNamesList = new List <Dictionary <string, string> >();

                string[] sColumnNames = sColumnName.Split('^');
                for (int i = 0; i < sColumnNames.Length; i++)
                {
                    Dictionary <string, string> dss = new Dictionary <string, string>();
                    string[] sColumnNamess          = sColumnNames[i].Split('|');

                    foreach (string s in sColumnNamess)
                    {
                        dss.Add(s.Split(',')[0], s.Split(',')[1]);
                    }
                    columnNamesList.Add(dss);
                }

                ExportFile doExport    = new ExportFile("jzxx", columnNamesList, sSeparator);
                ExportType _exportType = sType.Trim() == "1" ? ExportType.Excel : ExportType.Txt;
                if (doExport.InitShowDialog(_exportType))
                {
                    if (doExport.DoExportWork(dtList))
                    {
                        doExport.OpenFile();
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("导出失败!:" + e.Message);
                return;
            }
        }
예제 #4
0
        public void M_ExportHisLog(int ybId, List <DataTable> dtList, int iType)
        {
            //if (dt == null || dt.Rows.Count == 0)
            //{
            //    MessageBox.Show("数据源为空!");
            //    return;
            //}

            string typeName    = "";
            string sColumnName = "";

            try
            {
                string sType = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "filetype");
                switch (iType)
                {
                case 1:
                    typeName    = "西药";
                    sColumnName = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "YpColumnNames");
                    break;

                case 2:
                    typeName    = "材料";
                    sColumnName = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "ClColumnNames");
                    break;

                case 3:
                    typeName    = "项目";
                    sColumnName = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "XmColumnNames");
                    break;

                case 4:
                    typeName    = "中草药";
                    sColumnName = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "ZCYColumnNames");
                    break;

                default:
                    typeName    = "西药";
                    sColumnName = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "YpColumnNames");
                    break;
                }
                string sSeparator = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "separator");

                List <Dictionary <string, string> > columnNamesList = new List <Dictionary <string, string> >();

                string[] sColumnNames = sColumnName.Split('^');
                for (int i = 0; i < sColumnNames.Length; i++)
                {
                    Dictionary <string, string> dss = new Dictionary <string, string>();
                    string[] sColumnNamess          = sColumnNames[i].Split('|');

                    foreach (string s in sColumnNamess)
                    {
                        dss.Add(s.Split(',')[0], s.Split(',')[1]);
                    }
                    columnNamesList.Add(dss);
                }

                ExportFile doExport    = new ExportFile("HIS" + typeName + "目录", columnNamesList, sSeparator);
                ExportType _exportType = sType.Trim() == "1" ? ExportType.Excel : ExportType.Txt;
                if (doExport.InitShowDialog(_exportType))
                {
                    if (doExport.DoExportWork(dtList))
                    {
                        doExport.OpenFile();
                    }
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("导出失败!:" + e.Message);
                return;
            }



            //try
            //{
            //    string sType = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "filetype");
            //    string sColumnName = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "columnNames");
            //    string sSeparator = M_GetMedicalInsuranceData(ybId, "ExportHisLog", "separator");

            //    string[] sColumnNames = sColumnName.Split('|');
            //    columnNames.Clear();
            //    if (sType.Trim() == "1")
            //    {
            //        foreach (string s in sColumnNames)
            //        {
            //            columnNames.Add(s.Split(',')[0], s.Split(',')[1]);
            //        }

            //        ExcelHelper.Export(dt, "HIS目录", columnNames, @"E:\\医院" + typeName + "目录.xls");
            //    }
            //    else
            //    {

            //    }
            //    MessageBox.Show("导出完成!");
            //}
            //catch
            //{
            //    MessageBox.Show("导出失败!");
            //    return;
            //}
        }