public static string RecordCarPlate(string plate, string reason) { var pattern = @"([京津晋冀蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼渝川贵云藏陕甘青宁新][ABCDEFGHJKLMNPQRSTUVWXY][1-9DF][1-9ABCDEFGHJKLMNPQRSTUVWXYZ]\d{3}[1-9DF]|[京津晋冀蒙辽吉黑沪苏浙皖闽赣鲁豫鄂湘粤桂琼渝川贵云藏陕甘青宁新][ABCDEFGHJKLMNPQRSTUVWXY][\dABCDEFGHJKLNMxPQRSTUVWXYZ]{5})"; var ret = ""; LogHelper.Info($"Plate -> {plate} Reason -> {reason}"); plate = plate.Replace(" ", "").Replace(".", "").Replace("。", ""); if (Regex.IsMatch(plate, pattern)) { var business = new UtilityDAL(); var id = business.RecordCarPlate(plate, reason); var record = business.GetRecordCarPlate(id); ret = record.ToString(); } else { ret = "无效的车牌号"; } return(ret); }
/// <summary> /// 2113 通过身份证号, 获取病人的就诊卡信息 /// </summary> /// <param name="docRequestPre"></param> /// <param name="outParm"></param> /// <returns></returns> public int GetSickCardByIdCard2113(XmlDocument docRequestPre, out string outParm) { outParm = ""; try { using (OracleConnection dbCon = OracleConnect.Connect()) { OracleTransaction dbTran = dbCon.BeginTransaction(); CreateDBTransaction(dbCon, dbTran); try { PreXuanchengCityDal ruralResiDal = new PreXuanchengCityDal(); ruralResiDal.GetSickCardByIdCard2113(docRequestPre, out outParm); dbTran.Commit(); } catch (Exception ex) { dbTran.Rollback(); throw ex; } } } catch (Exception ex) { UtilityDAL initXmlDoc = new UtilityDAL(); XmlDocument docResponse = initXmlDoc.GetResponseXmlDoc(); XmlNode ndResponse = docResponse.SelectSingleNode("Response"); ndResponse.SelectSingleNode("TradeCode").InnerText = "2108"; ndResponse.SelectSingleNode("ResultCode").InnerText = "0004"; ndResponse.SelectSingleNode("ResultContent").InnerText = ex.Message; outParm = docResponse.OuterXml; return(-1); } return(0); }
public int ReportStatusInfo(string hisAppid, string affirmMan, string affirmDate, string status, out string outParm) { UtilityDAL utilityDAL = new UtilityDAL(); string applyNo; //long itemSequence; DateTime intetAffirmDate; intetAffirmDate = affirmDate.To <DateTime>(); applyNo = hisAppid.Substring(0, hisAppid.IndexOf('|')); outParm = ""; StringBuilder sql = new StringBuilder(); try { sql.Clear(); sql.Append(@"update apply_sheet set interface_affirm_flag = :arg_flag, interface_affirm_man = :arg_man, interface_affirm_date = :arg_date where apply_no =:arg_apply_no"); OracleParameter[] paraUpdateApplySheet = { new OracleParameter("arg_apply_no", applyNo), new OracleParameter("arg_flag", status), new OracleParameter("arg_man", affirmMan), new OracleParameter("arg_date", intetAffirmDate) }; Insert(sql.ToString(), paraUpdateApplySheet); sql.Clear(); sql.Append(@"update Apply_Sheet_Pool set interface_affirm_flag = :arg_flag, interface_affirm_man = :arg_man, interface_affirm_date = :arg_date where apply_no =:arg_apply_no"); OracleParameter[] paraUpdateApplySheetPool = { new OracleParameter("arg_apply_no", applyNo), new OracleParameter("arg_flag", status), new OracleParameter("arg_man", affirmMan), new OracleParameter("arg_date", intetAffirmDate) }; Insert(sql.ToString(), paraUpdateApplySheetPool); } catch (Exception ex) { Log4NetHelper.Error("RIS系统的报告信息返回", ex); return(-1); } return(0); }
public DataSet BindFilterOperators() { try { UtilityDAL obj = new UtilityDAL(); DataSet ds = new DataSet(); ds = obj.GetFilterConditions(); return(ds); } catch (Exception ex) { throw ex; } }
public static void LoadCheckBoxListByCurrencyID(CheckBoxList oCheckBoxList, string sCurrencyID) { UtilityDAL oUtilityDAL = new UtilityDAL(); Result oResult = new Result(); oResult = oUtilityDAL.GetSPTypeListByCurrecyID(sCurrencyID); if (oResult.Status) { DataTable dtGetAll = (DataTable)oResult.Return; oCheckBoxList.Items.Clear(); for (int i = 0; i < dtGetAll.Rows.Count; i++) { Add(oCheckBoxList, dtGetAll.Rows[i]["Text"].ToString().Trim(), dtGetAll.Rows[i]["Value"].ToString().Trim()); } } }
public static void LoadCheckBoxListFromDB(CheckBoxList oCheckBoxList, string sValue, string sText, string sTable) { UtilityDAL oUtilityDAL = new UtilityDAL(); Result oResult = new Result(); oResult = oUtilityDAL.GetDDLDataList(sValue, sText, sTable, false); if (oResult.Status) { DataTable dtGetAll = (DataTable)oResult.Return; oCheckBoxList.Items.Clear(); for (int i = 0; i < dtGetAll.Rows.Count; i++) { Add(oCheckBoxList, dtGetAll.Rows[i]["Text"].ToString().Trim(), dtGetAll.Rows[i]["Value"].ToString().Trim()); } } }
public static void LoadActiveUser(DropDownList oDDList, string sValue, string sText, string sTable, int iMakerGroupID, bool isFormat, string sDivisionID) { UtilityDAL oUtilityDAL = new UtilityDAL(); Result oResult = new Result(); oResult = oUtilityDAL.GetActiveUserListByGroupID(sValue, sText, sTable, iMakerGroupID, isFormat, sDivisionID); if (oResult.Status) { DataTable dtGetAll = (DataTable)oResult.Return; oDDList.Items.Clear(); Add(oDDList, "", ""); for (int i = 0; i < dtGetAll.Rows.Count; i++) { Add(oDDList, dtGetAll.Rows[i]["Text"].ToString().Trim(), dtGetAll.Rows[i]["Value"].ToString().Trim()); } } }
public static void LoadDDLFromDB(DropDownList oDDList, string sValue, string sText, string sTable, bool isFormat) { UtilityDAL oUtilityDAL = new UtilityDAL(); Result oResult = new Result(); oResult = oUtilityDAL.GetDDLDataList(sValue, sText, sTable, isFormat); if (oResult.Status) { DataTable dtGetAll = (DataTable)oResult.Return; oDDList.Items.Clear(); Add(oDDList, "", ""); for (int i = 0; i < dtGetAll.Rows.Count; i++) { Add(oDDList, dtGetAll.Rows[i]["Text"].ToString().Trim(), dtGetAll.Rows[i]["Value"].ToString().Trim()); } } }
public int UpdateInsurTradeLog(string tradeNo, string status) { StringBuilder sql = new StringBuilder(); UtilityDAL utilityDAL = new UtilityDAL(); sql.Clear(); sql.Append(@" update insur_trade_log set status = :arg_status where trade_no = :arg_trade_no"); using (OracleConnection con = OracleConnect.Connect()) { if (con.State != ConnectionState.Open) { con.Open(); } OracleCommand orcCmd = new OracleCommand(); orcCmd.Connection = con; OracleTransaction orcTr = con.BeginTransaction(); orcCmd.Transaction = orcTr; try { orcCmd.CommandText = sql.ToString(); OracleParameter[] parInTradeLog = { new OracleParameter("arg_trade_no", tradeNo), new OracleParameter("arg_status", status) }; orcCmd.Parameters.AddRange(parInTradeLog); orcCmd.ExecuteNonQuery(); orcTr.Commit(); return(0); } catch (Exception ex) { orcTr.Rollback(); con.Close(); Log4NetHelper.Error("生成银行交易日志", ex); return(-1); } } }
public void BindFilterOperators(DropDownList ddl) { try { ddl.Items.Clear(); //ddl.Items.Add(new ListItem("Equals", "=")); //ddl.Items.Add(new ListItem("GreaterThanOrEqualTo", ">=")); //ddl.Items.Add(new ListItem("LessThanOrEqualTo", "<=")); //ddl.Items.Add(new ListItem("Between", ">= and <=")); //ddl.Items.Add(new ListItem("IsGreaterThan", ">")); //ddl.Items.Add(new ListItem("IsLessthan", "<")); //ddl.Items.Add(new ListItem("NotEqualTo", "!=")); //ddl.Items.Add(new ListItem("IsEmpty", "IS NULL")); //ddl.Items.Add(new ListItem("IsNotEmpty", "IS NOT NULL")); UtilityDAL obj = new UtilityDAL(); DataSet ds = new DataSet(); ds = obj.GetFilterConditions(); if (ds.Tables.Count > 0) { ddl.DataSource = ds.Tables[0]; ddl.DataTextField = ds.Tables[0].Columns["CondText"].ToString(); ddl.DataValueField = ds.Tables[0].Columns["CondSymbol"].ToString(); ddl.DataBind(); } } catch (Exception ex) { throw ex; } }
public static void AddException(string pageUrl, string loginID, string exMsg, string exTrace) //, int productTypeId, int estimateId) { UtilityDAL obj = new UtilityDAL(); obj.AddException(pageUrl, loginID, exMsg, exTrace); }
public void SetPolicyDetails(SPPolicy oSPPolicy) { // Dropdown load SPType DDListUtil.LoadDDLFromDB(ddlSPType, "SPTypeID", "TypeDesc", "SPMS_SPType", true); DDListUtil.LoadDDLFromXML(ddlApplicableSex, "ApplicableSex", "Type", "Sex", true); // gvCustomerType load 6. Eligibility UtilityDAL oUtilityDAL = new UtilityDAL(); Result oResult = new Result(); oResult = oUtilityDAL.GetDDLDataList("CustomerTypeID", "TypeDesc", "SPMS_CustomerType", true); if (oResult.Status) { DataTable dtGetAll = (DataTable)oResult.Return; gvCustomerType.DataSource = dtGetAll; gvCustomerType.DataBind(); gvCustomerType.Enabled = false; GridViewRowCollection growArr = (GridViewRowCollection)gvCustomerType.Rows; foreach (GridViewRow row in growArr) { row.Cells[1].Visible = false; } } else { gvCustomerType.DataSource = false; gvCustomerType.DataBind(); } // common DDListUtil.Assign(ddlSPType, oSPPolicy.SPType.SPTypeID); ddlSPType.Enabled = false; txtEffectiveDate.Text = oSPPolicy.PolicyEffectDate.ToString(Constants.DATETIME_FORMAT); txtEffectiveDate.Enabled = false; // 1.0 General Util.SetRadioData(rblIsSPDurationInMonth, oSPPolicy.IsSPDurationInMonth); rblIsSPDurationInMonth.Enabled = false; Util.RBLChangeSetColor(rblIsSPDurationInMonth); rblIsSPDurationInMonth.Enabled = false; txtDuration.Text = oSPPolicy.SPDuration.ToString(); txtDuration.Enabled = false; txtNoOfCoupon.Text = oSPPolicy.NoOfCoupons.ToString(); txtNoOfCoupon.Enabled = false; DDListUtil.Assign(ddlIntrType, oSPPolicy.SPInterestType); ddlIntrType.Enabled = false; Util.SetRadioData(rblInterestTypeAfterIntPayment, oSPPolicy.InterestTypeAfterIntPayment); Util.RBLChangeSetColor(rblInterestTypeAfterIntPayment); rblInterestTypeAfterIntPayment.Enabled = false; DDListUtil.Assign(ddlPreMatIntrType, oSPPolicy.PreMaturityInterestType); ddlPreMatIntrType.Enabled = false; Util.SetRadioData(rblGSPreMatIntrClaim, oSPPolicy.PreMatIntTypeAfterIntPayment); rblGSPreMatIntrClaim.Enabled = false; Util.RBLChangeSetColor(rblGSPreMatIntrClaim); Util.SetRadioData(rblIsBondHolderRequired, oSPPolicy.IsBondHolderRequired); Util.RBLChangeSetColor(rblIsBondHolderRequired); rblIsBondHolderRequired.Enabled = false; Util.SetRadioData(rblIsNomineePerScripRequired, oSPPolicy.IsNomineePerScripRequired); Util.RBLChangeSetColor(rblIsNomineePerScripRequired); rblIsNomineePerScripRequired.Enabled = false; Util.SetRadioData(rblIsFoeignAddressRequired, oSPPolicy.IsFoeignAddressRequired); Util.RBLChangeSetColor(rblIsFoeignAddressRequired); rblIsFoeignAddressRequired.Enabled = false; Util.SetRadioData(rblReinvestmentSuported, oSPPolicy.ReinvestmentSuported); Util.RBLChangeSetColor(rblReinvestmentSuported); rblReinvestmentSuported.Enabled = false; Util.SetRadioData(rblInterestReinvestable, oSPPolicy.InterestReinvestable); Util.RBLChangeSetColor(rblInterestReinvestable); rblInterestReinvestable.Enabled = false; txtReinNumber.Text = oSPPolicy.MaxNoOfReinvestment.ToString(); txtReinNumber.Enabled = false; Util.SetRadioData(rblPartiallyEncashable, oSPPolicy.PartiallyEncashable); Util.RBLChangeSetColor(rblPartiallyEncashable); rblPartiallyEncashable.Enabled = false; Util.SetRadioData(rblPartiallyEncashedReinvestable, oSPPolicy.PartiallyEncashedReinvestable); Util.RBLChangeSetColor(rblPartiallyEncashedReinvestable); rblPartiallyEncashedReinvestable.Enabled = false; // 2.0 Currency Setup DataTable oDtCurr = new DataTable("dtDataCurrency"); oDtCurr.Columns.Add(new DataColumn("bfActivityType", typeof(string))); oDtCurr.Columns.Add(new DataColumn("bfCurrency", typeof(string))); DataRow rowCurr = null; for (int i = 0; i < oSPPolicy.CurrencyActivityPolicy.Count; i++) { rowCurr = oDtCurr.NewRow(); rowCurr["bfActivityType"] = oSPPolicy.CurrencyActivityPolicy[i].ActivityTypeID + " : " + oSPPolicy.CurrencyActivityPolicy[i].ActivityTypeValue; rowCurr["bfCurrency"] = oSPPolicy.CurrencyActivityPolicy[i].Currency.CurrencyID + " : " + oSPPolicy.CurrencyActivityPolicy[i].Currency.CurrencyCode; oDtCurr.Rows.Add(rowCurr); } gvActiCurrency.DataSource = oDtCurr; gvActiCurrency.DataBind(); gvActiCurrency.Enabled = false; // 3.0 Early Encashment Setup txtEarlyEncashCouponNo.Text = oSPPolicy.NoOfCoupons.ToString(); txtEarlyEncashCouponNo.Enabled = false; txtCommonIntRate.Enabled = false; chkMaturedCoupon.Enabled = false; DataTable oDtEE = new DataTable("dtDataEE"); oDtEE.Columns.Add(new DataColumn("bfCouponInstallmentNo", typeof(string))); oDtEE.Columns.Add(new DataColumn("bfMonthFrom", typeof(string))); oDtEE.Columns.Add(new DataColumn("bfMonthTo", typeof(string))); oDtEE.Columns.Add(new DataColumn("bfInterestRate", typeof(string))); oDtEE.Columns.Add(new DataColumn("bfNoOfSlabsIntPayable", typeof(string))); DataRow rowEE = null; for (int i = 0; i < oSPPolicy.EarlyEncashmentPolicy.Count; i++) { rowEE = oDtEE.NewRow(); rowEE["bfCouponInstallmentNo"] = oSPPolicy.EarlyEncashmentPolicy[i].SlabNo.ToString(); rowEE["bfMonthFrom"] = oSPPolicy.EarlyEncashmentPolicy[i].MonthFrom.ToString(); rowEE["bfMonthTo"] = oSPPolicy.EarlyEncashmentPolicy[i].MonthTo.ToString(); rowEE["bfInterestRate"] = oSPPolicy.EarlyEncashmentPolicy[i].InterestRate.ToString(); rowEE["bfNoOfSlabsIntPayable"] = oSPPolicy.EarlyEncashmentPolicy[i].NoOfSlabsIntPayable.ToString(); oDtEE.Rows.Add(rowEE); } gvEncashmentIntRate.DataSource = oDtEE; gvEncashmentIntRate.DataBind(); gvEncashmentIntRate.Enabled = false; // 4.0 General Interest Setup txtGeneralIntCouponNo.Text = oSPPolicy.NoOfCoupons.ToString(); txtGeneralIntCouponNo.Enabled = false; txtGIClaimRate.Enabled = false; txtNonclaimIntRate.Enabled = false; DataTable oDtGI = new DataTable("dtDataG"); oDtGI.Columns.Add(new DataColumn("bfCouponInstallmentNo", typeof(string))); oDtGI.Columns.Add(new DataColumn("bfMonthFrom", typeof(string))); oDtGI.Columns.Add(new DataColumn("bfMonthTo", typeof(string))); oDtGI.Columns.Add(new DataColumn("bfClaimRate", typeof(string))); oDtGI.Columns.Add(new DataColumn("bfNonclaimIntRate", typeof(string))); DataRow rowGI = null; for (int i = 0; i < oSPPolicy.GeneralInterestPolicy.Count; i++) { rowGI = oDtGI.NewRow(); rowGI["bfCouponInstallmentNo"] = oSPPolicy.GeneralInterestPolicy[i].SlabNo.ToString(); rowGI["bfMonthFrom"] = oSPPolicy.GeneralInterestPolicy[i].MonthFrom.ToString(); rowGI["bfMonthTo"] = oSPPolicy.GeneralInterestPolicy[i].MonthTo.ToString(); rowGI["bfClaimRate"] = oSPPolicy.GeneralInterestPolicy[i].ClaimRate.ToString(); rowGI["bfNonclaimIntRate"] = oSPPolicy.GeneralInterestPolicy[i].NonClaimRate.ToString(); oDtGI.Rows.Add(rowGI); } gvGeneralInt.DataSource = oDtGI; gvGeneralInt.DataBind(); gvGeneralInt.Enabled = false; // 5.0 Commission Setup txtComSetNonOrgComm.Text = oSPPolicy.NonOrgCommission.ToString(); txtComSetNonOrgComm.Enabled = false; Util.SetRadioData(rblComSetNonOrgChargeOnPer, oSPPolicy.NonOrgCommissionType.Substring(0, oSPPolicy.NonOrgCommissionType.Length > 1 ? 1 : 0)); Util.RBLChangeSetColor(rblComSetNonOrgChargeOnPer); rblComSetNonOrgChargeOnPer.Enabled = false; Util.SetRadioData(rblComSetNonOrgCalculateInt, oSPPolicy.NonOrgCommissionType.Substring(oSPPolicy.NonOrgCommissionType.Length > 1 ? 1 : 0, oSPPolicy.NonOrgCommissionType.Length > 1 ? 1 : 0)); Util.RBLChangeSetColor(rblComSetNonOrgCalculateInt); rblComSetNonOrgCalculateInt.Enabled = false; txtComSetOrgCommission.Text = oSPPolicy.OrgCommission.ToString(); txtComSetOrgCommission.Enabled = false; Util.SetRadioData(rblComSetOrgChargeOnPer, oSPPolicy.OrgCommissionType.Substring(0, oSPPolicy.OrgCommissionType.Length > 1 ? 1 : 0)); Util.RBLChangeSetColor(rblComSetOrgChargeOnPer); rblComSetOrgChargeOnPer.Enabled = false; Util.SetRadioData(rblComSetOrgCalculateInt, oSPPolicy.OrgCommissionType.Substring(oSPPolicy.OrgCommissionType.Length > 1 ? 1 : 0, oSPPolicy.OrgCommissionType.Length > 1 ? 1 : 0)); Util.RBLChangeSetColor(rblComSetOrgCalculateInt); rblComSetOrgCalculateInt.Enabled = false; txtComSetIntRemuneration.Text = oSPPolicy.InterestRemuneration.ToString(); txtComSetIntRemuneration.Enabled = false; Util.SetRadioData(rblComSetIntRemuChargeOnPer, oSPPolicy.InterestRemunerationType.Substring(0, oSPPolicy.InterestRemunerationType.Length > 1 ? 1 : 0)); Util.RBLChangeSetColor(rblComSetIntRemuChargeOnPer); rblComSetIntRemuChargeOnPer.Enabled = false; Util.SetRadioData(rblComSetIntRemuCalculateInt, oSPPolicy.InterestRemunerationType.Substring(oSPPolicy.InterestRemunerationType.Length > 1 ? 1 : 0, oSPPolicy.InterestRemunerationType.Length > 1 ? 1 : 0)); Util.RBLChangeSetColor(rblComSetIntRemuCalculateInt); rblComSetIntRemuCalculateInt.Enabled = false; txtComSetRemuneration.Text = oSPPolicy.Remuneration.ToString(); txtComSetRemuneration.Enabled = false; Util.SetRadioData(rblComSetRemuChargeOnPer, oSPPolicy.RemunerationType.Substring(0, oSPPolicy.RemunerationType.Length > 1 ? 1 : 0)); Util.RBLChangeSetColor(rblComSetRemuChargeOnPer); rblComSetRemuChargeOnPer.Enabled = false; Util.SetRadioData(rblComSetRemuCalculateInt, oSPPolicy.RemunerationType.Substring(oSPPolicy.RemunerationType.Length > 1 ? 1 : 0, oSPPolicy.RemunerationType.Length > 1 ? 1 : 0)); Util.RBLChangeSetColor(rblComSetRemuCalculateInt); rblComSetRemuCalculateInt.Enabled = false; txtComSetLevi.Text = oSPPolicy.Levi.ToString(); txtComSetLevi.Enabled = false; Util.SetRadioData(rblComSetLevi, oSPPolicy.LeviType); Util.RBLChangeSetColor(rblComSetLevi); rblComSetLevi.Enabled = false; txtComSetIncomeTax.Text = oSPPolicy.IncomeTax.ToString(); txtComSetIncomeTax.Enabled = false; Util.SetRadioData(rblComSetIncomeTax, oSPPolicy.IncomeTaxType.ToString()); Util.RBLChangeSetColor(rblComSetIncomeTax); rblComSetIncomeTax.Enabled = false; txtComSetIncomeTaxAbove.Text = oSPPolicy.IncomeTaxApplyAmount.ToString(); txtComSetIncomeTaxAbove.Enabled = false; Util.SetCheckData(chkYearly, oSPPolicy.IncomeTaxYearlyYN); Util.ChkChangeSetColor(chkYearly); chkYearly.Enabled = false; txtSocialSecurityAmount.Text = oSPPolicy.SocialSecurityAmount.ToString(); txtSocialSecurityAmount.Enabled = false; Util.SetRadioData(rblSocialSecurityAmount, oSPPolicy.SocialSecurityAmountType.ToString()); Util.RBLChangeSetColor(rblSocialSecurityAmount); rblSocialSecurityAmount.Enabled = false; // 6.0 Eligibility ArrayList alCTPID = new ArrayList(); if (oSPPolicy.CustomerTypePolicy.Count > 0) { int i = 0; foreach (CustomerTypePolicy oCTP in oSPPolicy.CustomerTypePolicy) { alCTPID.Insert(i, oCTP.CustomerType.CustomerTypeID); i++; } } GridViewRowCollection gvRows = (GridViewRowCollection)gvCustomerType.Rows; foreach (GridViewRow row in gvRows) { CheckBox oCheckBox = (CheckBox)row.FindControl("chkCusomerType"); if (alCTPID.Contains(row.Cells[1].Text)) { oCheckBox.Checked = true; } else { oCheckBox.Checked = false; } } // Eligibility grid.. DataTable oDtEli = new DataTable("dtDataEli"); oDtEli.Columns.Add(new DataColumn("bfCustActiType", typeof(string))); oDtEli.Columns.Add(new DataColumn("bfPayModeType", typeof(string))); DataRow rowEli = null; for (int i = 0; i < oSPPolicy.PaymentPolicy.Count; i++) { rowEli = oDtEli.NewRow(); rowEli["bfCustActiType"] = oSPPolicy.PaymentPolicy[i].ActivityTypeID + " : " + oSPPolicy.PaymentPolicy[i].ActivityTypeValue; rowEli["bfPayModeType"] = oSPPolicy.PaymentPolicy[i].PaymentModeID + " : " + oSPPolicy.PaymentPolicy[i].PaymentModeValue; oDtEli.Rows.Add(rowEli); } gvEliPaymentPolicy.DataSource = oDtEli; gvEliPaymentPolicy.DataBind(); gvEliPaymentPolicy.Enabled = false; // end of Eligibility grid.. DDListUtil.Assign(ddlApplicableSex, oSPPolicy.SupportedSex); ddlApplicableSex.Enabled = false; txtMinimumAge.Text = oSPPolicy.MinimumAge.ToString(); txtMinimumAge.Enabled = false; txtMaximumAge.Text = oSPPolicy.MaximumAge.ToString(); txtMaximumAge.Enabled = false; }
public int ChargeTube(List <string> applyNos, out string errorMsg) { errorMsg = ""; try { UtilityDAL utilityDal = new UtilityDAL(); //libin 20170626 生成试管费用 string itemCode; string itemClass; int visitNumber; string itemid; decimal qty = 0; string reqitemCode = ""; string temp; string reqGroupID; string applyClassCode; string recordNo = ""; //中间表主键 string age; string sickId = ""; //病人id string ioFlag; //门诊住院标志 string residenceNo = ""; //,门诊挂号号 string sickName; //病人姓名 string sex; //性别 string execDept; //执行科室 string chargeName = ""; //收费项目名称 decimal charge = 0; //价格 string patientDept = ""; //病人所在科室 List <string> applyNoReals = new List <string>(); string applyDoctor = ""; //申请医生 if (applyNos.Count == 0) { return(0); //errorMsg = "获取试管费时,传入的单据号为空,请检查!"; //return -1; } itemCode = temp = ""; StringBuilder sql = new StringBuilder(); foreach (string applyNo in applyNos) { sql.Clear(); sql.Append(@"select (a.APPLY_CLASS_CODE) apply_class_code, (item_code) item_code, (item_class) item_class, (visit_number) visit_number, (sick_id) sick_id, (nullah_number) residence_no, (a.apply_doctor) apply_doctor, (a.apply_dept) patient_dept from v_apply_sheet_union a where a.apply_no = :arg_apply_no and rownum =1"); OracleParameter[] parmApplySheet = { new OracleParameter("arg_apply_no", applyNo) }; DataTable dtApplySheet = Select(sql.ToString(), parmApplySheet); if (dtApplySheet.Rows.Count == 0) { continue; } //退费单 不处理 applyClassCode = dtApplySheet.Rows[0]["apply_class_code"].ToString(); temp = dtApplySheet.Rows[0]["item_code"].ToString(); itemClass = dtApplySheet.Rows[0]["item_class"].ToString(); visitNumber = int.Parse(dtApplySheet.Rows[0]["visit_number"].ToString()); sickId = dtApplySheet.Rows[0]["sick_id"].ToString(); residenceNo = dtApplySheet.Rows[0]["residence_no"].ToString(); applyDoctor = dtApplySheet.Rows[0]["apply_doctor"].ToString(); patientDept = dtApplySheet.Rows[0]["patient_dept"].ToString(); if (applyClassCode == "0041") { continue; //退费单 不处理 } if (itemClass != "D") { continue; //检验单才处理 } if (visitNumber > 0) { continue; //只有门诊处理 } //判断是否已经生成过试管费 sql.Clear(); sql.Append(@" select 1 from custom.lis_requestion_tube_temp where apply_no = :arg_apply_no and valid_flag = 'Y'"); OracleParameter[] parmRequestionTube = { new OracleParameter("arg_apply_no", applyNo) }; DataTable dtRequestionTube = Select(sql.ToString(), parmRequestionTube); if (dtRequestionTube.Rows.Count > 0) { continue; } temp = "'" + temp + "'" + ","; itemCode = itemCode + temp; applyNoReals.Add(applyNo); } if (applyNoReals.Count == 0) { return(0); } itemCode = StringExtension.ReplaceLast(itemCode, ",", ""); if (itemCode.IsNull()) { return(0); } if (sickId.IsNull()) { return(0); } sql.Clear(); sql.Append(@" select f.name sick_name,f_get_age(f.sick_id) age,f.sex sex from sick_basic_info f where f.sick_id = :arg_sick_id"); OracleParameter[] paraSickBase = { new OracleParameter("arg_sick_id", sickId) }; DataTable dtSickBase = Select(sql.ToString(), paraSickBase); sickName = dtSickBase.Rows[0]["sick_name"].ToString(); age = dtSickBase.Rows[0]["age"].ToString(); sex = dtSickBase.Rows[0]["sex"].ToString(); ioFlag = "0"; execDept = utilityDal.GetSysParm("lis_fee_exec_dept"); if (execDept.IsNull()) { errorMsg = "请确认lis_fee_exec_dept(试管费执行科室)是否配置正确!"; return(-1); } if (residenceNo.IsNull()) { sql.Clear(); sql.Append(@"select max(to_number(f.nullah_number)) residence_no from dispensary_sick_cure_info f where f.sick_id = :arg_sick_id and cure_dept is not null"); OracleParameter[] parmResidenceNo = { new OracleParameter("arg_sick_id", sickId) }; DataTable dtResidenceNo = Select(sql.ToString(), parmResidenceNo); if (dtResidenceNo.Rows.Count > 0) { residenceNo = dtResidenceNo.Rows[0]["residence_no"].ToString(); } } //优先获取申请科室 if (patientDept.IsNull()) { sql.Clear(); sql.Append(@"select f.cure_dept patient_dept from dispensary_sick_cure_info f where f.nullah_number = :arg_residence_no"); OracleParameter[] parmPatientDept = { new OracleParameter("arg_residence_no", residenceNo) }; DataTable dtPatientDept = Select(sql.ToString(), parmPatientDept); if (dtPatientDept.Rows.Count > 0) { patientDept = dtPatientDept.Rows[0]["patient_dept"].ToString(); } } //连接mssql数据库 DataTable dtReqItemDict; sql.Clear(); sql.Append(@" select distinct Req_GroupID from REQ_ITEM_DICT where HIS_ItemCode in (" + itemCode + ")"); SvrRmlis svrRmlis = new SvrRmlis(); dtReqItemDict = svrRmlis.GetDataTable(sql); if (dtReqItemDict == null) { return(0); } if (dtReqItemDict.Rows.Count == 0) { return(0); } foreach (DataRow drReqItemDict in dtReqItemDict.Rows) { reqGroupID = drReqItemDict["Req_GroupID"].ToString(); qty = 0; if (reqGroupID.IsNull()) { continue; } sql.Clear(); sql.Append(@" select req_itemid itemid,qty qty from HIS_ChargeRuleDetail where ChargeID in (select CHARGE_ID from REQ_GROUP where Req_GroupID = '" + reqGroupID + "')"); DataTable dtChargeRuleDetail = svrRmlis.GetDataTable(sql); if (dtChargeRuleDetail == null) { errorMsg = "查询lis数据库HIS_ChargeRuleDetail失败!"; return(-1); } if (dtChargeRuleDetail.Rows.Count == 0) { continue; } itemid = dtChargeRuleDetail.Rows[0]["itemid"].ToString(); qty = decimal.Parse(dtChargeRuleDetail.Rows[0]["qty"].ToString()); sql.Clear(); sql.Append(@" select req_itemcode reqitemcode from REQ_ITEM_DICT where req_itemid = '" + itemid + "'"); DataTable dtReqItemCode = svrRmlis.GetDataTable(sql); if (dtReqItemCode == null) { errorMsg = "查询lis数据库ls_reqitemcode失败!"; return(-1); } if (dtReqItemCode.Rows.Count == 0) { continue; } reqitemCode = dtReqItemCode.Rows[0]["reqitemcode"].ToString(); sql.Clear(); sql.Append(@"select t.standard_price charge, t.item_name charge_name from clinic_item_dict t where t.item_code = :arg_reqitemcode"); OracleParameter[] paraItemDict = { new OracleParameter("arg_reqitemcode", reqitemCode) }; DataTable dtItemDict = Select(sql.ToString(), paraItemDict); if (dtItemDict.Rows.Count == 0) { continue; } chargeName = dtItemDict.Rows[0]["charge_name"].ToString(); charge = decimal.Parse(dtItemDict.Rows[0]["charge"].ToString()); if (chargeName.IsNull()) { errorMsg = "lis返回管子项目代码为:" + reqitemCode + ",在his诊疗项目中不存在,请检查!"; return(-1); } recordNo = utilityDal.GetSequenceNO("zhiydba.lis_requestion_id").ToString(); //utilityDal.GetSequenceNO(""); if (applyDoctor.IsNull()) { applyDoctor = "system"; } sql.Clear(); sql.Append(@"insert into custom.lis_requestion( record_no , sick_id , io_flag , residence_no, sick_name , sex , age , exec_dept , charge_item_id , charge_name , charge , charge_state , charge_person , charge_num , patient_dept, operation_time) values(:ls_record_no, :ls_sick_id, :ls_io_flag, :ls_residence_no, :ls_sick_name, :ls_sex, :ls_age, :ls_exec_dept, :ls_reqitemcode, :ls_charge_name, :ldc_charge, '0', :ls_apply_doctor, :li_qty, :ls_patient_dept, sysdate)"); OracleParameter[] paraInsRequestion = { new OracleParameter("ls_record_no", recordNo), new OracleParameter("ls_sick_id", sickId), new OracleParameter("ls_io_flag", ioFlag), new OracleParameter("ls_residence_no", residenceNo), new OracleParameter("ls_sick_name", sickName), new OracleParameter("ls_sex", sex), new OracleParameter("ls_age", age), new OracleParameter("ls_exec_dept", execDept), new OracleParameter("ls_reqitemcode", reqitemCode), new OracleParameter("ls_charge_name", chargeName), new OracleParameter("ldc_charge", charge), new OracleParameter("ls_apply_doctor", applyDoctor), new OracleParameter("li_qty", qty), new OracleParameter("ls_patient_dept", patientDept) }; Insert(sql.ToString(), paraInsRequestion); //LisRequisitionCharge(sickId, reqitemCode, recordNo, qty, charge, "0", execDept, // "", applyDoctor, "0", patientDept, sickName, residenceNo); } if (dtReqItemDict.Rows.Count > 0) { if (recordNo.IsNull()) { recordNo = utilityDal.GetSequenceNO("zhiydba.lis_requestion_id").ToString(); } //找最后一条ls_record_no 作为临时表的记录号 sql.Clear(); sql.Append(@" insert into custom.lis_requestion_tube_temp( record_no, apply_no, operator_date, register_dept, register_man, valid_flag) values( :ls_record_no, :arg_apply_no, sysdate, :arg_register_dept, :arg_operator, 'Y' )" ); foreach (string applyNo in applyNoReals) { OracleParameter[] paraInsRequestionTube = { new OracleParameter("ls_record_no", recordNo), new OracleParameter("arg_apply_no", applyNo), new OracleParameter("arg_register_dept", ioFlag), new OracleParameter("arg_operator", residenceNo) }; Insert(sql.ToString(), paraInsRequestionTube); } } else { return(0); } return(2); } catch (Exception ex) { Log4NetHelper.Error("生成试管费用 ", ex); return(-1); } }
public int CreateInsurTradeLog(string sickId, string residenceNo, string operater, string returnText, string deptCode, string insuranceNo, string safetyNo, string insuranceCardNo, string rateType, string registType, out string errorMsg, string tradeType, string businessNo = "", string hisSettleFlag = "", string settleNo = "", string insuranceBillNumber = "", string tradeText = "" ) { string tradeNo; errorMsg = ""; StringBuilder sql = new StringBuilder(); UtilityDAL utilityDAL = new UtilityDAL(); string balanceInterface; sql.Clear(); sql.Append(@"select balance_interface from rate_type_dict where rate_type_code = '" + rateType + "'"); DataTable dtRateType = Select(sql.ToString()); if (dtRateType.Rows.Count == 0) { errorMsg = "所录入费别不在字典中, 请重新录入"; return(-1); } balanceInterface = dtRateType.Rows[0]["balance_interface"].ToString(); tradeNo = utilityDAL.GetSequenceNO("comm.insur_trade_seq").ToString(); sql.Clear(); sql.Append(@" insert into insur_trade_log ( trade_no, residence_no, sick_id, trade_text, trade_type, settle_mode, operator, operation_date, status, business_cycle_no, balance_interface, return_text, return_date, regist_type, insurance_no, safety_no, dept_code, insurance_card_no, settle_no, his_settle_flag, insurance_bill_number ) values ( :arg_trade_no, :arg_residence_no, :arg_sick_id, :arg_trade_text, :arg_trade_type, :arg_settle_mode, :arg_operator, sysdate, '2'/*完成*/, :arg_business_no, :arg_balance_interface/*医保接口类型*/, :arg_return_text, sysdate, :arg_regist_type, :arg_insurance_no, :arg_safety_no, :arg_dept_code, :arg_insurance_card_no, :arg_settle_no, :arg_his_settle_flag, :arg_insurance_bill_number ) "); using (OracleConnection con = OracleConnect.Connect()) { if (con.State != ConnectionState.Open) { con.Open(); } OracleCommand orcCmd = new OracleCommand(); orcCmd.Connection = con; OracleTransaction orcTr = con.BeginTransaction(); orcCmd.Transaction = orcTr; try { orcCmd.CommandText = sql.ToString(); OracleParameter[] parInTradeLog = { new OracleParameter("arg_trade_no", tradeNo), new OracleParameter("arg_sick_id", sickId), new OracleParameter("arg_residence_no", residenceNo), new OracleParameter("arg_trade_text", ""), new OracleParameter("arg_trade_type", tradeType), new OracleParameter("arg_settle_mode", "1"), new OracleParameter("arg_operator", operater), new OracleParameter("arg_business_no", businessNo), new OracleParameter("arg_return_text", returnText), new OracleParameter("arg_regist_type", registType), new OracleParameter("arg_insurance_no", insuranceNo), new OracleParameter("arg_safety_no", safetyNo), new OracleParameter("arg_balance_interface", balanceInterface), new OracleParameter("arg_dept_code", deptCode), new OracleParameter("arg_insurance_card_no", insuranceCardNo), new OracleParameter("arg_settle_no", settleNo), new OracleParameter("arg_his_settle_flag", hisSettleFlag), new OracleParameter("arg_insurance_bill_number", insuranceBillNumber) }; orcCmd.Parameters.AddRange(parInTradeLog); orcCmd.ExecuteNonQuery(); orcTr.Commit(); } catch (Exception ex) { orcTr.Rollback(); con.Close(); errorMsg = ex.Message; Log4NetHelper.Error("生成银行交易日志", ex); return(-1); } } return(0); }