/// <summary> /// 查询,通过 域名 查询 /// </summary> /// <param name="url"></param> /// <returns>对应参数信息</returns> public Bd_Base_Parameters GetParametersByUrl(string url) { Bd_Base_Parameters model = null; try { User_Company uCompany = new PbProject.Logic.Login().GetByURL(url); if (uCompany != null) { List <Bd_Base_Parameters> parametersList = GetParametersListByCpyNo(uCompany.UninCode); if (parametersList != null) { foreach (Bd_Base_Parameters bParameters in parametersList) { if (bParameters.SetName.ToUpper() == "CSSURL") { model = bParameters; break; } } } } } catch (Exception ex) { } return(model); }
private void repFuelListDataBind(string str) { //燃油 Bd_Base_Parameters[] list = baseDataManage.CallMethod("Bd_Base_Parameters", "GetList", null, new object[] { " setname='Base_Oil'" }) as Bd_Base_Parameters[]; if (list.Length > 0) { Bd_Base_Parameters bd_base_parameters = list[0]; string strVal = bd_base_parameters.SetValue; //成人800公里以上/一下 儿童800公里以上/一下 string[] strData = strVal.Split('|'); if (strData.Length == 6) { if (str == "Load") { div_ExceedAdultFee.InnerText = strData[1]; div_LowAdultFee.InnerText = strData[0]; div_ExceedChildFee.InnerText = strData[2]; div_LowChildFee.InnerText = strData[3]; div_StartTime.InnerText = strData[4]; div_EndTime.InnerText = strData[5]; } else { txtExceedAdultFee.Text = strData[1]; txtLowAdultFee.Text = strData[0]; txtExceedChildFee.Text = strData[2]; txtLowChildFee.Text = strData[3]; txtStartDate.Value = strData[4]; txtEndDate.Value = strData[5]; } } } }
/// <summary> /// 显示数据 /// </summary> public void bindData(string id) { //获取 Bd_Base_Parameters bd_base_parameters = baseDataManage.CallMethod("Bd_Base_Parameters", "GetById", null, new object[] { id }) as Bd_Base_Parameters; if (bd_base_parameters != null) { txtCompanyNo.Text = bd_base_parameters.CpyNo; txtParamName.Text = bd_base_parameters.SetName; txtParamValue.Text = bd_base_parameters.SetValue; txtStartDate.Value = bd_base_parameters.StartDate.ToString("yyyy-MM-dd"); txtEndDate.Value = bd_base_parameters.EndDate.ToString("yyyy-MM-dd"); txtParamDescript.Text = bd_base_parameters.SetDescription; txtRemark.Text = bd_base_parameters.Remark; } }
/// <summary> /// 加载 /// </summary> protected void BindGuide() { try { Bd_Base_Parameters mparameter = (baseDataManage.CallMethod("Bd_Base_Parameters", "GetList", null, new Object[] { "CpyNo='" + mCompany.UninCode + "' and SetName='Policy_Order'" }) as List <Bd_Base_Parameters>)[0]; ViewState["id"] = mparameter.id.ToString(); string[] setvalue = mparameter.SetValue.Split('|'); string text = ""; for (int i = 0; i < setvalue.Length; i++) { switch (setvalue[i].ToString()) { case "517": text = "517"; break; case "51book": text = "51book"; break; case "BaiTuo": text = "百拓"; break; case "PiaoMeng": text = "票盟"; break; case "8000Yi": text = "八千翼"; break; case "JinRi": text = "今日"; break; } lboxPlat.Items.Add(new ListItem(text, setvalue[i].ToString())); } } catch (Exception) { throw; } }
//添加 protected void btnAdd_Click(object sender, EventArgs e) { if (IsNull()) { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog('输入数据不能为空!');", true); return; } Bd_Base_Parameters bd_base_parameters = null; //Bd_Base_Parameters[] list = Manage.GetBySQLArray(" setname='Base_Oil'"); Bd_Base_Parameters[] list = baseDataManage.CallMethod("Bd_Base_Parameters", "GetList", null, new object[] { " setname='Base_Oil'" }) as Bd_Base_Parameters[]; if (list.Length > 0) { //修改 bd_base_parameters = list[0]; } else { //添加 bd_base_parameters = new Bd_Base_Parameters(); bd_base_parameters.SetName = "Base_Oil"; } StringBuilder sbVal = new StringBuilder(); sbVal.Append(txtExceedAdultFee.Text.Trim() + "|"); sbVal.Append(txtLowAdultFee.Text.Trim() + "|"); sbVal.Append(txtExceedChildFee.Text.Trim() + "|"); sbVal.Append(txtLowChildFee.Text.Trim() + "|"); sbVal.Append(txtStartDate.Value.Trim() + "|"); sbVal.Append(txtEndDate.Value.Trim() + "|"); bd_base_parameters.SetValue = sbVal.ToString().Trim(new char[] { '|' }); bd_base_parameters.StartDate = System.DateTime.Now; bd_base_parameters.StartDate = System.DateTime.Now.AddYears(5); if (list.Length > 0) { //修改 //if (Manage.Update(bd_base_parameters)) bool UpdateSuc = (bool)baseDataManage.CallMethod("Bd_Base_Parameters", "Update", null, new object[] { bd_base_parameters }); if (UpdateSuc) { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog('保存成功');", true); repFuelListDataBind("Load"); Clear(); } else { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog('保存失败');", true); } } else { //添加 //if (Manage.Insert(bd_base_parameters)) bool InsertSuc = (bool)baseDataManage.CallMethod("Bd_Base_Parameters", "Insert", null, new object[] { bd_base_parameters }); if (InsertSuc) { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog('保存成功');", true); repFuelListDataBind("Load"); Clear(); } else { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog('保存失败');", true); } } }
//添加或者修改 protected void btnSave_Click(object sender, EventArgs e) { if (!InNull()) { return; } Bd_Base_Parameters bd_base_parameters = null; if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "") { //获取实体 bd_base_parameters = baseDataManage.CallMethod("Bd_Base_Parameters", "GetById", null, new object[] { Request.QueryString["id"].ToString() }) as Bd_Base_Parameters; } else { bd_base_parameters = new Bd_Base_Parameters(); } bd_base_parameters.CpyNo = txtCompanyNo.Text.Trim().Replace("'", ""); bd_base_parameters.SetName = txtParamName.Text.Trim().Replace("'", ""); bd_base_parameters.SetValue = txtParamValue.Text.Trim().Replace("'", ""); bd_base_parameters.StartDate = DateTime.Parse(txtStartDate.Value.Replace("'", "")); bd_base_parameters.EndDate = DateTime.Parse(txtEndDate.Value.Replace("'", "")); bd_base_parameters.SetDescription = txtParamDescript.Text.Trim().Replace("'", ""); bd_base_parameters.Remark = txtRemark.Text.Replace("'", ""); if (Request.QueryString["id"] != null && Request.QueryString["id"].ToString() != "") { bool UpdateSuc = (bool)baseDataManage.CallMethod("Bd_Base_Parameters", "Update", null, new object[] { bd_base_parameters }); //保存 if (UpdateSuc) { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog3('保存成功!');", true); } else { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog3('保存失败!');", true); } } else { string sqlWhere = string.Format(" CpyNo='{0}' and SetName='{1}' ", txtCompanyNo.Text.Trim(), txtParamName.Text.Trim()); //IHashObject parameter = new HashObject(); //parameter.Add("CpyNo", txtCompanyNo.Text.Trim()); //parameter.Add("SetName", txtParamName.Text.Trim()); List <Bd_Base_Parameters> objList = baseDataManage.CallMethod("Bd_Base_Parameters", "GetList", null, new object[] { sqlWhere }) as List <Bd_Base_Parameters>; if (objList.Count == 0) { //添加 bool InsertSuc = (bool)baseDataManage.CallMethod("Bd_Base_Parameters", "Insert", null, new object[] { bd_base_parameters }); if (InsertSuc) { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog3('添加成功!');", true); } else { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog3('添加失败!');", true); } } else { ScriptManager.RegisterStartupScript(this, GetType(), Guid.NewGuid().ToString(), "showdialog3('该公司编号(" + txtCompanyNo.Text.Trim() + ")和参数名(" + txtParamName.Text.Trim() + ")已经存在!');", true); } } }
/// <summary> /// 通过参数返回数据 /// </summary> /// <param name="apmod">获取政策匹配中传过来的政策数据</param> /// <param name="userParametersList">当前登录用户公司参数信息</param> /// <param name="supBaseParametersList">落地运营商和供应商公司参数信息</param> /// <returns></returns> public AjaxPolicyMatchOutData GetAjaxPolicyMatchOutDataNew(AjaxPolicyMatchOutData apmod, List <PbProject.Model.Bd_Base_Parameters> userParametersList, List <PbProject.Model.Bd_Base_Parameters> supBaseParametersList) { try { if (apmod != null && apmod.OutPutPolicyList != null && apmod.OutPutPolicyList.Count > 0) { string wangYinZhangHao = PbProject.Model.definitionParam.paramsName.wangYinZhangHao; //参数名 string wangYinLeiXing = PbProject.Model.definitionParam.paramsName.wangYinLeiXing; //参数名 string payTypes = ""; //对应政策的支付方式 bool IsPolicySource = false; //判断是否有共享 string temp = ""; //变量 string CPCpyNoS = ""; //变量 foreach (AjAxPolicyParam items in apmod.OutPutPolicyList) { temp = "'" + items.CPCpyNo + "'"; if (!CPCpyNoS.Contains(temp)) { CPCpyNoS += temp + ","; } if (items.PolicySource == "9") { IsPolicySource = true; } } List <Bd_Base_Parameters> bParametersList = null; //有共享政策时,读取共享出票方的参数 if (IsPolicySource == true) { CPCpyNoS = CPCpyNoS.TrimEnd(','); string sqlWhere = " CpyNo in (" + CPCpyNoS + ") and (SetName='" + wangYinZhangHao + "' or SetName='" + wangYinLeiXing + "')"; bParametersList = new PbProject.Logic.ControlBase.Bd_Base_ParametersBLL().GetParametersListByWhere(sqlWhere); } string strGongYingKongZhiFenXiao = PbProject.WebCommon.Utility.BaseParams.getParams(userParametersList).GongYingKongZhiFenXiao; Bd_Base_Parameters zhangHao = null; //参数变量 Bd_Base_Parameters leiXing = null; //参数变量 foreach (AjAxPolicyParam item in apmod.OutPutPolicyList) { zhangHao = null; leiXing = null; payTypes = "|"; temp = ""; if (item.PolicySource == "9") { #region 获取账号 foreach (Bd_Base_Parameters bParameter in bParametersList) { if (bParameter.CpyNo == item.CPCpyNo) { if (bParameter.SetName == wangYinZhangHao) { zhangHao = bParameter; } else if (bParameter.SetName == wangYinLeiXing) { leiXing = bParameter; } } } #endregion } else { #region 获取账号 foreach (Bd_Base_Parameters baseParameter in supBaseParametersList) { if (baseParameter.SetName == wangYinZhangHao) { zhangHao = baseParameter; } else if (baseParameter.SetName == wangYinLeiXing) { leiXing = baseParameter; } } #endregion #region 本地支付 if (strGongYingKongZhiFenXiao != null) { if (strGongYingKongZhiFenXiao.Contains("|76|")) { payTypes += "5|";//账户余额支付 } if ((item.PolicySource == "1" || item.PolicySource == "2") && strGongYingKongZhiFenXiao.Contains("|79|")) { payTypes += "6|";//收银 } } #endregion } #region 在线支付 if (zhangHao != null && !string.IsNullOrEmpty(zhangHao.SetValue) && zhangHao.SetValue.Contains("|")) { string[] setValues = zhangHao.SetValue.Split('|'); string[] setValue0 = setValues[0].Split('^'); if (!string.IsNullOrEmpty(setValue0[0])) //支付宝 { payTypes += "1|"; //支付宝 temp += "5,"; } string[] setValue1 = setValues[1].Split('^'); if (!string.IsNullOrEmpty(setValue1[0])) { //快钱 payTypes += "2|"; temp += "6,"; } string[] setValue2 = setValues[2].Split('^'); if (!string.IsNullOrEmpty(setValue2[0])) { //汇付 payTypes += "3|"; temp += "7,"; } string[] setValue3 = setValues[3].Split('^'); if (!string.IsNullOrEmpty(setValue3[0])) { //财付通 payTypes += "4|"; temp += "8,"; } } if (leiXing != null && !string.IsNullOrEmpty(leiXing.SetValue) && temp.Contains(leiXing.SetValue)) { payTypes += "0|";//网银 } #endregion item.PayType = payTypes; //赋值 } } } catch (Exception ex) { } return(apmod); }
/// <summary> /// BindPayType /// </summary> private void BindPayType() { try { string gYcpyNo = mUser.CpyNo.Substring(0, 12); string wangYinZhangHao = PbProject.Model.definitionParam.paramsName.wangYinZhangHao; string wangYinLeiXing = PbProject.Model.definitionParam.paramsName.wangYinLeiXing; string sqlWhere = " CpyNo='" + gYcpyNo + "' and (SetName='" + wangYinZhangHao + "' or SetName='" + wangYinLeiXing + "')"; List <Bd_Base_Parameters> bParametersList = new PbProject.Logic.ControlBase.Bd_Base_ParametersBLL().GetParametersListByWhere(sqlWhere); #region 测试数据 /*List<Bd_Base_Parameters> bParametersList = new List<Bd_Base_Parameters>(); * Bd_Base_Parameters ts = new Bd_Base_Parameters(); * ts.SetName = wangYinZhangHao; * ts.SetValue = "[email protected]^[email protected]^0.001|[email protected]^[email protected]^0.001|[email protected]^[email protected]^0.001|[email protected]^[email protected]^0.001|"; * bParametersList.Add(ts); * * Bd_Base_Parameters ts1 = new Bd_Base_Parameters(); * ts1.SetName = wangYinLeiXing; * ts1.SetValue = "6"; * bParametersList.Add(ts1); */ #endregion Bd_Base_Parameters zhangHao = null; Bd_Base_Parameters leiXing = null; if (bParametersList != null && bParametersList.Count > 1) { foreach (var item in bParametersList) { if (item.SetName == wangYinZhangHao) { zhangHao = item; } else if (item.SetName == wangYinLeiXing) { leiXing = item; } } string temp = ""; if (zhangHao != null && !string.IsNullOrEmpty(zhangHao.SetValue) && zhangHao.SetValue.Contains("|")) { string[] setValues = zhangHao.SetValue.Split('|'); string[] setValue0 = setValues[0].Split('^'); if (!string.IsNullOrEmpty(setValue0[1])) { //支付宝 rblPayType.Items.Add(new ListItem("支付宝", "1")); temp += "5,"; } string[] setValue1 = setValues[1].Split('^'); if (!string.IsNullOrEmpty(setValue1[1])) { //快钱 rblPayType.Items.Add(new ListItem("快钱", "2")); temp += "6,"; } string[] setValue2 = setValues[2].Split('^'); if (!string.IsNullOrEmpty(setValue2[1])) { //汇付 rblPayType.Items.Add(new ListItem("汇付", "3")); temp += "7,"; } string[] setValue3 = setValues[3].Split('^'); if (!string.IsNullOrEmpty(setValue3[1])) { //财付通 rblPayType.Items.Add(new ListItem("财付通", "4")); temp += "8,"; rblPayType.Items.Add(new ListItem("信用卡大额支付", "40")); } } //判断网银 if (leiXing != null && !string.IsNullOrEmpty(leiXing.SetValue) && leiXing.SetValue != "0") { if (temp.Contains(leiXing.SetValue)) { rblPayType.Items.Insert(0, new ListItem("网银", leiXing.SetValue)); hidWangYingType.Value = leiXing.SetValue; } } if (rblPayType.Items.Count > 0) { rblPayType.Items[0].Selected = true; hidPayWay.Value = rblPayType.Items[0].Value; //支付方式 spanid.Visible = true; } else { spanid.Visible = false; Page.ClientScript.RegisterStartupScript(this.GetType(), DateTime.Now.Ticks.ToString(), "alert('不能进入该页面!');history.go(-1);", true); } } } catch (Exception) { } }