/// <summary> /// 列表操作 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void repList_ItemCommand(object source, RepeaterCommandEventArgs e) { try { string id = e.CommandArgument.ToString(); if (e.CommandName == "Del") { Tb_Ticket_TakeOffDetail Mtakeoffdetail = baseDataManage.CallMethod("Tb_Ticket_TakeOffDetail", "GetById", null, new object[] { id }) as Tb_Ticket_TakeOffDetail; msg = (bool)baseDataManage.CallMethod("Tb_Ticket_TakeOffDetail", "DeleteById", null, new Object[] { id }) == true ? "删除成功" : "删除失败"; if (msg == "删除成功") { //日志 Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "扣点组管理"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OperateType = "删除扣点组明细"; logoper.OptContent = "删除扣点组明细id:" + id + ",出发城市:" + Mtakeoffdetail.FromCityCode + ",到达城市:" + Mtakeoffdetail.ToCityCode + ",承运人:" + Mtakeoffdetail.CarryCode + ",扣点范围:" + Mtakeoffdetail.PointScope; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper);//添加日志 } } } catch (Exception) { msg = "操作异常"; throw; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbtnOK_Click(object sender, EventArgs e) { //接口账号集合 string sql = ""; string setvalues = txtJKact517.Text + "^" + txtJKpwd517.Text + "^" + txtJKkey517.Text + "^" + txtyckack517.Text + "^" + txtyckpwd517.Text + "|" + txtJKact51book.Text + "^" + txtJKpwd51book.Text + "^" + txtJKkey51book.Text + "^" + txtNoticeURL51book.Text + "|" + txtJKactBT.Text + "^" + txtJKpwdBT.Text + "^" + txtJKkeyBT.Text + "|" + txtJKactPM.Text + "^" + txtJKpwdPM.Text + "^" + txtJKkeyPM.Text + "|" + txtJKactJR.Text + "^" + txtJKpwdJR.Text + "|" + txtJKact8000yi.Text + "^" + txtJKpwd8000yi.Text + "^" + txtJKDKZFB8000yi.Text + "|" + txtyixing.Text + "^" + txtyixinggy.Text; sql = GetParameterUpSql(setvalues, mCompany.UninCode, PbProject.Model.definitionParam.paramsName.jieKouZhangHao); string msg = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base().ExecuteNonQuerySQLInfo(sql) == true ? "设置成功" : "设置失败"; if (msg == "设置成功") { //日志 Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "接口账号设置"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OperateType = "接口账号设置"; logoper.OptContent = "修改前:" + BaseParams.getParams(baseParametersList).JieKouZhangHao + "//////////修改后:" + setvalues; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper); } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }
/// <summary> /// 删除 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void repPosList_ItemCommand(object source, RepeaterCommandEventArgs e) { string id = e.CommandArgument.ToString(); string msg = ""; if ((bool)baseDataManage.CallMethod("Tb_PosInfo", "DeleteById", null, new Object[] { id })) { msg = "删除成功"; #region 操作日志 Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "pos机管理"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OperateType = "删除Pos机"; logoper.OptContent = "id=" + id; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper); #endregion } else { msg = "删除失败"; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); BindPosInfo(); }
/// <summary> /// 批量删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { try { int count = this.repList.Items.Count; string ids = ""; for (var i = 0; i < count; i++) { if (((System.Web.UI.HtmlControls.HtmlInputCheckBox) this.repList.Items[i].FindControl("cbItem")).Checked) { string id = ((System.Web.UI.HtmlControls.HtmlInputCheckBox) this.repList.Items[i].FindControl("cbItem")).Value; if (id.Length != 0) { ids += "'" + id + "',"; } } } ids = ids.TrimEnd(','); if (ids.Length > 0) { List <Tb_Ticket_StrategyGroup> list = this.baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "GetList", null, new object[] { "id in (" + ids + ")" }) as List <Tb_Ticket_StrategyGroup>; string sql1 = "delete from Tb_Ticket_StrategyGroup where id in (" + ids + ")"; string sql2 = "delete from Tb_Ticket_TakeOffDetail where GroupId in (" + ids + ")"; List <string> sqllist = new List <string>(); sqllist.Add(sql1); sqllist.Add(sql2); string errormsg = ""; msg = baseDataManage.ExecuteSqlTran(sqllist, out errormsg) == true ? "删除成功" : "删除失败"; BindDiscountList(); if (msg == "删除成功") { string contents = ""; for (int i = 0; i < list.Count; i++) { contents += "id:" + list[i].id + ",组名:" + list[i].GroupName + "###"; } Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "扣点组管理"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OperateType = "删除多个扣点组"; logoper.OptContent = "删除多个扣点组|" + contents; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper);//添加日志 } } else { msg = "请选择要删除的选项"; } } catch (Exception) { msg = "操作异常"; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbsave_Click(object sender, EventArgs e) { string msg = ""; IHashObject parameter = new HashObject(); Log_Operation logoper = new Log_Operation(); try { parameter.Add("OperTime", DateTime.Now); parameter.Add("OperLoginName", mUser.LoginName); parameter.Add("OperUserName", mUser.UserName); parameter.Add("GroupName", txtGroupName.Text.Trim()); parameter.Add("DefaultFlag", rblDefaultFlag.SelectedValue); parameter.Add("UniteFlag", rblUniteFlag.SelectedValue); parameter.Add("UnitePoint", txtUnitePoint.Text.Trim()); if (rblDefaultFlag.SelectedValue == "true") { new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base().ExecuteNonQuerySQLInfo("Update Tb_Ticket_StrategyGroup set DefaultFlag='false'"); } if (ViewState["id"] != null) { #region 修改 parameter.Add("id", ViewState["id"]); if ((bool)baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "Update", null, new object[] { parameter }) == true) { msg = "更新成功"; } else { msg = "更新失败"; } #endregion } else { #region 添加 parameter.Add("CpyName", mCompany.UninAllName); parameter.Add("CpyType", mCompany.RoleType); List <Tb_Ticket_StrategyGroup> listgroup = baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "GetList", null, new Object[] { "GroupName='" + txtGroupName.Text.Trim() + "' and CpyNo='" + mCompany.UninCode + "'" }) as List <Tb_Ticket_StrategyGroup>; if (listgroup != null && listgroup.Count > 0) { msg = "该用户已存在此扣点组"; } else { msg = (bool)baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "Insert", null, new Object[] { parameter }) == true ? "添加成功" : "添加失败"; } #endregion } } catch (Exception) { throw; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }
/// <summary> /// 批量删除 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnDel_Click(object sender, EventArgs e) { try { int count = this.repList.Items.Count; string ids = ""; for (var i = 0; i < count; i++) { if (((System.Web.UI.HtmlControls.HtmlInputCheckBox) this.repList.Items[i].FindControl("cbItem")).Checked) { string id = ((System.Web.UI.HtmlControls.HtmlInputCheckBox) this.repList.Items[i].FindControl("cbItem")).Value; if (id.Length != 0) { ids += "'" + id + "',"; } } } ids = ids.TrimEnd(','); if (ids.Length > 0) { List <Tb_Ticket_TakeOffDetail> list = this.baseDataManage.CallMethod("Tb_Ticket_TakeOffDetail", "GetList", null, new object[] { "id in (" + ids + ")" }) as List <Tb_Ticket_TakeOffDetail>; string sql = "delete from Tb_Ticket_TakeOffDetail where id in (" + ids + ")"; msg = new PbProject.Logic.SQLEXBLL.SQLEXBLL_Base().ExecuteNonQuerySQLInfo(sql) == true ? "删除成功" : "删除失败"; if (msg == "删除成功") { string contents = ""; for (int i = 0; i < list.Count; i++) { contents += "id:" + list[i].id + ",出发城市:" + list[i].FromCityCode + ",到达城市:" + list[i].ToCityCode + ",承运人:" + list[i].CarryCode + ",扣点范围:" + list[i].PointScope + "###"; } //日志 Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "扣点组管理"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OperateType = "删除多条扣点组明细"; logoper.OptContent = "删除多条扣点组明细|" + contents; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper);//添加日志 BindDiscountList(); } } else { msg = "请选择要删除的选项"; } } catch (Exception) { throw; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }
/// <summary> /// 列表操作 /// </summary> /// <param name="source"></param> /// <param name="e"></param> protected void repList_ItemCommand(object source, RepeaterCommandEventArgs e) { try { string id = e.CommandArgument.ToString(); if (e.CommandName == "Del") { Tb_Ticket_StrategyGroup Mgroup = baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "GetById", null, new object[] { id }) as Tb_Ticket_StrategyGroup; string sql1 = "delete from Tb_Ticket_StrategyGroup where id='" + id + "'"; string sql2 = "delete from Tb_Ticket_TakeOffDetail where GroupId ='" + id + "'"; List <string> sqllist = new List <string>(); sqllist.Add(sql1); sqllist.Add(sql2); string errormsg = ""; msg = baseDataManage.ExecuteSqlTran(sqllist, out errormsg) == true ? "删除成功" : "删除失败"; if (msg == "删除成功") { //日志 Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "扣点组管理"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OperateType = "删除扣点组"; logoper.OptContent = "删除扣点组id:" + id + ",组名:" + Mgroup.GroupName; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper);//添加日志 BindDiscountList(); } } else { Response.Redirect("DiscountSet.aspx?gid=" + id + "¤tuserid=" + this.currentuserid.Value.ToString()); } } catch (Exception) { msg = "操作异常"; throw; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btsave_Click(object sender, EventArgs e) { try { IHashObject parameter = new HashObject(); parameter.Add("OrderId", Request["orderid"].ToString()); parameter.Add("OperType", "协调"); parameter.Add("OperTime", DateTime.Now); parameter.Add("OperLoginName", mUser.LoginName); parameter.Add("OperUserName", mUser.UserName); parameter.Add("CpyNo", mUser.CpyNo); parameter.Add("CpyType", mCompany.RoleType); parameter.Add("CpyName", mCompany.UninAllName); parameter.Add("OperContent", CommonManage.TrimSQL(ddltype.SelectedValue + "|" + txtRemark.Text.Trim()).TrimEnd('|')); parameter.Add("WatchType", mCompany.RoleType == 1 ? "1" : "2");//判断登录用户是否是平台(只有平台和运营可以进此页面) if ((bool)baseDataManage.CallMethod("Log_Tb_AirOrder", "Insert", null, new Object[] { parameter }) == true) { DataBind(Request["orderid"].ToString()); Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "协调"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OperateType = ddltype.SelectedValue; logoper.OptContent = CommonManage.TrimSQL(ddltype.SelectedValue + "|" + txtRemark.Text.Trim()).TrimEnd('|'); new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper);//添加日志 } else { ScriptManager.RegisterStartupScript(this, GetType(), "", "alert('失败');", true); } } catch (Exception) { throw; } }
/// <summary> /// 添加pos机 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnBind_Click(object sender, EventArgs e) { string msg = ""; try { List <User_Employees> list = baseDataManage.CallMethod("User_Employees", "GetList", null, new Object[] { "CpyNo='" + ddlGYList.Value.Split('-')[0].ToString() + "'" }) as List <User_Employees>; IHashObject parameter = new HashObject(); if (list != null && list.Count > 0) { parameter.Add("CpyLoginName", list[0].LoginName); } parameter.Add("CpyNo", ddlGYList.Value.Split('-')[0].ToString()); parameter.Add("CpyName", ddlGYList.Text.Split('-')[1].ToString()); parameter.Add("CpyType", ddlGYList.Value.Split('-')[1].ToString()); parameter.Add("OperTime", Convert.ToDateTime(DateTime.Now)); parameter.Add("OperCpyNo", mCompany.UninCode); parameter.Add("OperCpyName", mCompany.UninAllName); parameter.Add("OperLoginName", mUser.LoginName); parameter.Add("OperUserName", mUser.UserName); parameter.Add("PosMode", int.Parse(ddltype.SelectedValue)); parameter.Add("PosNo", txtTerminalNo.Text.Trim()); parameter.Add("PosRate", txtfeil.Text); Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "pos机管理"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; if (ViewState["Id"] != null) { #region 修改 parameter.Add("id", ViewState["Id"].ToString()); if ((bool)baseDataManage.CallMethod("Tb_PosInfo", "Update", null, new object[] { parameter })) { msg = "更新成功"; #region 操作日志 logoper.OperateType = "修改Pos机"; logoper.OptContent = "id:" + ViewState["Id"].ToString() + ",Pos编号:" + txtTerminalNo.Text.Trim() + ",Pos类型:" + ddltype.SelectedValue + ",Pos费率:" + txtfeil.Text; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper); #endregion } else { msg = "更新失败"; } #endregion } else { #region 添加 List <Tb_PosInfo> listpos = baseDataManage.CallMethod("Tb_PosInfo", "GetList", null, new Object[] { "PosNo='" + txtTerminalNo.Text + "'" }) as List <Tb_PosInfo>; if (listpos.Count > 0) { msg = "此pos机已存在"; } else { if ((bool)baseDataManage.CallMethod("Tb_PosInfo", "Insert", null, new Object[] { parameter })) { msg = "添加成功"; #region 操作日志 logoper.OperateType = "添加Pos机"; logoper.OptContent = "Pos编号:" + txtTerminalNo.Text.Trim() + ",Pos类型:" + ddltype.SelectedValue + ",Pos费率:" + txtfeil.Text; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper); #endregion } else { msg = "添加失败"; } } #endregion } } catch (Exception ex) { msg = "操作异常,商家和pos机类型必选"; Log_Error logerror = new Log_Error(); logerror.CpyNo = mCompany.UninCode; logerror.DevName = "xw"; logerror.ErrorContent = ex.Message; logerror.LoginName = mUser.LoginName; logerror.Page = "PosEdit"; new PbProject.Logic.Log.Log_ErrorBLL().InsertLog_Error(logerror); Bind(); } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); Bind(); }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void btnAdd_Click(object sender, EventArgs e) { string msg = ""; try { List <string> sqllist = new List <string>(); string pointscope = ""; string basetype = ddlbasetype.SelectedValue; string selecttype = rblSelectType.SelectedValue; string txtPoint = txtUnitePoint.Text.Trim().Length == 0 ? "0" : txtUnitePoint.Text.Trim(); string strCarryCode = SelectAirCode1.Value == "" ? "ALL" : SelectAirCode1.Value; string strFromCityCode = FromCityCode.Value.Trim() == "" ? "ALL" : FromCityCode.Value.Trim(); if (strFromCityCode.Substring(strFromCityCode.Length - 1, 1) != "/") { strFromCityCode += "/"; } string strToCityCode = ToCityCode.Value.Trim() == "" ? "ALL" : ToCityCode.Value.Trim(); if (strToCityCode.Substring(strToCityCode.Length - 1, 1) != "/") { strToCityCode += "/"; } DateTime dtStartDate = DateTime.Parse("1900-01-01 00:00:00"); DateTime dtEndDate = DateTime.Parse("1900-01-01 00:00:00"); if (ViewState["gid"] == null)//显示扣点详情时判断 { if (txtStartDate.Value.Trim() == "") { ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('请选择有效开始时间');", true); return; } if (txtEndDate.Value.Trim() == "") { ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('请选择有效结束时间');", true); return; } try { dtStartDate = DateTime.Parse(txtStartDate.Value); dtEndDate = DateTime.Parse(txtEndDate.Value); } catch (Exception) { ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('有效时间格式错误');", true); return; } } //接口 string policySource = ""; if (basetype == "2") { ListItemCollection itemck = cbljk.Items; for (int i = 0; i < itemck.Count; i++) { if (itemck[i].Selected) { policySource += itemck[i].Value + ","; } } policySource = policySource.TrimEnd(','); if (policySource.Length <= 0) { ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('请选择接口');", true); return; } } else { policySource = "0"; } //判断此航段是否重复 string[] policySources = policySource.Split(','); string[] fromcitycodes = strFromCityCode.Split('/'); string[] tocitycodes = strToCityCode.Split('/'); List <Tb_Ticket_TakeOffDetail> listdetail = null; if (ViewState["addgroupid"] != null)//添加时候判断重复 { string sqlwhere1 = " 1=1 " + " and CpyNo='" + mCompany.UninCode + "'" + " and GroupId='" + ViewState["addgroupid"] + "'"; if (selecttype == "3") { sqlwhere1 += " and SelectType=3"; } else { sqlwhere1 += " and SelectType<>3"; } listdetail = this.baseDataManage.CallMethod("Tb_Ticket_TakeOffDetail", "GetList", null, new object[] { sqlwhere1 }) as List <Tb_Ticket_TakeOffDetail>; } if (ViewState["gdid"] != null && ViewState["groupid"] != null)//修改时判断重复 { string sqlwhere2 = " 1=1 " + " and CpyNo='" + mCompany.UninCode + "'" + " and GroupId='" + ViewState["groupid"] + "'" + " and id <> '" + ViewState["gdid"] + "'"; if (selecttype == "3") { sqlwhere2 += " and SelectType=3"; } else { sqlwhere2 += " and SelectType<>3"; } listdetail = this.baseDataManage.CallMethod("Tb_Ticket_TakeOffDetail", "GetList", null, new object[] { sqlwhere2 }) as List <Tb_Ticket_TakeOffDetail>; } if (ViewState["addgroupid"] != null || (ViewState["gdid"] != null && ViewState["groupid"] != null)) { for (int i = 0; i < listdetail.Count; i++)//循环已经存在的扣点明细表 { string CarryCodeError = ""; if (listdetail[i].CarryCode.Contains(strCarryCode) || listdetail[i].CarryCode == "ALL" || strCarryCode == "ALL" )//判断承运人/调整类型 { CarryCodeError = "承运人有重复."; for (int j = 0; j < fromcitycodes.Length; j++)//循环出发城市 { if (fromcitycodes[j].ToString() == "") { continue; } string fromcityError = ""; if (listdetail[i].FromCityCode.Contains(fromcitycodes[j].ToString()) ||//判断出发城市 listdetail[i].FromCityCode.Contains("ALL") || fromcitycodes[j].ToString().Contains("ALL")) { fromcityError = "出发城市有重复."; for (int k = 0; k < tocitycodes.Length; k++)//循环到达城市 { if (tocitycodes[k].ToString() == "") { continue; } string tocityError = ""; if (listdetail[i].ToCityCode.Contains(tocitycodes[k].ToString()) ||//判断到达城市 listdetail[i].ToCityCode.Contains("ALL") || tocitycodes[k].ToString().Contains("ALL")) { tocityError = "到达城市有重复."; string basetypeError = ""; if (basetype == listdetail[i].BaseType.ToString())//判断扣点类型 { string timeError = ""; DateTime dtStartDateOld; DateTime dtEndDateOld; try { dtStartDateOld = DateTime.Parse(listdetail[i].TimeScope.Split('|')[0].ToString()); dtEndDateOld = DateTime.Parse(listdetail[i].TimeScope.Split('|')[1].ToString()); } catch (Exception) { //格式发生错误,直接给默认时间 dtStartDateOld = DateTime.Parse("1990-01-01 00:00:01"); dtEndDateOld = DateTime.Parse("1990-01-01 00:00:01"); } if ((dtStartDate >= dtStartDateOld && dtStartDate <= dtEndDateOld) || (dtEndDate >= dtStartDateOld && dtEndDate <= dtEndDateOld)) { timeError = "有效时间段内有重复."; if (basetype == "2") { for (int l = 0; l < policySources.Length; l++) //循环接口 { if (listdetail[i].PolicySource.Contains(policySources[l].ToString())) //判断接口 { basetypeError = "接口来源有重复."; string errorAll = CarryCodeError + fromcityError + tocityError + basetypeError + timeError; ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('此航段在本组已存在," + errorAll + "');", true); return; } } } else { basetypeError = "扣点类型有重复."; string errorAll = CarryCodeError + fromcityError + tocityError + basetypeError + timeError; ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('此航段在本组已存在," + errorAll + "');", true); return; } } } } } } } } } } //点数范围 for (int i = 0; i < int.Parse(hidtxtCount.Value); i++) { txtA = ((TextBox)this.FindControl("txtA" + i)); txtB = ((TextBox)this.FindControl("txtB" + i)); txtP = ((TextBox)this.FindControl("txtpoint" + i)); //扣点 txtM = ((TextBox)this.FindControl("txtMoney" + i)); //现返 string txtpvalue = txtP.Text.Trim().Length == 0 ? "0" : txtP.Text.Trim(); string txtmvalue = txtM.Text.Trim().Length == 0 ? "0" : txtM.Text.Trim(); pointscope += txtA.Text.Trim() + "-" + txtB.Text.Trim() + "^" + txtpvalue + "^" + txtmvalue + "|"; } pointscope = pointscope.TrimEnd('|'); //日志 Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "扣点组管理"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; //修改 if (ViewState["gid"] != null || (ViewState["gdid"] != null && ViewState["groupid"] != null)) { string sql = ""; if (ViewState["gid"] != null) { sql = "update Tb_Ticket_StrategyGroup set OperTime='" + DateTime.Now + "',OperLoginName='" + mUser.LoginName + "',OperUserName='******',DefaultFlag='" + rblDefaultFlag.SelectedValue + "',UniteFlag=" + rblUniteFlag.SelectedValue + ",UnitePoint='" + txtPoint + "' where id='" + ViewState["gid"].ToString() + "'"; logoper.OperateType = "修改扣点组"; logoper.OptContent = "修改扣点组id:" + ViewState["gid"].ToString() + ",OperTime='" + DateTime.Now + "',OperLoginName='" + mUser.LoginName + "',OperUserName='******',DefaultFlag='" + rblDefaultFlag.SelectedValue + "',UniteFlag=" + rblUniteFlag.SelectedValue + ",UnitePoint='" + txtPoint + "'"; } else { sql = "update Tb_Ticket_TakeOffDetail set OperTime='" + DateTime.Now + "',OperLoginName='" + mUser.LoginName + "',OperUserName='******',BaseType=" + int.Parse(ddlbasetype.SelectedValue) + ",PolicySource='" + policySource + "',CarryCode='" + strCarryCode + "',FromCityCode='/" + strFromCityCode + "',ToCityCode='/" + strToCityCode + "',TimeScope='" + txtStartDate.Value + "|" + txtEndDate.Value + "',PointScope='" + pointscope + "',SelectType=" + int.Parse(rblSelectType.SelectedValue) + " where id='" + ViewState["gdid"].ToString() + "'"; logoper.OperateType = "修改扣点组明细"; logoper.OptContent = "修改扣点组明细OperTime='" + DateTime.Now + "',OperLoginName='" + mUser.LoginName + "',OperUserName='******',BaseType=" + int.Parse(ddlbasetype.SelectedValue) + ",PolicySource='" + policySource + "',CarryCode='" + strCarryCode + "',FromCityCode='/" + strFromCityCode + "',ToCityCode='/" + strToCityCode + "',TimeScope='" + txtStartDate.Value + "|" + txtEndDate.Value + "',PointScope='" + pointscope + "',SelectType=" + int.Parse(rblSelectType.SelectedValue); } sqllist.Add(sql); string errormsg = "修改扣点组出错"; if (baseDataManage.ExecuteSqlTran(sqllist, out errormsg)) { msg = "修改成功"; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper);//添加日志 } else { msg = "修改失败"; } } else//添加 { List <Tb_Ticket_StrategyGroup> list = null; Guid gid = Guid.NewGuid(); //判断是否从详情页面连接过来做添加 if (ViewState["addgroupid"] != null) { gid = Guid.Parse(ViewState["addgroupid"].ToString()); } else { list = this.baseDataManage.CallMethod("Tb_Ticket_StrategyGroup", "GetList", null, new object[] { "GroupName='" + txtGroupName.Text.Trim() + "' and CpyNo='" + mCompany.UninCode + "'" }) as List <Tb_Ticket_StrategyGroup>; string sql1 = "Insert into Tb_Ticket_StrategyGroup(id,CpyNo,CpyName,CpyType,OperTime,OperLoginName,OperUserName,GroupName,DefaultFlag,UniteFlag,UnitePoint) " + "values('" + gid + "','" + mCompany.UninCode + "','" + mCompany.UninAllName + "'," + mCompany.RoleType + ",'" + DateTime.Now + "','" + mUser.LoginName + "','" + mUser.UserName + "','" + txtGroupName.Text.Trim() + "','" + rblDefaultFlag.SelectedValue + "'," + rblUniteFlag.SelectedValue + ",'" + txtPoint + "')"; sqllist.Add(sql1); logoper.OperateType = "添加扣点组"; logoper.OptContent = "组id:" + gid + ",组名:" + txtGroupName.Text.Trim(); } if (list != null && list.Count > 0) { msg = "此用户组已存在"; } else { string sql2 = "insert into Tb_Ticket_TakeOffDetail(CpyNo,CpyName,CpyType,OperTime,OperLoginName,OperUserName,GroupId,BaseType,PolicySource,CarryCode,FromCityCode,ToCityCode,TimeScope,PointScope,SelectType) " + "values('" + mCompany.UninCode + "','" + mCompany.UninAllName + "'," + mCompany.RoleType + ",'" + DateTime.Now + "','" + mUser.LoginName + "','" + mUser.UserName + "','" + gid + "'," + int.Parse(ddlbasetype.SelectedValue) + ",'" + policySource + "','" + strCarryCode + "','/" + strFromCityCode + "','/" + strToCityCode + "','" + txtStartDate.Value + "|" + txtEndDate.Value + "','" + pointscope + "'," + int.Parse(rblSelectType.SelectedValue) + ")"; sqllist.Add(sql2); string errormsg = "添加扣点组出错"; logoper.OperateType = "添加扣点组明细"; logoper.OptContent = "出发城市:" + strFromCityCode + ",到达城市:" + strFromCityCode + ",承运人:" + strCarryCode + ",扣点范围:" + pointscope; if (baseDataManage.ExecuteSqlTran(sqllist, out errormsg)) { msg = "添加成功"; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper);//添加日志 } else { msg = "添加失败"; } } } } catch (Exception) { msg = "操作出错"; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }
/// <summary> /// 记录操作日志 /// </summary> /// <param name="logOperation"></param> /// <returns></returns> public int InsertLog_Operation(Log_Operation logOperation) { #region 记录操作日志 int count = 0; try { IHashObject paramter = new HashObject(); if (!string.IsNullOrEmpty(logOperation.ModuleName)) { paramter.Add("ModuleName", logOperation.ModuleName); } if (!string.IsNullOrEmpty(logOperation.OperateType)) { paramter.Add("OperateType", logOperation.OperateType); } if (!string.IsNullOrEmpty(logOperation.LoginName)) { paramter.Add("LoginName", logOperation.LoginName); } if (!string.IsNullOrEmpty(logOperation.CpyNo)) { paramter.Add("CpyNo", logOperation.CpyNo); } if (!string.IsNullOrEmpty(logOperation.OptContent)) { paramter.Add("OptContent", logOperation.OptContent); } if (!string.IsNullOrEmpty(logOperation.UserName)) { paramter.Add("UserName", logOperation.UserName); } if (!string.IsNullOrEmpty(logOperation.OrderId)) { paramter.Add("OrderId", logOperation.OrderId); } paramter.Add("ClientIP", System.Web.HttpContext.Current.Request.UserHostAddress); paramter.Add("CreateTime", Convert.ToDateTime(DateTime.Now)); paramter.Add("A1", logOperation.A1); paramter.Add("A2", logOperation.A2); if (!string.IsNullOrEmpty(logOperation.A3)) { paramter.Add("A3", logOperation.A3); } if (!string.IsNullOrEmpty(logOperation.A3)) { paramter.Add("A4", logOperation.A3); } if (!string.IsNullOrEmpty(logOperation.A3)) { paramter.Add("A5", logOperation.A3); } count = Log_OperationDal.Insert(paramter); } catch (Exception ex) { PbProject.WebCommon.Log.Log.RecordLog("Log_OperationBLL", ex.Message, true, null); } return(count); #endregion }
protected void btnQuery_Click(object sender, EventArgs e) { string msg = ""; string CpyNo = Request["cpyno"] == null ? "" : Request["cpyno"].ToString(); int givecount = int.Parse(txtcount.Text);//送给下级的条数 //运营商条数 List <Tb_Sms_User> listSmsUser = baseDataManage.CallMethod("Tb_Sms_User", "GetList", null, new Object[] { "CpyNo='" + mUser.CpyNo + "'" }) as List <Tb_Sms_User>; if (listSmsUser != null && listSmsUser.Count > 0 && CpyNo != "") { if (listSmsUser[0].SmsRemainCount >= givecount) { try { string tempSQl = ""; List <string> sqlList = new List <string>(); #region 1.修改短信用户信息(增加剩余条数) tempSQl = "Update Tb_Sms_User set SmsCount=SmsCount+" + givecount + ",SmsRemainCount=SmsRemainCount+" + givecount + " where CpyNo='" + CpyNo + "'"; sqlList.Add(tempSQl); #endregion #region 2.修改运营商剩余条数(减少) tempSQl = "Update Tb_Sms_User set SmsRemainCount=SmsRemainCount-" + givecount + " where CpyNo='" + mCompany.UninCode + "'"; sqlList.Add(tempSQl); #endregion bool rs = new PbProject.Dal.ControlBase.BaseData <Tb_Sms_User>().ExecuteSqlTran(sqlList); if (rs == true) { Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "短信赠送"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OperateType = "短信赠送"; logoper.OptContent = "赠送给公司编号为【" + CpyNo + "】,赠送短信条数【" + givecount + "】条"; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper);//日志 msg = "赠送成功!"; } else { msg = "失败!"; } } catch (Exception) { msg = "Error"; } } else { msg = "运营商短信条数不足!"; } } else { msg = "Get Date Error"; } ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "key", "<script>alert('" + msg + "')</script>", false); }
public object SaveUserInfo(Dictionary <string, object> dicParas) { string errMsg = string.Empty; int userId, authorId; string workId = dicParas.ContainsKey("workId") ? dicParas["workId"].ToString() : string.Empty; string state = dicParas.ContainsKey("state") ? dicParas["state"].ToString() : string.Empty; string switchable = dicParas.ContainsKey("switchable") ? dicParas["switchable"].ToString() : string.Empty; string userType = dicParas.ContainsKey("userType") ? dicParas["userType"].ToString() : string.Empty; string reason = dicParas.ContainsKey("reason") ? dicParas["reason"].ToString() : string.Empty; string isAdmin = dicParas.ContainsKey("isAdmin") ? dicParas["isAdmin"].ToString() : string.Empty; if (string.IsNullOrEmpty(state)) { errMsg = "审核状态state参数不能为空"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } if (string.IsNullOrEmpty(userType)) { errMsg = "用户类型userType参数不能为空"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } int iUserType = Convert.ToInt32(userType); if (state == ((int)WorkState.Pass).ToString()) //审核通过 { if (!dicParas.ContainsKey("userGroup") || dicParas["userGroup"] == null) { errMsg = "工作组userGroup参数不能为空"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } if (!dicParas.ContainsKey("userGrant") || dicParas["userGrant"] == null) { errMsg = "授权功能列表userGrant参数不能为空"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } } if (!checkParas(dicParas, out userId, out authorId, out errMsg)) { LogHelper.SaveLog("错误:" + errMsg); return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } //开启EF事务 using (TransactionScope ts = new TransactionScope()) { try { if (state == ((int)WorkState.Pass).ToString()) //审核通过 { //修改用户信息 Dictionary <string, object> userGroup = new Dictionary <string, object>((IDictionary <string, object>)dicParas["userGroup"], StringComparer.OrdinalIgnoreCase); IBase_UserGroupService base_UserGroupService = BLLContainer.Resolve <IBase_UserGroupService>(); int ugid = Convert.ToInt32(userGroup["id"]); if (!base_UserGroupService.Any(w => w.ID.Equals(ugid))) { errMsg = "工作组" + userGroup["groupName"] + "不存在"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } IBase_UserInfoService userInfoService = BLLContainer.Resolve <IBase_UserInfoService>(); var base_UserInfo = userInfoService.GetModels(p => p.UserID.Equals(userId)).FirstOrDefault <Base_UserInfo>(); base_UserInfo.UserGroupID = ugid; base_UserInfo.Auditor = authorId; base_UserInfo.AuditorTime = DateTime.Now; base_UserInfo.Status = (int)UserStatus.Pass; base_UserInfo.IsAdmin = !string.IsNullOrEmpty(isAdmin) ? Convert.ToInt32(isAdmin) : (int?)null; base_UserInfo.UserType = Convert.ToInt32(userType); base_UserInfo.Switchable = !string.IsNullOrEmpty(switchable) ? Convert.ToInt32(switchable) : (int?)null; string storeId = base_UserInfo.StoreID; if (base_UserInfo.IsAdmin == 1 && userInfoService.Any(a => a.UserID != userId && a.IsAdmin == 1 && a.StoreID.Equals(storeId, StringComparison.OrdinalIgnoreCase))) { errMsg = "同一个门店只能有一个管理员"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } if (!userInfoService.Update(base_UserInfo)) { errMsg = "修改用户信息失败"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } //添加或修改授权功能表 var dbContext = DbContextFactory.CreateByModelNamespace(typeof(Base_UserGrant).Namespace); var userGrant = (object[])dicParas["userGrant"]; foreach (IDictionary <string, object> iUgr in userGrant) { if (iUgr != null) { var ugr = new Dictionary <string, object>(iUgr, StringComparer.OrdinalIgnoreCase); int ugrid = Convert.ToInt32(ugr["id"]); if (!dbContext.Set <Base_UserGrant>().Any(w => w.GrantID.Value.Equals(ugrid) && w.UserID.Value.Equals(userId))) { var base_UserGrant = new Base_UserGrant(); base_UserGrant.GrantID = ugrid; base_UserGrant.UserID = userId; base_UserGrant.GrantEN = Convert.ToInt32(ugr["grantEn"]); dbContext.Entry(base_UserGrant).State = EntityState.Added; } else { var base_UserGrant = dbContext.Set <Base_UserGrant>().Where(p => p.GrantID == ugrid && p.UserID == userId).FirstOrDefault(); base_UserGrant.GrantEN = Convert.ToInt32(ugr["grantEn"]); dbContext.Entry(base_UserGrant).State = EntityState.Modified; } } } if (dbContext.SaveChanges() < 0) { errMsg = "保存授权功能失败"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } //修改工单 IXC_WorkInfoService xC_WorkInfoService = BLLContainer.Resolve <IXC_WorkInfoService>(); var xC_WorkInfo = xC_WorkInfoService.GetModels(p => p.WorkID.ToString().Equals(workId, StringComparison.OrdinalIgnoreCase)).FirstOrDefault <XC_WorkInfo>(); xC_WorkInfo.AuditorID = authorId; xC_WorkInfo.AuditTime = DateTime.Now; xC_WorkInfo.WorkState = (int)WorkState.Pass; xC_WorkInfo.AuditBody = "审核通过"; xC_WorkInfo.WorkType = (int)WorkType.UserCheck; if (!xC_WorkInfoService.Update(xC_WorkInfo)) { errMsg = "修改工单失败"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } //添加日志 ILog_OperationService log_OperationService = BLLContainer.Resolve <ILog_OperationService>(); var log_Operation = new Log_Operation(); log_Operation.UserID = userId; log_Operation.AuthorID = authorId; log_Operation.Content = "审核通过"; if (!log_OperationService.Add(log_Operation)) { errMsg = "添加日志失败"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } } else if (state == ((int)WorkState.Reject).ToString()) //审核拒绝 { //修改工单 IXC_WorkInfoService xC_WorkInfoService = BLLContainer.Resolve <IXC_WorkInfoService>(); var xC_WorkInfo = xC_WorkInfoService.GetModels(p => p.WorkID.ToString().Equals(workId, StringComparison.OrdinalIgnoreCase)).FirstOrDefault <XC_WorkInfo>(); xC_WorkInfo.AuditorID = authorId; xC_WorkInfo.AuditTime = DateTime.Now; xC_WorkInfo.WorkState = (int)WorkState.Reject; xC_WorkInfo.AuditBody = "拒绝理由:" + reason; xC_WorkInfo.WorkType = (int)WorkType.UserCheck; if (!xC_WorkInfoService.Update(xC_WorkInfo)) { errMsg = "修改工单失败"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } //添加日志 ILog_OperationService log_OperationService = BLLContainer.Resolve <ILog_OperationService>(); var log_Operation = new Log_Operation(); log_Operation.UserID = userId; log_Operation.AuthorID = authorId; log_Operation.Content = "拒绝理由:" + reason; if (!log_OperationService.Add(log_Operation)) { errMsg = "添加日志失败"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } } else { errMsg = "不明确的审核状态"; return(ResponseModelFactory.CreateFailModel(isSignKeyReturn, errMsg)); } ts.Complete(); return(ResponseModelFactory.CreateSuccessModel(isSignKeyReturn)); } catch (Exception ex) { LogHelper.SaveLog("错误:" + ex.Message); return(ResponseModelFactory.CreateReturnModel(isSignKeyReturn, Return_Code.F, ex.Message)); } } }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbsave_Click(object sender, EventArgs e) { string msg = ""; IHashObject parameter = new HashObject(); Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "共享接口扣点设置"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OrderId = ""; try { parameter.Add("OperTime", DateTime.Now); parameter.Add("OperLoginName", mUser.LoginName); parameter.Add("OperUserName", mUser.UserName); parameter.Add("PolicySource", ddljk.SelectedValue); if (mCompany.RoleType == 1) { parameter.Add("PbPoint", txtPbPoint.Text); parameter.Add("PbMoney", txtPbMoney.Text); } else { parameter.Add("PolicyPoint", txtPolicyPoint.Text); parameter.Add("PolicyMoney", txtPolicyMoney.Text); } if (ViewState["id"] != null) { parameter.Add("id", ViewState["id"]); if ((bool)baseDataManage.CallMethod("Tb_ShareInterface_TakeOff", "Update", null, new object[] { parameter }) == true) { msg = "更新成功"; logoper.OperateType = "修改"; logoper.OptContent = "id=" + ViewState["id"]; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper); } else { msg = "更新失败"; } } else { if (mCompany.RoleType == 1)//平台可多选商家 { List <string> list = new List <string>(); if (Request["names"] != null) { string[] values = Server.HtmlEncode(Request["names"].ToString()).Split(','); for (int i = 0; i < values.Length; i++) { List <Tb_ShareInterface_TakeOff> listIn = baseDataManage.CallMethod("Tb_ShareInterface_TakeOff", "GetList", null, new Object[] { "CpyNo='" + values[i].ToString().Split('|')[1] + "' and PolicySource=" + ddljk.SelectedValue }) as List <Tb_ShareInterface_TakeOff>; if (listIn != null && listIn.Count > 0) { msg = "[" + values[i].ToString().Split('|')[0] + "]用户已添加此接口"; } else { list.Add("insert into Tb_ShareInterface_TakeOff(CpyNo,CpyName,CpyType,OperTime,OperLoginName,OperUserName,PolicySource,PolicyPoint,PolicyMoney,PbPoint,PbMoney) " + "values('" + values[i].ToString().Split('|')[1] + "','" + values[i].ToString().Split('|')[0] + "'," + values[i].ToString().Split('|')[2] + ",'" + DateTime.Now + "','" + mUser.LoginName + "','" + mUser.UserName + "'," + ddljk.SelectedValue + ",'" + txtPolicyPoint.Text.Trim() + "','" + txtPolicyMoney.Text.Trim() + "'," + txtPbPoint.Text.Trim() + "," + txtPbMoney.Text.Trim() + ")"); } } } msg = (bool)baseDataManage.CallMethod("Tb_ShareInterface_TakeOff", "ExecuteSqlTran", null, new object[] { list }) == true ? "添加成功" : "添加失败"; } else //商家操作 { List <Tb_ShareInterface_TakeOff> list = baseDataManage.CallMethod("Tb_ShareInterface_TakeOff", "GetList", null, new Object[] { "CpyNo='" + mCompany.UninCode + "' and PolicySource=" + ddljk.SelectedValue }) as List <Tb_ShareInterface_TakeOff>; if (list != null && list.Count > 0) { msg = "该用户已添加此接口"; } else { parameter.Add("CpyNo", mCompany.UninCode); parameter.Add("CpyName", mCompany.UninAllName); parameter.Add("CpyType", mCompany.RoleType); msg = (bool)baseDataManage.CallMethod("Tb_ShareInterface_TakeOff", "Insert", null, new Object[] { parameter }) == true ? "添加成功" : "添加失败"; } } } } catch (Exception) { msg = "操作异常"; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }
/// <summary> /// 保存 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected void lbsave_Click(object sender, EventArgs e) { string msg = ""; string cblpolicyvalue = ","; for (int i = 0; i < cblPolicy.Items.Count; i++) { if (cblPolicy.Items[i].Selected == true) { cblpolicyvalue += cblPolicy.Items[i].Value + ","; } } IHashObject parameter = new HashObject(); Log_Operation logoper = new Log_Operation(); logoper.ModuleName = "平台政策补点设置"; logoper.LoginName = mUser.LoginName; logoper.UserName = mUser.UserName; logoper.CreateTime = Convert.ToDateTime(DateTime.Now); logoper.CpyNo = mCompany.UninCode; logoper.OrderId = ""; try { if (ViewState["id"] != null) { parameter.Add("CarryCode", txtAirCode.Text.ToUpper()); parameter.Add("FromCityCode", txtFromCityCode.Text.ToUpper()); parameter.Add("ToCityCode", txtToCityCode.Text.ToUpper()); parameter.Add("PolicyPoint", txtPolicyPoint.Text); parameter.Add("State", rblstate.SelectedValue); parameter.Add("A7", cblpolicyvalue); parameter.Add("id", ViewState["id"]); if ((bool)baseDataManage.CallMethod("Tb_Policy_Supply", "Update", null, new object[] { parameter }) == true) { msg = "更新成功"; logoper.OperateType = "修改"; logoper.OptContent = "id=" + ViewState["id"] + "##CarryCode=" + txtAirCode.Text + "##FromCityCode=" + txtFromCityCode.Text + "##ToCityCode=" + txtToCityCode.Text + "##PolicyPoint=" + txtPolicyPoint.Text + "##State=" + rblstate.SelectedValue; new PbProject.Logic.Log.Log_OperationBLL().InsertLog_Operation(logoper); } else { msg = "更新失败"; } } else { List <string> list = new List <string>(); if (ViewState["Cpynames"] != null) { string[] values = ViewState["Cpynames"].ToString().Split(','); for (int i = 0; i < values.Length; i++) { list.Add("insert into Tb_Policy_Supply(CpyNo,CpyName,CpyType,OperTime,OperLoginName,OperUserName,CarryCode,FromCityCode,ToCityCode,PolicyPoint,State,A7) " + "values('" + values[i].ToString().Split('|')[1] + "','" + values[i].ToString().Split('|')[0] + "'," + values[i].ToString().Split('|')[2] + ",'" + DateTime.Now + "','" + mUser.LoginName + "','" + mUser.UserName + "','" + txtAirCode.Text + "','" + txtFromCityCode.Text + "','" + txtToCityCode.Text + "'," + txtPolicyPoint.Text + "," + rblstate.SelectedValue + ",'" + cblpolicyvalue + "')"); } } Session["Cpynames"] = null; msg = (bool)baseDataManage.CallMethod("Tb_Policy_Supply", "ExecuteSqlTran", null, new object[] { list }) == true ? "添加成功" : "添加失败"; } } catch (Exception) { msg = "操作异常"; } ScriptManager.RegisterStartupScript(this, GetType(), "", "showdialog('" + msg + "');", true); }