/// <summary> /// Se for um campo definido por posicao, definir o valor com base nas posicoes /// </summary> public void setValorLinha(string line) { if (line.isEmpty()) { return; } if (!string.IsNullOrEmpty(this.valorFixo)) { this.valor = valorFixo; return; } try { if (line.Length < this.getStartIndex()) { this.valor = String.Empty; return; } string valorLinha = line.Substring(this.getStartIndex()); if (valorLinha.Length < this.getTamanho()) { this.valor = line.Substring(0, valorLinha.Length).Trim(); return; } this.valor = line.Substring(this.getStartIndex(), this.getTamanho()).Trim(); } catch (ArgumentOutOfRangeException ex) { string obs = String.Concat("linha: ", line, "\n", this.getStartIndex(), "-", this.getTamanho()); UtilLog.saveError(ex, obs); this.valor = line.Substring(this.getStartIndex(), (line.Length - this.getStartIndex())); } }
private void registrarInicioAtendimento(int idAtendimento) { var OAtendimento = this.OAtendimentoConsultaBL.carregar(idAtendimento); try { OAtendimento.dtInicioAtendimento = OAtendimento.dtInicioAtendimento ?? DateTime.Now; OAtendimento.idUsuarioInicioAtendimento = OAtendimento.idUsuarioInicioAtendimento ?? HttpContextFactory.Current.User.id(); OAtendimento.idUltimoUsuarioAtendimento = HttpContextFactory.Current.User.id(); OAtendimento.dtUltimoAtendimento = DateTime.Now; OAtendimento.idStatusAtendimentoAnterior = OAtendimento.idStatusAtendimento; OAtendimento.idStatusAtendimento = AtendimentoStatusConst.EM_ATENDIMENTO; this.OAtendimentoCadastroBL.salvar(OAtendimento); } catch (Exception ex) { UtilLog.saveError(ex, $"Erro ao registrar o primeiro histórico do atendimento { OAtendimento.id }: OnAtendimentoIniciadoHandler"); } }
//Atributos //Propridades //Chamador das ações do evento public override void execute(object source) { try { this.OAssociado = source as Associado; this.OAssociado.TipoAssociado = new TipoAssociadoBL().carregar(UtilNumber.toInt32(OAssociado.idTipoAssociado), this.OAssociado.idOrganizacao); this.gerarOcorrencia(); this.gerarTaxaInscricao(); this.iniciarProcessoAdmissao(); this.gerarContribuicao(); this.dispararEmail(); this.gerarSaldoInicial(); } catch (Exception ex) { UtilLog.saveError(ex, $"Erro no manipulador do evento de cadastro do associado {this.OAssociado.Pessoa.nome}"); } }
// public void save(Exception ex) { LogErro Erro = new LogErro(); Erro.idUsuarioLogado = User.id(); Erro.exceptionMessage = ex.Message; Erro.exceptionTrace = ex.StackTrace; if (ex.InnerException != null) { Erro.exceptionInnerMessage = ex.InnerException.Message; Erro.exceptionInnerTrace = ex.InnerException.StackTrace; if (ex.InnerException.InnerException != null) { Erro.exceptionInnerMessage = ex.InnerException.InnerException.Message; Erro.exceptionInnerTrace = ex.InnerException.InnerException.StackTrace; } } Erro.dtErro = DateTime.Now; Erro.ip = System.Web.HttpContext.Current.Request.UserHostAddress; Erro.source = ex.Source; Erro.url = HttpContext.Current.Request.RawUrl; Erro.metodo = ex.TargetSite.ToString(); var rd = HttpContext.Current.Request.RequestContext.RouteData; if (rd != null) { Erro.module = rd.Values["area"] as string; Erro.controllerName = rd.GetRequiredString("controller"); Erro.actionName = rd.GetRequiredString("action"); } Erro.setDefaultInsertValues <LogErro>(); db.LogErro.Add(Erro); db.SaveChanges(); UtilLog.saveError(ex, ""); }
private void LoadLotInfo() { try { string iniFilePath = Application.StartupPath + "\\config\\LotInfo.ini"; iniFile = new UtilIniFile(iniFilePath); foreach (Bin bin in hardBins) { bin.Qty = iniFile.ReadInt("HardBin", bin.Name); if (bin.Qty > 0) { ((TextBox)(this.Controls.Find("txt" + bin.Name, true)[0])).Text = bin.Qty.ToString(); gHardBins.Add(bin.Name, bin); } } //soft bin data for (int i = 1; i <= 30; i++) { int binQty = iniFile.ReadInt("SoftBin", "SoftBin" + i); if (binQty > 0) { Bin bin = new Bin(); bin.Name = "SoftBin" + i; bin.Qty = binQty; softBins.Add(bin); gSoftBins.Add(bin.Name, bin); } } } catch (Exception ex) { UtilLog.Error(ex); } }
/// <summary> /// /// </summary> /// <param name="id"></param> /// <param name="type"></param> /// <param name="values"></param> /// <param name="msg"></param> /// <returns></returns> public int QueryPatientInfo(string id, string type, out ArrayList values, out string msg) { values = new ArrayList(); msg = ""; int ret = -1; string sqlQuery = string.Format(" select * from FY030102 where id={0} and type={1} ", id, type); OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; try { dr = DbHelperOra.ExecuteReader(sqlQuery, connection); if (dr.HasRows) { ConnectPerson entity = new ConnectPerson(); entity.brid = !dr.IsDBNull(0) ? dr.GetString(0) : ""; entity.label = !dr.IsDBNull(1) ? dr.GetString(1) : ""; entity.name = !dr.IsDBNull(2) ? dr.GetString(2) : ""; values.Add(entity); } } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); msg = GetExceptionInfo(ex); ret = -1; return(ret); } finally { if (null != dr) { dr.Close(); } connection.Close(); } return(1); }
// Vincular contribuição ao Associado protected void gerarContribuicao() { try { if (OAssociado.dtImportacao.HasValue) { return; } if (this.OAssociado.TipoAssociado == null) { return; } if (this.OAssociado.TipoAssociado.flagGerarCobrancaPosCadastro == false) { return; } new AssociadoContribuicaoGeracaoBL().gerarCobranca(OAssociado, null, null, null, true); } catch (Exception ex) { UtilLog.saveError(ex, $"Erro ao vincular uma contribuição para o associado {this.OAssociado.Pessoa.nome}"); } }
/// <summary> /// Create a new GSC File for each files in the directory. /// </summary> public static void OpenDirGSC <T>() where T : AbstractFunction { int index = 1; List <string> dirs = Directory.GetFiles(Options.GSC_Folder, "*.gs*", Options.AllowSubDir ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly).ToList(); dirs.RemoveAll(item => item.Contains("_new.gsc")); foreach (string path in dirs ?? Enumerable.Empty <string>()) { if (Path.GetFileName(path).Contains("_new.gsc")) { continue; } string file = Path.GetFileNameWithoutExtension(path); string dir = path.Substring(0, path.IndexOf(file + ".gs")); string opath = dir + file + "_new.gsc"; UtilLog.LogFile(path, index, dirs.Count); new GSCFile <T>(path).Save(opath); index++; } }
//Chamador das ações do evento public void execute(object source) { try { var listaParametros = source as List <object>; this.listaNotificacoesEnvio = (listaParametros[0] as List <NotificacaoSistemaEnvio>); this.ONotificacaoSistema = (listaParametros[1] as NotificacaoSistema); if (listaNotificacoesEnvio == null) { throw new Exception("Nenhum item de notificação foi enviado para geração de tarefa."); } if (this.ONotificacaoSistema.flagMobile == true) { this.enviarMensagemApp(); } } catch (Exception ex) { UtilLog.saveError(ex, "Erro no manipulador de evento: OnNotificacaoCadastradaHandler"); } }
//Atributos //Servicos //Chamador das ações do evento public void execute(object source) { var OPagamentoParam = source as TituloReceitaPagamento ?? new TituloReceitaPagamento(); var OPagamento = this.carregarDadosPagamento(OPagamentoParam.id); if (OPagamento == null) { throw new Exception("Não foi possível executar o manipulador OnPagamentoRecebidoHandler pois o objeto é nulo."); } try { this.liquidar(OPagamento); } catch (Exception ex) { UtilLog.saveError(ex, $"Erro ao executar a rotina de baixa no titulo em OnPagamentoRecebidoHandler. Pagamento {OPagamento.id}"); } try { this.enviarEmail(OPagamento); }catch (Exception ex) { UtilLog.saveError(ex, $"Erro ao executar a rotina de envio de e-mail em OnPagamentoRecebidoHandler. Pagamento {OPagamento.id}"); } }
//正式分析 private void Analyse() { System.Collections.ArrayList list = new System.Collections.ArrayList(); int itemnum = 0; list.Clear(); foreach (Buy buyitem in pnl_buysell.GetAllBuy()) { foreach (Sell sellitem in pnl_buysell.GetAllSell()) { foreach (int buyrule in Rule.rulebuy_type) { //计算的时候可以看到并没有考虑止损, 但实际显示结果时都有考虑 StockOpeItem[] rule_items = StockAnalysisSQL.CalculateSave2Analysis2(startdate, enddate, buyitem.ToString(), sellitem.ToString(), buyrule); //计算当前分析进度 foreach (StockOpeItem rule_item in rule_items) { if (rule_item.grade < buyitem.minumum_grade) { continue; } list.Add(rule_item); } } itemnum++; prog.SetProgress(itemnum * 100 * StockApp.allstock.Count / analyse_total); UtilLog.AddInfo(TAG, buyitem.ToString() + "-" + sellitem.ToString() + " analysis finished "); } }// for each buy StockAnalysisSQL.SaveToDB_Analysis2(list); UtilLog.AddInfo(TAG, startdate + " till " + enddate + " buy analyse finished."); }
// private void dispararEmail() { try { if (OAssociado.dtImportacao.HasValue) { return; } ConfiguracaoNotificacao OConfiguracaoNotificacao = ConfiguracaoNotificacaoBL.getInstance.carregar(OAssociado.idOrganizacao); if (String.IsNullOrEmpty(OConfiguracaoNotificacao.emailNovoAssociado)) { return; } List <string> listaEmail = OConfiguracaoNotificacao.emailNovoAssociado.Split(';').ToList(); var OEmail = EnvioNovoNaoAssociado.factory(OAssociado.idOrganizacao, this.OAssociado.Pessoa.ToEmailList(), null, listaEmail); OEmail.enviar(this.OAssociado); } catch (Exception ex) { UtilLog.saveError(ex, "Erro ao enviar e-mail após cadastro de associado pelo sistema"); } }
/// <summary> /// 一个化验报告单详细列表信息 /// </summary> /// <param name="doctadviseno">条码号</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_LaboratoryTestsReportDetailedListInformation(string doctadviseno, out ArrayList values, out string msg) { msg = ""; values = new ArrayList(); OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; try { bool _flag = false; double number = Convert.ToDouble(doctadviseno); string findText = _builder.GetLaboratoryTestsReportDetailedListInformation(number, out _flag, out msg); if (!_flag) { return(10); } int ret = -1; msg = ""; dr = DbHelperOra.ExecuteReader(findText, connection); if (null != dr && dr.HasRows) { while (dr.Read()) { AlipayReportdetailInfo ri = new AlipayReportdetailInfo(); ri.jylx = !dr.IsDBNull(0) ? dr.GetString(0) : ""; ri.xmmc = !dr.IsDBNull(1) ? dr.GetString(1) : ""; ri.result = !dr.IsDBNull(2) ? dr.GetString(2) : ""; ri.hint = !dr.IsDBNull(3) ? dr.GetString(3) : ""; ri.jkfw = !dr.IsDBNull(4) ? dr.GetString(4) : ""; ri.xmdw = !dr.IsDBNull(5) ? dr.GetString(5) : ""; values.Add(ri); } ret = 0; } else { values = null; msg = "未能找到报告单"; ret = 17; } return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); values = null; msg = GetExceptionInfo(ex); return(AppUtils.Default_Exception_Code); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
/// <summary> /// 通知病人就诊信息 /// </summary> /// <param name="msg"></param> /// <returns></returns> public int DB_InformPatient(out ArrayList values, out string msg) { int ret = -1; //1代表以预约 int Preengagestate = 1; values = null; msg = ""; values = new ArrayList(); OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; try { bool _flag = false; string interText = _builder.GetInformPatientSql(Preengagestate, out _flag, out msg); if (!_flag) { return(10); } dr = DbHelperOra.ExecuteReader(interText, connection); if (dr.HasRows) { if (dr.Read()) { while (dr.Read()) { InformPatientInfo ri = new InformPatientInfo(); ri.userid = !dr.IsDBNull(0) ? dr.GetString(0) : ""; ri.brxm = !dr.IsDBNull(1) ? dr.GetString(1) : ""; ri.ysxm = !dr.IsDBNull(2) ? dr.GetString(2) : ""; ri.jzdz = !dr.IsDBNull(3) ? dr.GetString(3) : ""; ri.jzsj = !dr.IsDBNull(4) ? dr.GetString(4) : ""; ri.jzrq = !dr.IsDBNull(5) ? dr.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : " "; values.Add(ri); } msg = "获取成功"; } ret = 0; dr.Close(); return(ret); } } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); msg = GetExceptionInfo(ex); values = null; return(-1); } finally { if (null != dr) { dr.Close(); } connection.Close(); } return(ret); }
/// <summary> /// 核对未到账的充值缴费信息 /// </summary> /// <param name="msg"></param> /// <returns></returns> public int DB_CheckInformation(out ArrayList values, out string msg) { int ret = -1; //0代表以创建的订单 int ddzt = 0; values = null; msg = ""; values = new ArrayList(); OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; try { bool _flag = false; string interText = _builder.GetCheckInformationSql(ddzt, out _flag, out msg); if (!_flag) { return(10); } long yylsh = 0; dr = DbHelperOra.ExecuteReader(interText, connection); if (dr.HasRows) { while (dr.Read()) { CheckInformation ri = new CheckInformation(); yylsh = !dr.IsDBNull(0) ? dr.GetInt64(0) : 0; ri.out_trade_no = StringHelper.YylshHasPrefix(yylsh); ri.brlx = !dr.IsDBNull(1) ? Convert.ToString(dr.GetInt32(1)) : ""; if (ri.brlx == "1") { ri.patientid = !dr.IsDBNull(2) ? Convert.ToString(dr.GetInt64(2)) : ""; } else if (ri.brlx == "2") { ri.inpatientno = !dr.IsDBNull(2) ? Convert.ToString(dr.GetInt64(2)) : ""; } ri.patientname = !dr.IsDBNull(3) ? dr.GetString(3) : " "; ri.money = !dr.IsDBNull(4) ? Convert.ToString(dr.GetDouble(4)) : " "; ri.openid = !dr.IsDBNull(5) ? dr.GetString(5) : " "; values.Add(ri); } msg = "获取成功"; } ret = 0; dr.Close(); return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); msg = GetExceptionInfo(ex); values = null; return(-1); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
void Awake() { UtilLog.Log("Awake"); DontDestroyOnLoad(this.gameObject); }
/// <summary> /// 查询剩余床位数 /// </summary> /// <param name="list">床位信息</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_QueryRemainBeds(out ArrayList list, out string msg) { msg = ""; list = null; OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; try { bool _flag = false; string sql = _builder.GetSqlRemaindBeds(out _flag, out msg); if (!_flag) { return(10); } int ret = -1; dr = DbHelperOra.ExecuteReader(sql, connection); if (dr.HasRows) { list = new ArrayList(); while (dr.Read()) { RemainBeds ri = new RemainBeds(); ri.bqmc = !dr.IsDBNull(0) ? dr.GetString(0) : ""; if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSYJXDSRMYY) { ri.sycw = ri.zdcws = !dr.IsDBNull(1) ? dr.GetInt32(1) : 0; } else { if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY || WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXDYRMYY || WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSCNXFYBJYY || WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSTSXZYY) { ri.bqid = !dr.IsDBNull(1) ? dr.GetString(1) : ""; } else { ri.bqid = !dr.IsDBNull(1) ? Convert.ToString(dr.GetInt64(1)) : ""; } ri.zzrenshu = !dr.IsDBNull(2) ? dr.GetInt32(2) : 0; if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDQRMYY) { ri.zdcws = !dr.IsDBNull(3) ? Convert.ToInt32(dr.GetString(3)) : 0; } else { ri.zdcws = !dr.IsDBNull(3) ? dr.GetInt32(3) : 0; } ri.sycw = (ri.zdcws - ri.zzrenshu) > 0 ? (ri.zdcws - ri.zzrenshu) : 0; if (WebConfigParameter.HospitalName() == AppUtils.HOSPITALNAME.WZSDEYY) { ri.sycw = -ri.zzrenshu; } } list.Add(ri); } ret = 0; } else { list = null; msg = "没有找到床位信息。"; ret = 1; } return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); list = null; msg = GetExceptionInfo(ex); return(AppUtils.Default_Exception_Code); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
/// <summary> /// 药品分页查询 /// </summary> /// <param name="pNumber">所在页数</param> /// <param name="pRows">每页显示条数</param> /// <param name="values">药品信息</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_PageMedicine(int pNumber, int pRows, out ArrayList values, out string msg) { msg = ""; OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; values = new ArrayList(); try { int ret = -99; long maxrow; long minrow; General.CalculatePage(pNumber, pRows, out maxrow, out minrow); bool _flag = false; string findId1 = _builder.GetMedicinePage(maxrow, minrow, out _flag, out msg); if (!_flag) { return(10); } dr = DbHelperOra.ExecuteReader(findId1, connection); if (dr.HasRows) { while (dr.Read()) { MedicineDetail pd = new MedicineDetail(); pd.lx = !dr.IsDBNull(0) ? dr.GetString(0) : ""; pd.mc = !dr.IsDBNull(1) ? dr.GetString(1) : ""; pd.dw = !dr.IsDBNull(2) ? dr.GetString(2) : ""; pd.gg = !dr.IsDBNull(3) ? dr.GetString(3) : ""; pd.cd = !dr.IsDBNull(4) ? dr.GetString(4) : ""; pd.jg = !dr.IsDBNull(5) ? dr.GetDouble(5) : 0; values.Add(pd); } ret = 0; } else { msg = "亲,没有记录"; values = null; ret = 2; } dr.Close(); return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); msg = GetExceptionInfo(ex); values = null; return(-1); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
/// <summary> /// 收费项目查询(按拼音码) /// </summary> /// <param name="pydm">拼音代码</param> /// <param name="values">收费信息</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_QueryCharge(string pydm, out ArrayList values, out string msg) { msg = ""; OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; values = new ArrayList(); try { int ret = -1; bool _flag = false; string findId1 = _builder.GetChargeByPy(pydm, out _flag, out msg); if (!_flag) { return(10); } dr = DbHelperOra.ExecuteReader(findId1, connection); if (dr.HasRows) { while (dr.Read()) { ChargeDetail pd = new ChargeDetail(); pd.lx = !dr.IsDBNull(0) ? dr.GetString(0) : ""; pd.mc = !dr.IsDBNull(1) ? dr.GetString(1) : ""; pd.dw = !dr.IsDBNull(2) ? dr.GetString(2) : ""; pd.jg = !dr.IsDBNull(3) ? dr.GetDouble(3) : 0; values.Add(pd); } ret = 0; } else { msg = "亲,没有记录"; values = null; ret = 2; } dr.Close(); return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); msg = GetExceptionInfo(ex); values = null; return(-99); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
/// <summary> /// 根据报告单号查询报告详细 /// </summary> /// <param name="bgdh">报告单号</param> /// <param name="rds">报告信息</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_queryReportJCDetail(string bgdh, out ICollection <ReportDetail> rds, out string msg) { OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; try { bool _flag = false; string sql = _builder.GetReportJCDetailXM(bgdh, out _flag, out msg); if (!_flag) { rds = new List <ReportDetail>(); return(10); } dr = DbHelperOra.ExecuteReader(sql, connection); if (dr.HasRows) { rds = new List <ReportDetail>(); while (dr.Read()) { ReportDetail rd = new ReportDetail(); rd.mc = !dr.IsDBNull(0) ? dr.GetString(0) : ""; rd.dw = !dr.IsDBNull(1) ? dr.GetString(1) : ""; rd.ckjg = !dr.IsDBNull(2) ? dr.GetString(2) : ""; rd.ts = !dr.IsDBNull(3) ? dr.GetString(3) : ""; rd.jg = !dr.IsDBNull(4) ? dr.GetString(4) : ""; rds.Add(rd); } msg = "找到报告明细"; return(0); } else { rds = null; msg = "未找到报告详细内容"; return(2); } } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); msg = GetExceptionInfo(ex); rds = null; return(-2); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
public static void BeginBuilder() { ////MonoCoroutine.Instantiate. allFileList.Clear(); depCountDict.Clear(); GetAllSubResFiles(resDir, allFileList); int count = allFileList.Count; for (int i = 0; i < count; i++) { string[] depList = AssetDatabase.GetDependencies(allFileList[i]); int depCount = depList.Length; //UtilLog.Error(" 当前文件 " + allFileList[i] + " ========================== "); for (int j = 0; j < depCount; j++) { if (FileIsResource(depList[j]) && string.Equals(depList[j], allFileList[i]) == false) { if (IsAlatsSprite(depList[j]) && IsSpriteAltas(allFileList[i])) { if (depCountDict.ContainsKey(depList[j])) { UtilLog.Error("图片" + depList[j] + "同时在两个图集里面:" + depCountDict[depList[j]][0] + " " + allFileList[i]); } else { depCountDict[depList[j]] = new List <string>(); depCountDict[depList[j]].Insert(0, allFileList[i]); } } else if (IsAlatsSprite(depList[j]) == false) { //UtilLog.Error(" 依赖的文件 " + depList[j]); if (depCountDict.ContainsKey(depList[j])) { depCountDict[depList[j]].Insert(0, allFileList[i]); } else { depCountDict[depList[j]] = new List <string>(); depCountDict[depList[j]].Insert(0, allFileList[i]); } } } } } XmlDocument abDict = new XmlDocument(); XmlElement dict = abDict.CreateElement("ResMap"); for (int i = 0; i < count; i++) { AssetImporter importer = AssetImporter.GetAtPath(allFileList[i]); if (depCountDict.ContainsKey(allFileList[i])) { int depCount = depCountDict[allFileList[i]].Count; if (depCount == 1) { importer.assetBundleName = string.Concat(depCountDict[allFileList[i]][0], ".unity3d"); } else { importer.assetBundleName = string.Concat(allFileList[i], ".unity3d"); } } else { importer.assetBundleName = string.Concat(allFileList[i], ".unity3d"); } importer.assetBundleName = importer.assetBundleName.Replace("/", "."); XmlElement element = abDict.CreateElement("Res"); element.SetAttribute("ResPath", allFileList[i]); element.SetAttribute("AbName", importer.assetBundleName); dict.AppendChild(element); } abDict.AppendChild(dict); UtilLog.Error(Application.streamingAssetsPath); string path = Application.streamingAssetsPath + "/AssetBundle/BundleDict.xml"; path = path.Replace("/", "//"); UtilLog.Error(path); abDict.Save(path); AssetDatabase.Refresh(); BuildPipeline.BuildAssetBundles("Assets/StreamingAssets/AssetBundle", BuildAssetBundleOptions.ChunkBasedCompression, BuildTarget.StandaloneWindows); }
public static SqlDataReader ExecuteReader(UtilLog log, string connectionString, CommandType cmdType, string cmdText, params SqlParameter[] commandParameters) { //Create the command and connection SqlCommand cmd = new SqlCommand(); SqlConnection conn = new SqlConnection(connectionString); log.LogInfoWithLevel(connectionString, Log_LoggingLevel.Admin); try { //Prepare the command to execute PrepareCommand(cmd, conn, null, cmdType, cmdText, commandParameters); //Execute the query, stating that the connection should close when the resulting datareader has been read SqlDataReader rdr = cmd.ExecuteReader(CommandBehavior.CloseConnection); cmd.Parameters.Clear(); return rdr; } catch { //If an error occurs close the connection as the reader will not be used and we expect it to close the connection conn.Close(); throw; } }
/// 初始化文本>>数据转换处理 private void InitText() { /// 拆分数据 _text = _text.Replace(_STR_R, _STR_N); _text = _text.Replace(_STR_N + _STR_N, _STR_N); string[] arr = _text.Split(_STR_N.ToCharArray()); /// 去表头 if (arr.Length > 0) { byte[] byt = System.Text.Encoding.UTF8.GetBytes(arr[0]); if (byt.Length >= 3 && byt[0] == 0xEF && byt[1] == 0xBB && byt[2] == 0xBF) { arr[0] = System.Text.Encoding.UTF8.GetString(byt, 3, byt.Length - 3); } } /// 检验数据有效性 if (arr.Length < 2) { UtilLog.LogError("表太短>>\n" + arr.Length); UtilLog.LogError(_text); return; } /// 生成字段key值 string[] arrLabel = arr[0].Split(split); int index = 0; for (index = 0; index < arrLabel.Length; index++) { if (string.IsNullOrEmpty(arrLabel[index])) { continue; } if (_key.ContainsKey(arrLabel[index])) { UtilLog.LogError("表中有相同重复字段>>\n" + arr[0]); continue; } _key.Add(arrLabel[index], index); } /// 生成值内容 [属性有问题再改WILL] for (index = 3; index < arr.Length; index++) { /// 去掉无效行 if (string.IsNullOrEmpty(arr[index])) { continue; } /// 三行 无字段 剔除 if (arr[index].StartsWith(",,,")) { continue; } /// 拆分 bool IsHead = arr[index][0] == ','; /// 使用正则拆分!!!难受 System.Text.RegularExpressions.MatchCollection regex_math = regex.Matches(IsHead ? "&" + arr[index] : arr[index]); if (regex_math.Count <= 0) { continue; } string[] arrValue = new string[regex_math.Count]; for (int i = 0; i < regex_math.Count; i++) { arrValue[i] = regex_math[i].Value; if (this._split_type == UtilCsvReaderType.comma) { /// 去掉没用的双引号 if (arrValue[i].StartsWith(",\"")) { arrValue[i] = arrValue[i].Substring(2, arrValue[i].Length - 3); continue; } /// 不可能出现小于这个的情况 switch (arrValue[i][0]) { case ',': case '&': arrValue[i] = arrValue[i].Substring(1); break; /// 头文件没有,号 case '"': arrValue[i] = arrValue[i].Substring(1, arrValue[i].Length - 2); break; } } if (this._split_type == UtilCsvReaderType.tab) { /// 去掉没用的双引号 if (arrValue[i].StartsWith("\t\"")) { arrValue[i] = arrValue[i].Substring(2, arrValue[i].Length - 3); continue; } /// 长度不够 if (arrValue[i].Length <= 0) { continue; } /// 不可能出现小于这个的情况 switch (arrValue[i][0]) { case '\t': case '&': arrValue[i] = arrValue[i].Substring(1); break; /// 头文件没有,号 case '"': arrValue[i] = arrValue[i].Substring(1, arrValue[i].Length - 2); break; } } } _keyValue.Add(arrValue); } /// 原有文本清空 _text = null; arr = null; }
/// 字段复制 private void SetFieldValue(FieldInfo field, object obj, Dictionary <string, string> hash) { if (obj == null) { return; } if (field == null) { return; } if (hash == null) { return; } string fieldName = field.Name; if (!string.IsNullOrEmpty(fieldNameEndStr) && hash.ContainsKey(fieldName + fieldNameEndStr)) { fieldName = fieldName + fieldNameEndStr; } if (!hash.ContainsKey(fieldName)) { return; } try { if (field.FieldType == typeof(string[][])) { if (hash[fieldName] == null || hash[fieldName] == "" || hash[fieldName] == "#") { field.SetValue(obj, null); return; } //先看是不是用#作分割 string[] arrSplit1 = hash[fieldName].Split("#".ToCharArray()); if (null != arrSplit1) { List <string[]> lstSplit2 = new List <string[]>(); for (int i = 0; i < arrSplit1.Length; i++) { //空的就不做考虑 if (string.IsNullOrEmpty(arrSplit1[i])) { continue; } //再分 string[] arrTemp = arrSplit1[i].Split("|".ToCharArray()); lstSplit2.Add(arrTemp); } if (lstSplit2.Count > 0) { //二维数组赋给二维数组 field.SetValue(obj, lstSplit2.ToArray()); } } return; } /// long[][] if (field.FieldType == typeof(long[][])) { if (hash[fieldName] == "#" || string.IsNullOrEmpty(hash[fieldName])) { field.SetValue(obj, new long[0][]); } else { //先看是不是用#作分割 string[] arrSplit1 = hash[fieldName].Split("#".ToCharArray()); if (null != arrSplit1) { List <long[]> lstSplit2 = new List <long[]>(); for (int i = 0; i < arrSplit1.Length; i++) { //空的就不做考虑 if (string.IsNullOrEmpty(arrSplit1[i])) { continue; } //再分 string[] arrTemp = arrSplit1[i].Split("|".ToCharArray()); long[] arrLong = new long[arrTemp.Length]; for (int j = 0; j < arrTemp.Length; j++) { long.TryParse(arrTemp[j], out arrLong[j]); } lstSplit2.Add(arrLong); } if (lstSplit2.Count > 0) { //二维数组赋给二维数组 field.SetValue(obj, lstSplit2.ToArray()); } } } return; } /// float[][] if (field.FieldType == typeof(float[][])) { if (hash[fieldName] == "#" || string.IsNullOrEmpty(hash[fieldName])) { field.SetValue(obj, new float[0][]); } else { //先看是不是用#作分割 string[] arrSplit1 = hash[fieldName].Split("#".ToCharArray()); if (null != arrSplit1) { List <float[]> lstSplit2 = new List <float[]>(); for (int i = 0; i < arrSplit1.Length; i++) { //空的就不做考虑 if (string.IsNullOrEmpty(arrSplit1[i])) { continue; } //再分 string[] arrTemp = arrSplit1[i].Split("|".ToCharArray()); float[] arrLong = new float[arrTemp.Length]; for (int j = 0; j < arrTemp.Length; j++) { float.TryParse(arrTemp[j], out arrLong[j]); } lstSplit2.Add(arrLong); } if (lstSplit2.Count > 0) { //二维数组赋给二维数组 field.SetValue(obj, lstSplit2.ToArray()); } } } return; } /// long[] 获得数组 if (field.FieldType == typeof(long[])) { if (hash[fieldName] == "#" || string.IsNullOrEmpty(hash[fieldName])) { field.SetValue(obj, new long[0]); } else { string[] valS = hash[fieldName].Split("|".ToCharArray()); long[] valL = new long[valS.Length]; for (int i = 0; i < valS.Length; i++) { if (!string.IsNullOrEmpty(valS[i])) { valL[i] = long.Parse(valS[i]); } } field.SetValue(obj, valL); } return; } /// float[] 获得数组 if (field.FieldType == typeof(float[])) { if (hash[fieldName] == "#" || string.IsNullOrEmpty(hash[fieldName])) { field.SetValue(obj, new float[0]); } else { string[] valS = hash[fieldName].Split("|".ToCharArray()); float[] valL = new float[valS.Length]; for (int i = 0; i < valS.Length; i++) { float.TryParse(valS[i], out valL[i]); } field.SetValue(obj, valL); } return; } //如果不是二维数组,直接存起来 if (field.FieldType == typeof(string[])) { if (hash[fieldName] == null || hash[fieldName] == "" || hash[fieldName] == "#") { field.SetValue(obj, null); } else { field.SetValue(obj, hash[fieldName].Split("|".ToCharArray())); } return; } if (field.FieldType == typeof(bool)) { field.SetValue(obj, hash[fieldName] == "1"); return; } if (field.FieldType == typeof(long)) { if (hash[fieldName] == "#" || string.IsNullOrEmpty(hash[fieldName])) { field.SetValue(obj, (long)0); } else { field.SetValue(obj, long.Parse(hash[fieldName])); } return; } if (field.FieldType == typeof(ulong)) { if (hash[fieldName] == "#" || string.IsNullOrEmpty(hash[fieldName])) { field.SetValue(obj, (ulong)0); } else { field.SetValue(obj, ulong.Parse(hash[fieldName])); } return; } if (field.FieldType == typeof(int)) { if (hash[fieldName] == "#" || string.IsNullOrEmpty(hash[fieldName])) { field.SetValue(obj, 0); } else { field.SetValue(obj, int.Parse(hash[fieldName])); } return; } if (field.FieldType == typeof(float)) { if (hash[fieldName] == "#" || string.IsNullOrEmpty(hash[fieldName])) { field.SetValue(obj, 0f); } else { field.SetValue(obj, float.Parse(hash[fieldName])); } return; } /// 优化内存 field.SetValue(obj, string.Intern(hash[fieldName])); //.Replace("\\n", "\n" } catch { //Debug.LogError(se.ToString()); if (hash.ContainsKey("ID")) { UtilLog.LogWarning(string.Format("UtilCsvReader Set Value Error : {0}.{1} = {2}, ID = {3}", obj.GetType().Name, fieldName, hash[fieldName], hash["ID"])); } else { UtilLog.LogWarning(string.Format("UtilCsvReader Set Value Error : {0}.{1} = {2}", obj.GetType().Name, fieldName, hash[fieldName])); } } }
/// <summary> /// 检验报告单列表 /// </summary> /// <param name="name">姓名</param> /// <param name="idcardno">身份证号</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_InspectionReportList(string name, string idcardno, out ArrayList values, out string msg) { string _oracleConStr = WebConfigParameter.ConnectionHisString; string _sqlConStr = WebConfigParameter.ConnectionLisString; values = new ArrayList(); OracleConnection oracleConnection = new OracleConnection(_oracleConStr); SqlConnection sqlConnection = new SqlConnection(_sqlConStr); OracleDataReader dr = null; SqlDataReader myReader = null; try { bool _flag = false; string sqlstr = ""; string oraclestr = ""; _builder.GetInspectionReportList(name, idcardno, out sqlstr, out oraclestr, out _flag, out msg); if (!_flag) { return(10); } int ret = -1; msg = ""; if (!string.IsNullOrEmpty(_sqlConStr)) { myReader = DbHelperSQL.ExecuteReader(sqlstr, sqlConnection); if (null != myReader && myReader.HasRows) { while (myReader.Read()) { AlipayReportList ri = new AlipayReportList(); ri.doctadviseno = !myReader.IsDBNull(0) ? myReader.GetString(0) : ""; ri.examinaim = !myReader.IsDBNull(1) ? myReader.GetString(1) : ""; ri.requesttime = !myReader.IsDBNull(2) ? myReader.GetDateTime(2).ToString(AppUtils.DateTime_Format_All) : ""; ri.requester = !myReader.IsDBNull(3) ? myReader.GetString(3) : ""; values.Add(ri); } } } dr = DbHelperOra.ExecuteReader(oraclestr, oracleConnection); if (null != dr && dr.HasRows) { while (dr.Read()) { AlipayReportList ri = new AlipayReportList(); ri.doctadviseno = !dr.IsDBNull(0) ? dr.GetString(0) : ""; ri.examinaim = !dr.IsDBNull(1) ? dr.GetString(1) : ""; ri.requesttime = !dr.IsDBNull(2) ? dr.GetDateTime(2).ToString(AppUtils.DateTime_Format_All) : ""; ri.requester = !dr.IsDBNull(3) ? dr.GetString(3) : ""; values.Add(ri); } } if (values.Count > 0) { ret = 0; } else { values = null; msg = "未能找到报告单"; ret = 17; } return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); values = null; msg = GetExceptionInfo(ex); return(AppUtils.Default_Exception_Code); } finally { if (null != dr) { dr.Close(); } if (null != myReader) { myReader.Close(); } oracleConnection.Close(); sqlConnection.Close(); } }
// public static MvcHtmlString buildField(this HtmlHelper html, ConfiguracaoAssociadoCampo OCampo, bool flagConfiguracao = false) { MvcHtmlString campoHTML = new MvcHtmlString(""); try { if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.SELECT_FIXO) { campoHTML = dropdown(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.SELECT_DINAMICO) { campoHTML = dropdown(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.TEXTO_SIMPLES) { campoHTML = inputText(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.EMAIL) { campoHTML = inputText(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.PASSWORD) { campoHTML = inputText(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.NUMERO_INTEIRO) { campoHTML = inputText(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.TEXTO_MULTI_LINHA) { campoHTML = textarea(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.FILE) { campoHTML = inputFile(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.HIDDEN && !flagConfiguracao) { campoHTML = inputHidden(html, OCampo); return(campoHTML); } if (OCampo.idTipoCampo == ConfiguracaoTipoCampoConst.HIDDEN && flagConfiguracao) { campoHTML = inputText(html, OCampo); return(campoHTML); } } catch (Exception ex) { UtilLog.saveError(ex, $"Erro ao criar o campo {OCampo.name}"); string msgErro = UtilConfig.emProducao() ? "Campo não exibido" : $"<span>Erro ao criar o campo {OCampo.name}</span>"; campoHTML = new MvcHtmlString(msgErro); } return(campoHTML); }
/// <summary> /// 化验报告单列表 /// </summary> /// <param name="name">姓名</param> /// <param name="idcardno">身份证号</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_AilpayQueryReport(string name, string idcardno, out ArrayList values, out string msg) { string _oracleConStr = WebConfigParameter.ConnectionHisString; values = new ArrayList(); OracleConnection connection = new OracleConnection(_oracleConStr); OracleDataReader dr = null; try { bool _flag = false; string sql = _builder.GetSqlAilpayReportList(name, idcardno, out _flag, out msg); UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, sql); if (!_flag) { return(10); } int ret = -1; msg = ""; dr = DbHelperOra.ExecuteReader(sql, connection); if (null != dr && dr.HasRows) { while (dr.Read()) { AlipayReportList ri = new AlipayReportList(); ri.doctadviseno = !dr.IsDBNull(0) ? Convert.ToString(dr.GetInt64(0)) : ""; ri.examinaim = !dr.IsDBNull(1) ? dr.GetString(1) : ""; ri.requesttime = !dr.IsDBNull(2) ? dr.GetDateTime(2).ToString(AppUtils.DateTime_Format_All) : ""; ri.requester = !dr.IsDBNull(3) ? dr.GetString(3) : ""; values.Add(ri); } ret = 0; } else { values = null; msg = "未能找到报告单"; ret = 17; } return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); values = null; msg = GetExceptionInfo(ex); return(AppUtils.Default_Exception_Code); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
/// <summary> /// 根据条形码或者报告单号报告明细 /// </summary> /// <param name="code">条形码或者报告单号</param> /// <param name="lx">号码类型 1:报告单号 2条码查询</param> /// <param name="values">报告信息</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_queryReportJCListByCode(string code, string lx, string brxm, out ArrayList values, out string msg) { OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; values = new ArrayList(); try { bool _flag = false; string sql = _builder.GetSqlReportJCDetail(code, lx, brxm, out _flag, out msg); if (!_flag) { return(10); } int ret = -99; msg = ""; dr = DbHelperOra.ExecuteReader(sql, connection); if (dr.HasRows) { while (dr.Read()) { ReportInfo ri = new ReportInfo(); ri.bgdh = !dr.IsDBNull(0) ? dr.GetString(0) : ""; ri.sjmd = !dr.IsDBNull(1) ? dr.GetString(1) : ""; ri.cjsj = !dr.IsDBNull(2) ? dr.GetString(2) : ""; ri.sjr = !dr.IsDBNull(3) ? dr.GetString(3) : ""; ri.jysj = !dr.IsDBNull(4) ? dr.GetString(4) : ""; ri.jyr = !dr.IsDBNull(5) ? dr.GetString(5) : ""; ri.shr = !dr.IsDBNull(6) ? dr.GetString(6) : ""; ri.jzch = !dr.IsDBNull(7) ? dr.GetString(7) : ""; ri.zdjg = !dr.IsDBNull(8) ? dr.GetString(8) : ""; ri.bbmc = !dr.IsDBNull(9) ? dr.GetString(9) : ""; ri.mzbz = !dr.IsDBNull(10) ? dr.GetString(10) : ""; ri.dyjb = !dr.IsDBNull(11) ? dr.GetString(11) : ""; ri.bz = !dr.IsDBNull(12) ? dr.GetString(12) : ""; ri.hzbh = !dr.IsDBNull(13) ? dr.GetString(13) : ""; ri.sbm = !dr.IsDBNull(14) ? dr.GetString(14) : ""; ri.brxm = !dr.IsDBNull(15) ? dr.GetString(15) : ""; ri.jgmc = WebConfigParameter.HospitalChinaName(); ICollection <ReportDetail> rds; string child_msg; int rtDetail = DB_queryReportJCDetail(ri.bgdh, out rds, out child_msg); if (rtDetail == 0) { ri.details = rds; } else { msg += "[单号" + ri.bgdh + "详细查询错误]" + child_msg + ";"; ret = 3; } values.Add(ri); } ret = 0; } else { values = null; msg = "未能找到该编号的报告单,请检查编号"; ret = 2; } return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); values = null; msg = GetExceptionInfo(ex); return(AppUtils.Default_Exception_Code); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
/// <summary> /// 一个检验报告单抬头信息 /// </summary> /// <param name="doctadviseno">条码号</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_InspectionReportNameInformation(string doctadviseno, out AlipayReportInfo alipayReportInfo, out string msg) { msg = ""; alipayReportInfo = new AlipayReportInfo(); OracleConnection oracleConnection = new OracleConnection(WebConfigParameter.ConnectionHisString); SqlConnection sqlConnection = new SqlConnection(WebConfigParameter.ConnectionLisString); OracleDataReader dr = null; SqlDataReader myReader = null; int ret = -1; try { bool _flag = false; string sqlstr = ""; string oraclestr = ""; _builder.GetInspectionReportNameInformation(doctadviseno, out sqlstr, out oraclestr, out _flag, out msg); UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, sqlstr); UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, oraclestr); if (!_flag) { return(10); } msg = ""; dr = DbHelperOra.ExecuteReader(oraclestr, oracleConnection); if (null != dr && dr.HasRows) { if (dr.Read()) { alipayReportInfo.doctadviseno = !dr.IsDBNull(0) ? dr.GetString(0) : ""; alipayReportInfo.requesttime = !dr.IsDBNull(1) ? dr.GetDateTime(1).ToString(AppUtils.DateTime_Format_All) : ""; alipayReportInfo.requester = !dr.IsDBNull(2) ? dr.GetString(2) : ""; alipayReportInfo.executetime = !dr.IsDBNull(3) ? dr.GetDateTime(3).ToString(AppUtils.DateTime_Format_All) : ""; alipayReportInfo.executer = !dr.IsDBNull(4) ? dr.GetString(4) : ""; alipayReportInfo.receivetime = !dr.IsDBNull(5) ? dr.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : ""; alipayReportInfo.receiver = !dr.IsDBNull(6) ? dr.GetString(6) : ""; alipayReportInfo.stayhospitalmode = !dr.IsDBNull(7) ? dr.GetString(7) : ""; alipayReportInfo.patientid = !dr.IsDBNull(8) ? dr.GetString(8) : ""; alipayReportInfo.section = !dr.IsDBNull(9) ? dr.GetString(9) : ""; alipayReportInfo.bedno = !dr.IsDBNull(10) ? dr.GetString(10) : ""; alipayReportInfo.patientname = !dr.IsDBNull(11) ? dr.GetString(11) : ""; alipayReportInfo.sex = !dr.IsDBNull(12) ? dr.GetString(12) : ""; alipayReportInfo.age = !dr.IsDBNull(13) ? dr.GetString(13) : ""; alipayReportInfo.diagnostic = !dr.IsDBNull(14) ? dr.GetString(14) : ""; alipayReportInfo.sampletype = !dr.IsDBNull(15) ? dr.GetString(15) : ""; alipayReportInfo.examinaim = !dr.IsDBNull(16) ? dr.GetString(16) : ""; alipayReportInfo.requestmode = !dr.IsDBNull(17) ? dr.GetString(17) : ""; alipayReportInfo.checker = !dr.IsDBNull(18) ? dr.GetString(18) : ""; alipayReportInfo.checktime = !dr.IsDBNull(19) ? dr.GetDateTime(19).ToString(AppUtils.DateTime_Format_All) : ""; alipayReportInfo.csyq = !dr.IsDBNull(20) ? dr.GetString(20) : ""; alipayReportInfo.profiletest = !dr.IsDBNull(21) ? dr.GetString(21) : ""; ret = 0; } return(ret); } if (!string.IsNullOrEmpty(WebConfigParameter.ConnectionLisString)) { myReader = DbHelperSQL.ExecuteReader(sqlstr, sqlConnection); if (null != myReader && myReader.HasRows) { if (myReader.Read()) { alipayReportInfo.doctadviseno = !myReader.IsDBNull(0) ? myReader.GetString(0) : ""; alipayReportInfo.requesttime = !myReader.IsDBNull(1) ? myReader.GetDateTime(1).ToString(AppUtils.DateTime_Format_All) : ""; alipayReportInfo.requester = !myReader.IsDBNull(2) ? myReader.GetString(2) : ""; alipayReportInfo.executetime = !myReader.IsDBNull(3) ? myReader.GetDateTime(3).ToString(AppUtils.DateTime_Format_All) : ""; alipayReportInfo.executer = !myReader.IsDBNull(4) ? myReader.GetString(4) : ""; alipayReportInfo.receivetime = !myReader.IsDBNull(5) ? myReader.GetDateTime(5).ToString(AppUtils.DateTime_Format_All) : ""; alipayReportInfo.receiver = !myReader.IsDBNull(6) ? myReader.GetString(6) : ""; alipayReportInfo.stayhospitalmode = !myReader.IsDBNull(7) ? myReader.GetString(7) : ""; alipayReportInfo.patientid = !myReader.IsDBNull(8) ? myReader.GetString(8) : ""; alipayReportInfo.section = !myReader.IsDBNull(9) ? myReader.GetString(9) : ""; alipayReportInfo.bedno = !myReader.IsDBNull(10) ? myReader.GetString(10) : ""; alipayReportInfo.patientname = !myReader.IsDBNull(11) ? myReader.GetString(11) : ""; alipayReportInfo.sex = !myReader.IsDBNull(12) ? Convert.ToString(myReader.GetInt32(12)) : ""; if (alipayReportInfo.sex == "1") { alipayReportInfo.sex = "男"; } else if (alipayReportInfo.sex == "2") { alipayReportInfo.sex = "女"; } alipayReportInfo.age = !myReader.IsDBNull(13) ? Convert.ToString(myReader.GetDouble(13)) : ""; alipayReportInfo.diagnostic = !myReader.IsDBNull(14) ? myReader.GetString(14) : ""; alipayReportInfo.sampletype = !myReader.IsDBNull(15) ? myReader.GetString(15) : ""; alipayReportInfo.examinaim = !myReader.IsDBNull(16) ? myReader.GetString(16) : ""; alipayReportInfo.requestmode = !myReader.IsDBNull(17) ? myReader.GetString(17) : ""; alipayReportInfo.checker = !myReader.IsDBNull(18) ? myReader.GetString(18) : ""; alipayReportInfo.checktime = !myReader.IsDBNull(19) ? myReader.GetDateTime(19).ToString(AppUtils.DateTime_Format_All) : ""; alipayReportInfo.csyq = !myReader.IsDBNull(20) ? myReader.GetString(20) : ""; alipayReportInfo.profiletest = !myReader.IsDBNull(21) ? myReader.GetString(21) : ""; ret = 0; } } } else { msg = "未能找到报告单"; ret = 17; } return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); msg = GetExceptionInfo(ex); return(AppUtils.Default_Exception_Code); } finally { if (null != dr) { dr.Close(); } if (null != myReader) { myReader.Close(); } oracleConnection.Close(); sqlConnection.Close(); } }
/// <summary> /// 查询报告单列表(根据病人ID) /// </summary> /// <param name="brid">病人ID</param> /// <param name="brlx">病人类型 1:门诊病人 2:住院病人</param> /// <param name="values">报告单信息</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_queryReportJCListByBRID(string brid, string brlx, out ArrayList values, out string msg) { OracleConnection connection = new OracleConnection(WebConfigParameter.ConnectionHisString); OracleDataReader dr = null; values = new ArrayList(); try { bool _flag = false; string sql = _builder.GetSqlReportJCListForWzscnxdyrmyy(brid, brlx, out _flag, out msg); if (!_flag) { return(10); } int ret = -1; msg = ""; dr = DbHelperOra.ExecuteReader(sql, connection); if (dr.HasRows) { while (dr.Read()) { ReportInfo ri = new ReportInfo(); ri.bgdh = !dr.IsDBNull(0) ? dr.GetString(0) : ""; ri.sjmd = !dr.IsDBNull(1) ? dr.GetString(1) : ""; ri.jysj = !dr.IsDBNull(2) ? dr.GetString(2) : ""; ri.jgmc = WebConfigParameter.HospitalChinaName(); values.Add(ri); } ret = 0; } else { values = null; msg = "未能找到报告单"; ret = 2; } return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); values = null; msg = GetExceptionInfo(ex); return(AppUtils.Default_Exception_Code); } finally { if (null != dr) { dr.Close(); } connection.Close(); } }
/// <summary> /// 一个检验报告单详细列表信息 /// </summary> /// <param name="doctadviseno">条码号</param> /// <param name="msg">出错信息</param> /// <returns>0:成功 大于0:出错 小于0:异常</returns> public int DB_InspectionReportResultsInformation(string doctadviseno, out AlipayInspectionReport alipayInspectionReport, out string msg) { msg = ""; alipayInspectionReport = new AlipayInspectionReport(); OracleConnection oracleConnection = new OracleConnection(WebConfigParameter.ConnectionHisString); SqlConnection sqlConnection = new SqlConnection(WebConfigParameter.ConnectionLisString); OracleDataReader dr = null; SqlDataReader myReader = null; int ret = -1; try { bool _flag = false; string sqlstr = ""; string oraclestr = ""; _builder.GetDInspectionReportResultsInformation(doctadviseno, out sqlstr, out oraclestr, out _flag, out msg); UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, sqlstr); UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, oraclestr); if (!_flag) { return(10); } msg = ""; dr = DbHelperOra.ExecuteReader(oraclestr, oracleConnection); if (null != dr && dr.HasRows) { if (dr.Read()) { alipayInspectionReport.studyresult = !dr.IsDBNull(0) ? dr.GetString(0) : ""; alipayInspectionReport.diagresult = !dr.IsDBNull(1) ? dr.GetString(1) : ""; ret = 0; } return(ret); } if (!string.IsNullOrEmpty(WebConfigParameter.ConnectionLisString)) { myReader = DbHelperSQL.ExecuteReader(sqlstr, sqlConnection); if (null != myReader && myReader.HasRows) { if (myReader.Read()) { alipayInspectionReport.studyresult = !myReader.IsDBNull(0) ? myReader.GetString(0) : ""; alipayInspectionReport.diagresult = !myReader.IsDBNull(1) ? myReader.GetString(1) : ""; ret = 0; } } } else { msg = "未能找到报告单"; ret = 17; } return(ret); } catch (Exception ex) { UtilLog.GetInstance().WriteProgramLog(System.Reflection.MethodBase.GetCurrentMethod().Name, ex); msg = GetExceptionInfo(ex); return(AppUtils.Default_Exception_Code); } finally { if (null != dr) { dr.Close(); } if (null != myReader) { myReader.Close(); } oracleConnection.Close(); sqlConnection.Close(); oracleConnection.Close(); sqlConnection.Close(); } }