//挂起 protected void btnHang_Click(object sender, EventArgs e) { try { string Reason = txtRemark.Text; var airlines = (from ListItem item in chklist.Items where item.Selected && item.Enabled select item.Value).ToList(); var companyId = CurrentCompany.CompanyType == CompanyType.Platform ? Guid.Parse(Request.QueryString["id"]) : CurrentCompany.CompanyId; var existsPolicyType = PolicyManageService.CheckIfHasDefaultPolicy(companyId, airlines); if (existsPolicyType != PolicyType.Unknown) { throw new CustomException(CurrentCompany.CompanyType == CompanyType.Platform ? "该供应商在平台存在" + existsPolicyType.GetDescription() + "指向,请调整后再行操作" : "该航线在平台存在" + existsPolicyType.GetDescription() + "指向,请联系平台调整后再行操作"); } if (airlines.Count == 0) { ShowMessage("挂起航空公司必须选择一个!本次操作被取消!"); return; } if (SolutionReason.Text.Trim() == "") { ShowMessage("挂起原因不能为空!请输入!"); return; } if (SolutionReason.Text.Trim().Length >= 100) { SolutionReason.Text = SolutionReason.Text.Trim().Substring(0, 100); ShowMessage("输入挂起原因过长,只能在100字以内!"); return; } var flag = Request.QueryString["flag"].Trim(); var type = CurrentCompany.CompanyType; var ipAddress = ChinaPay.AddressLocator.IPAddressLocator.GetRequestIP(HttpContext.Current.Request); //var ipLocation = ChinaPay.AddressLocator.CityLocator.GetIPLocation(ipAddress); if (type == CompanyType.Platform && flag == "hang") { var falg = PolicyManageService.SuspendPolicies(Guid.Parse(Request.QueryString["id"]), this.CurrentUser.UserName, SolutionReason.Text.Trim(), ipAddress.ToString(), PublishRole.平台, airlines.ToArray()); if (falg) { ResponseRedirect(); InitValue(); } } else { bool falg = PolicyManageService.SuspendPolicies(this.CurrentCompany.CompanyId, this.CurrentUser.UserName, Reason, ipAddress.ToString(), CurrentCompany.CompanyType == CompanyType.Platform ? PublishRole.平台 : PublishRole.用户, airlines.ToArray()); if (falg) { InitValue(); } } } catch (Exception ex) { ShowExceptionMessage(ex, "挂起政策"); } }
protected void btnHung_Click(object sender, EventArgs e) { try { string Reason = txtRemark.Text; List <string> airlines = new List <string>(); foreach (ListItem item in chkHung.Items) { if (item.Selected && item.Enabled) { airlines.Add(item.Value); } } if (airlines.Count == 0) { ShowMessage("挂起航空公司必须选择一个!本次操作被取消!"); return; } var companyId = CurrentCompany.CompanyType == CompanyType.Platform ? Guid.Parse(Request.QueryString["id"]) : CurrentCompany.CompanyId; var existsPolicyType = PolicyManageService.CheckIfHasDefaultPolicy(companyId, airlines); if (existsPolicyType != PolicyType.Unknown) { throw new CustomException(CurrentCompany.CompanyType == CompanyType.Platform ? "该供应商在平台存在" + existsPolicyType.GetDescription() + "指向,请调整后再行操作" : "该航线在平台存在" + existsPolicyType.GetDescription() + "指向,请联系平台调整后再行操作"); } if (txtRemark.Text.Trim() == "") { ShowMessage("挂起原因不能为空!请输入!"); return; } if (txtRemark.Text.Trim().Length > 100) { txtRemark.Text = txtRemark.Text.Trim().Substring(0, 100); ShowMessage("输入挂起原因过长,只能在100字以内!"); return; } var ipAddress = ChinaPay.AddressLocator.IPAddressLocator.GetRequestIP(HttpContext.Current.Request); //var ipLocation = ChinaPay.AddressLocator.CityLocator.GetIPLocation(ipAddress); bool falg = PolicyManageService.SuspendPolicies(this.CurrentCompany.CompanyId, this.CurrentUser.UserName, Reason, ipAddress.ToString(), CurrentCompany.CompanyType == CompanyType.Platform ? PublishRole.平台 : PublishRole.用户, airlines.ToArray()); if (falg) { InitValue(); } } catch (Exception ex) { ShowExceptionMessage(ex, "挂起政策"); } }