protected void grv_back_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "del") { PolicyManageService.Delete(this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryBackPolicy(grv_back.PageIndex + 1); } }
protected void btnUnAudited_Click(object sender, EventArgs e) { if (GetCheckBoxValue()) { var list_ids = hidIds.Value.Split(',').Select(Guid.Parse); PolicyManageService.CancelAudit(PolicyType.RoundTrip, this.CurrentUser.UserName, list_ids.ToArray()); QueryBackPolicy(pager.CurrentPageIndex); } }
protected void btnUnAudited_Click(object sender, EventArgs e) { if (GetCheckBoxValue()) { var list_ids = hidIsAll.Value == "0" ? hidIds.Value.Split(',').Select(Guid.Parse) : PolicyManageService.QueryPolicyIds(GetCondition()).Select(item => item.Key); PolicyManageService.CancelAudit(PolicyType.Bargain, this.CurrentUser.UserName, list_ids.ToArray()); QueryBargainPolicy(pager.CurrentPageIndex); ClaerHidValue(); } }
protected void btnDel_Click(object sender, EventArgs e) { if (GetCheckBoxValue()) { var list_ids = hidIds.Value.Split(',').Select(item => Guid.Parse(item)).ToArray(); PolicyManageService.Delete(this.CurrentUser.UserName, list_ids); QueryBackPolicy(grv_back.PageIndex + 1); } }
protected void btnDel_Click(object sender, EventArgs e) { if (GetCheckBoxValue()) { var list_ids = hidIds.Value.Split(',').Select(Guid.Parse).ToArray(); PolicyManageService.DeleteRoundTripPolicy(this.CurrentUser.UserName, list_ids); QueryBackPolicy(pager.CurrentPageIndex); } }
protected void btnSaveunlock_Click(object sender, EventArgs e) { if (CheckBoxValue()) { var list_ids = hidIds.Value.Split(',').Select(item => Guid.Parse(item)); PolicyManageService.UnLockPolicy(PolicyType.RoundTrip, this.CurrentUser.UserName, this.txtunlockReason.Text, list_ids.ToArray()); QueryBackPolicy(grv_back.PageIndex + 1); } }
protected override string ExecuteCore() { var flights = Context.GetParameterValue("flights"); var passengers = Context.GetParameterValue("passengers"); var contact = Context.GetParameterValue("contact"); var policyType = Context.GetParameterValue("policyType"); Vaild(flights, passengers, contact, policyType, InterfaceSetting); DataTransferObject.Order.OrderView orderView = new DataTransferObject.Order.OrderView(); bindOrderView(flights, passengers, contact, orderView); var pnrh = new PNRHelper(); try { if ((PolicyType)byte.Parse(policyType) != PolicyType.Special) { PNRPair pnr = pnrh.ReserveSeat(loadFlightView(flights, passengers), orderView.Passengers, Employee, Company); orderView.PNR = pnr; } if (pnrh.RequirePat(loadFlightView(flights, passengers), (PolicyType)byte.Parse(policyType))) { orderView.PATPrice = pnrh.Pat(orderView.PNR, loadFlightView(flights, passengers), PassengerType.Adult); } MatchedPolicy policy = QueryPolicies((PolicyType)byte.Parse(policyType), flights, passengers, orderView); if (policy != null) { if (policy.PolicyType == PolicyType.Special) { var p = PolicyManageService.GetSpecialPolicy(policy.Id); if (p != null && p.SynBlackScreen) { PNRPair pnr = pnrh.ReserveSeat(loadFlightView(flights, passengers), orderView.Passengers, Employee, Company); orderView.PNR = pnr; } } orderView.IsTeam = false; orderView.Source = OrderSource.InterfaceReservaOrder; Order order = OrderProcessService.ProduceOrder(orderView, policy, Employee, Guid.Empty, false); if (order.Source == OrderSource.InterfaceReservaOrder && !PNRPair.IsNullOrEmpty(order.ReservationPNR) && !String.IsNullOrWhiteSpace(order.Product.OfficeNo)) { if (policy.NeedAUTH && !string.IsNullOrEmpty(policy.OfficeNumber)) { authorize(order.ReservationPNR, policy.OfficeNumber); } } return("<id>" + order.Id + "</id><payable>" + (policy.ConfirmResource ? 0 : 1) + "</payable>" + ReturnStringUtility.GetOrder(order)); } } catch (Exception ex) { InterfaceInvokeException.ThrowCustomMsgException(ex.Message); } InterfaceInvokeException.ThrowCustomMsgException("生成订单失败,没有对应直达航班!"); return(""); }
private void InitTDataValue(bool falg) { NormalPolicy normal = PolicyManageService.GetNormalPolicy(Guid.Parse(Request.QueryString["id"].ToString())); if (normal != null) { lblCreator.Text = "<a href='javascript:GoTo(\"" + normal.Owner + "\")' title='查看该供应商的公司基础信息'>" + normal.AbbreviateName + "</a>"; lblVoyage.Text = normal.VoyageType.GetDescription(); lblAirline.Text = normal.Airline; lblDepartureDate.Text = normal.DepartureDateStart.ToString("yyyy-MM-dd") + "至" + normal.DepartureDateEnd.ToString("yyyy-MM-dd"); lblDeparture.Text = normal.Departure; lblArrival.Text = normal.Arrival; lblDepartureFilght.Text = normal.DepartureFlightsFilterType == Common.Enums.LimitType.None ? "不限" : normal.DepartureFlightsFilterType == Common.Enums.LimitType.Include ? "适用:" + normal.DepartureFlightsFilter : normal.DepartureFlightsFilterType == Common.Enums.LimitType.Exclude ? "不适用:" + normal.DepartureFlightsFilter : ""; lblExceptAirlines.Text = normal.ExceptAirways; txtStartTime.Text = normal.DepartureDateStart.ToString("yyyy-MM-dd"); txtEndTime.Text = normal.DepartureDateEnd.ToString("yyyy-MM-dd"); hidTime.Value = normal.DepartureDateEnd.ToString("yyyy-MM-dd"); lblCommission.Text = (normal.ProfessionCommission * 100).TrimInvaidZero(); chkBunksList.DataSource = normal.Berths.Split(',').ToList(); chkBunksList.DataBind(); } grvTiedian.DataSource = from item in PolicySetService.QueryNormalPolicySetting(Guid.Parse(Request.QueryString["id"].ToString()), falg, null) orderby item.OperationTime descending select new { item.Berths, Commission = (item.Commission * 100).TrimInvaidZero() + "%", item.Creator, item.Enable, EndTime = item.EndTime.ToString("yyyy-MM-dd"), item.FlightsFilter, item.Id, item.OperationTime, item.PolicyId, item.Remark, StartTime = item.StartTime.ToString("yyyy-MM-dd"), item.Type }; grvTiedian.DataBind(); if (falg) { hidKoudianOrTiedian.Value = "2"; } else { hidKoudianOrTiedian.Value = "1"; } }
protected void btnCheck_Click(object sender, EventArgs e) { try { PolicyManageService.ReleaseNormalImportPolicies(normalPolicys, this.CurrentCompany.CompanyId, this.CurrentUser.UserName); Response.Redirect("base_policy_manage.aspx", false); } catch (Exception ex) { ShowExceptionMessage(ex, "导入"); } }
protected void btnSave_Click(object sender, EventArgs e) { PolicyManageService.UpdateRoundTripPolicyCommission(Guid.Parse(hidIds.Value), Decimal.Parse(this.txtPrice.Text == "" ? "0" : this.txtPrice.Text), Decimal.Parse(this.txtInternalCommission.Text == "" ? "0" : this.txtInternalCommission.Text) / 100, Decimal.Parse(this.txtSubordinateCommission.Text == "" ? "0" : this.txtSubordinateCommission.Text) / 100, Decimal.Parse(this.txtProfessionCommission.Text == "" ? "0" : this.txtProfessionCommission.Text) / 100, this.CurrentUser.UserName); QueryBackPolicy(pager.CurrentPageIndex); try { } catch (Exception ex) { ShowExceptionMessage(ex, "修改返佣信息"); } }
/// <summary> /// 根据行程条件、行程类型及政策类型,获取相应的政策; /// </summary> /// <param name="airline">航空公司</param> /// <param name="voyages">行程条件</param> /// <param name="voyageType">行程类型</param> /// <param name="policyType">政策类型</param> /// <returns></returns> public IEnumerable <PolicyInfoBase> QueryPolicies(string airline, DataTable voyages, VoyageType voyageType, PolicyType policyType) { if (airline == null) { throw new ArgumentNullException("airline"); } if (voyages == null || voyages.Columns.Count == 0) { throw new ArgumentNullException("voyages"); } return(PolicyManageService.QueryPolicies(airline, voyages, voyageType, policyType)); }
/// <summary> /// 发布特殊政策 /// </summary> /// <param name="Policy"></param> /// <param name="operatorAccount"></param> public bool RegisterSpecialPolicy(SpecialPolicyReleaseInfo Special) { try { Special.BasicInfo.Owner = this.CurrentUser.Owner; return(PolicyManageService.ReleaseSpecialPolicies(Special, this.CurrentUser.UserName)); } catch (System.Data.Common.DbException ex) { Service.LogService.SaveExceptionLog(ex); throw new Exception("添加信息发生未知错误,请稍后再试"); } }
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, "挂起政策"); } }
/// <summary> /// 发布特价政策 /// </summary> /// <param name="Policy"></param> /// <param name="operatorAccount"></param> public bool RegisterSpecialOfferPolicy(BargainPolicyReleaseInfo Bargain) { try { Bargain.BasicInfo.Creator = this.CurrentUser.UserName; Bargain.BasicInfo.Owner = this.CurrentUser.Owner; return(PolicyManageService.ReleaseBargainPolicies(Bargain, this.CurrentUser.UserName)); } catch (System.Data.Common.DbException ex) { Service.LogService.SaveExceptionLog(ex); throw new Exception("添加信息发生未知错误,请稍后再试"); } }
///// <summary> ///// 发布往返政策 ///// </summary> ///// <param name="Policy"></param> ///// <param name="operatorAccount"></param> //public bool RegisterProductClassPolicy(RoundTripPolicyReleaseInfo Round) //{ // try // { // Round.BasicInfo.Owner = this.CurrentUser.Owner; // return PolicyManageService.ReleaseRoundTripPolicies(Round, this.CurrentUser.UserName); // } // catch (System.Data.Common.DbException) // { // throw new Exception("添加信息发生未知错误,请稍后再试"); // } //} /// <summary> /// 发布团队政策 /// </summary> /// <param name="Normal"> </param> public bool RegisterTeamPolicy(TeamPolicyReleaseInfo team) { try { team.BasicInfo.Creator = this.CurrentUser.UserName; team.BasicInfo.Owner = this.CurrentUser.Owner; return(PolicyManageService.ReleaseTeamPolicies(team, this.CurrentUser.UserName)); } catch (System.Data.Common.DbException ex) { Service.LogService.SaveExceptionLog(ex); throw new Exception("添加信息发生未知错误,请稍后再试"); } }
/// <summary> /// 发布缺口政策 /// </summary> /// <param name="Normal"> </param> public bool RegisterNotchPolicy(NotchPolicyReleaseInfo notch) { try { notch.Creator = this.CurrentUser.UserName; notch.Owner = this.CurrentUser.Owner; return(PolicyManageService.ReleaseNotchPolicies(notch, this.CurrentUser.UserName)); } catch (System.Data.Common.DbException ex) { Service.LogService.SaveExceptionLog(ex); throw new Exception("添加信息发生未知错误,请稍后再试"); } }
protected void btnSave_Click(object sender, EventArgs e) { if (valiate()) { PriceType priceType = PriceType.Price; decimal subordinateCommission = 0; decimal professionCommission = 0; decimal internalCommission = 0; decimal price = 0; if (radPrice.Checked) { priceType = PriceType.Price; price = decimal.Parse(this.txtPrice.Text); if (!string.IsNullOrWhiteSpace(this.txtSubordinateCommission.Text)) { subordinateCommission = decimal.Parse(this.txtSubordinateCommission.Text); } if (!string.IsNullOrWhiteSpace(this.txtProfessionCommission.Text)) { professionCommission = decimal.Parse(this.txtProfessionCommission.Text); } if (!string.IsNullOrWhiteSpace(this.txtInternalCommission.Text)) { internalCommission = decimal.Parse(this.txtInternalCommission.Text); } } if (radLapse.Checked) { priceType = PriceType.Subtracting; price = decimal.Parse(this.txtLapse.Text) / 100; if (!string.IsNullOrWhiteSpace(this.txtSubordinateCommission.Text)) { subordinateCommission = decimal.Parse(this.txtSubordinateCommission.Text) / 100; } if (!string.IsNullOrWhiteSpace(this.txtProfessionCommission.Text)) { professionCommission = decimal.Parse(this.txtProfessionCommission.Text) / 100; } if (!string.IsNullOrWhiteSpace(this.txtInternalCommission.Text)) { internalCommission = decimal.Parse(this.txtInternalCommission.Text) / 100; } } PolicyManageService.UpdateSpecialPolicyPrice(Guid.Parse(hidIds.Value), priceType, price, subordinateCommission, internalCommission, professionCommission, this.CurrentUser.UserName); QuerySpecialPolicy(pager.CurrentPageIndex); } QuerySpecialPolicy(pager.CurrentPageIndex); }
protected void dataSource_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName.ToString() == "del") { try { PolicyManageService.DeletePolicySetting(this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); btnQuery_Click(sender, e); } catch (Exception ex) { ShowExceptionMessage(ex, "删除"); } } }
protected void grv_specical_RowCommand(object sender, GridViewCommandEventArgs e) { //确认审核 if (e.CommandName == "Audited") { PolicyManageService.AuditSpecialPolicy(this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QuerySpecialPolicy(grv_special.PageIndex + 1); } //取消审核 if (e.CommandName == "UnAudited") { PolicyManageService.CancelAuditSpecialPolicy(this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QuerySpecialPolicy(grv_special.PageIndex + 1); } }
private HashSet <PolicyInfoBase> LoadPolicies() { var data = new HashSet <PolicyInfoBase>(new PolicyComparer("Id")); data.AddRange(PolicyManageService.QueryPolicies <NormalPolicyInfo>(p => p.Audited && !p.Freezed && p.OwnerAudited && p.OwnerEnabled).ToList().Where(p => !p.Suspended && !p.OwnerIsExpired)); data.AddRange(PolicyManageService.QueryPolicies <BargainPolicyInfo>(p => p.Audited && !p.Freezed && p.OwnerAudited && p.OwnerEnabled).ToList().Where(p => !p.Suspended && !p.OwnerIsExpired)); data.AddRange(PolicyManageService.QueryPolicies <SpecialPolicyInfo>(p => p.Audited && p.PlatformAudited && !p.Freezed && p.OwnerAudited && p.OwnerEnabled).ToList().Where(p => !p.Suspended && !p.OwnerIsExpired)); // 2012-10-21 增加,团队政策; data.AddRange(PolicyManageService.QueryPolicies <TeamPolicyInfo>(p => p.Audited && !p.Freezed && p.OwnerAudited && p.OwnerEnabled).ToList().Where(p => !p.Suspended && !p.OwnerIsExpired)); // 2012-10-18 修改,修改第一行,去掉了资源张数的限制,在最后再去判断;去掉了第两行; //data.AddRange(PolicyManageService.QueryPolicies<SpecialPolicyInfo>(p => p.Audited && p.PlatformAudited && !p.Freezed && p.ResourceAmount > 0 && p.OwnerAudited && p.OwnerEnabled).ToList().Where(p => !p.Suspended && !p.OwnerIsExpired)); //data.AddRange(PolicyManageService.QueryPolicies<RoundTripPolicyInfo>(p => p.Audited && !p.Freezed && p.OwnerAudited && p.OwnerEnabled).ToList().Where(p => !p.Suspended && !p.OwnerIsExpired)); return(data); }
protected void btnSave_Click(object sender, EventArgs e) { if (Valiate()) { try { BargainDefaultPolicy policy = saveInfo(); PolicyManageService.SaveBargainDefaultPolicy(policy, this.CurrentUser.UserName); RegisterScript("alert('保存成功');window.location.href='bargain_defaultpolicy_manage.aspx';", false); } catch (Exception ex) { ShowExceptionMessage(ex, "保存"); } } }
private void InitlblData() { var roundTrip = PolicyManageService.GetRoundTripPolicy(Guid.Parse(Request.QueryString["id"])); if (roundTrip == null) { return; } hidIds.Value = Request.QueryString["id"]; lblAirline.Text = roundTrip.Airline; lblArrival.Text = roundTrip.Arrival; lblVoyage.Text = roundTrip.VoyageType.GetDescription(); lblOffice.Text = roundTrip.OfficeCode; lblTicket.Text = roundTrip.TicketType.GetDescription(); lblDeparture.Text = roundTrip.Departure; lblDepartureDate.Text = (roundTrip.DepartureDateStart.ToString("yyyy-MM-dd")) + "-" + (roundTrip.DepartureDateEnd.ToString("yyyy-MM-dd")); lblArrivalDate.Text = (roundTrip.ReturnDateStart == null ? "" : ((DateTime)roundTrip.ReturnDateStart).ToString("yyyy-MM-dd")) + "-" + (roundTrip.ReturnDateEnd == null ? "" : ((DateTime)roundTrip.ReturnDateEnd).ToString("yyyy-MM-dd")); lblCreateTime.Text = roundTrip.StartPrintDate.ToString("yyyy-MM-dd"); lblBunks.Text = roundTrip.Berths; lblDepartureFilght.Text = roundTrip.DepartureFlightsFilterType == LimitType.None ? "所有" : (roundTrip.DepartureFlightsFilterType == LimitType.Include ? "适用以下航班:" + roundTrip.DepartureFlightsFilter : "不适用以下航班:" + roundTrip.DepartureFlightsFilter); lblRetnrnFilght.Text = roundTrip.ReturnFlightsFilterType == LimitType.None ? "所有" : (roundTrip.ReturnFlightsFilterType == LimitType.Include ? "适用以下航班:" + roundTrip.ReturnFlightsFilter : "不适用以下航班:" + roundTrip.ReturnFlightsFilter); lblDepartureFilghtDate.Text = roundTrip.DepartureDatesFilterType == DateMode.Date ? roundTrip.DepartureDatesFilter : StringOperation.TransferToChinese(roundTrip.DepartureDatesFilter); lblReturnFilghtDate.Text = roundTrip.ReturnDatesFilterType == DateMode.Date ? roundTrip.ReturnDatesFilter : StringOperation.TransferToChinese(roundTrip.ReturnDatesFilter); lblNeiBu.Text = (roundTrip.InternalCommission * 100).TrimInvaidZero() + "%"; lblXiaJi.Text = (roundTrip.SubordinateCommission * 100).TrimInvaidZero() + "%"; lblTongHang.Text = (roundTrip.ProfessionCommission * 100).TrimInvaidZero() + "%"; lblLock.Text = roundTrip.Freezed == true ? "锁定" : "未锁定"; lblRemaek.Text = roundTrip.Remark; lblPrice.Text = "¥" + roundTrip.Price.TrimInvaidZero(); lblChang.Text = roundTrip.ChangePNR ? "需要" : "不需要"; lblLvyou.Text = roundTrip.TravelDays + "天"; lblDrawerCondition.Text = roundTrip.DrawerCondition; if (roundTrip.Freezed) { btnunlock.Visible = true; btnlock.Visible = false; unlock.Visible = true; @lock.Visible = false; } else { btnunlock.Visible = false; btnlock.Visible = true; unlock.Visible = false; @lock.Visible = true; } }
protected void btnUnAudited_Click(object sender, EventArgs e) { if (GetCheckBoxValue()) { var list_ids = hidIsAll.Value == "0" ? hidIds.Value.Split(',').Select(Guid.Parse) : PolicyManageService.QueryPolicyIds(GetCondition()).Select(item => item.Key); try { PolicyManageService.CancelAudit(PolicyType.Team, this.CurrentUser.UserName, list_ids.ToArray()); } catch (Exception ex) { ShowExceptionMessage(ex, "取消审核"); } QueryTeamPolicy(pager.CurrentPageIndex); ClaerHidValue(); } }
protected void dataSource_RowCommand(object sender, GridViewCommandEventArgs e) { string[] condition = e.CommandArgument.ToString().Split(','); string airline = condition[0]; string provinceCode = condition[1]; try { PolicyManageService.DeleteBargainDefaultPolicy(airline, provinceCode, this.CurrentUser.UserName); ShowMessage("删除成功!"); } catch (Exception ex) { ShowExceptionMessage(ex, "删除"); } btnQuery_Click(sender, e); }
private void queryPolicySetting(Pagination pagination) { try { var queryList = PolicyManageService.GetPolicySettings(getCondition(), pagination); var list = from item in queryList select new { Id = item.Id, Airline = item.Airline, //出发城市 Departure = item.Departure, //到达城市 Arrival = item.Arrivals, // VoyageType = item.VoyageType.GetDescription(), Commission = GetCommisson(item.Periods), Berths = item.Berths, EffectiveTime = item.EffectiveTimeStart.ToShortDateString() + "<br />" + item.EffectiveTimeEnd.ToShortDateString(), Creator = item.Creator, LastModifyTime = item.LastModifyTime, Remark = item.Remark }; this.dataSource.DataSource = list; this.dataSource.DataBind(); if (pagination.RowCount > 0) { this.pager.Visible = true; emptyDataInfo.Visible = false; if (pagination.GetRowCount) { this.pager.RowCount = pagination.RowCount; } dataSource.HeaderRow.TableSection = TableRowSection.TableHeader; } else { this.pager.Visible = false; emptyDataInfo.Visible = true; } } catch (Exception ex) { ShowExceptionMessage(ex, "查询"); } }
//解挂 protected void btnSolution_Click(object sender, EventArgs e) { var airlines = (from ListItem item in chklist.Items where item.Selected && item.Enabled select item.Value).ToList(); 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; } string flag = Request.QueryString["flag"]; CompanyType type = CurrentCompany.CompanyType; var ipAddress = ChinaPay.AddressLocator.IPAddressLocator.GetRequestIP(HttpContext.Current.Request); //var ipLocation = ChinaPay.AddressLocator.CityLocator.GetIPLocation(ipAddress); if (type == CompanyType.Platform && flag == "solution" && flag != null) { string Reason = SolutionReason.Text; bool falg = PolicyManageService.UnSuspendPolicies(Guid.Parse(Request.QueryString["id"]), this.CurrentUser.UserName, Reason, ipAddress.ToString(), CurrentCompany.CompanyType == CompanyType.Platform ? PublishRole.平台 : PublishRole.用户, airlines.ToArray()); if (falg) { ResponseRedirect(); InitValue(); } } else { string Reason = SolutionReason.Text; bool falg = PolicyManageService.UnSuspendPolicies(this.CurrentCompany.CompanyId, this.CurrentUser.UserName, Reason, ipAddress.ToString(), CurrentCompany.CompanyType == CompanyType.Platform ? PublishRole.平台 : PublishRole.用户, airlines.ToArray()); if (falg) { InitValue(); } } }
void QueryPolicy(Pagination pagination) { try { var list_query = PolicyManageService.QueryPolicyHarmonies(GetCondition(), pagination); var list = from item in list_query select new { Id = item.Id, AirLine = item.Airlines, Departure = item.Departure, Arrival = item.Arrival, HarmonyValue = (item.HarmonyValue * 100).TrimInvaidZero(), PolicyType = GetPolicyInfo(item.PolicyType), CommissionType = item.DeductionType == Common.Enums.DeductionType.Profession ? "同行返佣" : "下级返佣", TimeInfo = item.EffectiveLowerDate.ToString("yyyy-MM-dd") + "<br />" + item.EffectiveUpperDate.ToString("yyyy-MM-dd"), CreateName = item.Account, CreateTime = item.CreateTime, LastModifyTime = item.LastModifyTime, LastModifyName = item.LastModifyName, Remark = item.Remark }; this.grv_back.DataSource = list; this.grv_back.DataBind(); if (list.Any()) { this.pager.Visible = true; if (pagination.GetRowCount) { this.pager.RowCount = pagination.RowCount; } showempty.Visible = false; grv_back.HeaderRow.TableSection = TableRowSection.TableHeader; } else { this.pager.Visible = false; showempty.Visible = true; } } catch (Exception ex) { ShowExceptionMessage(ex, "查询"); } }
void QueryPolicy(Pagination pagination) { try { var querylist = PolicyManageService.GetSuspendOperation(GetCondition(), pagination); var list = from item in querylist select new { OptionTime = item.OperateTime, Option = item.CompanyId == Guid.Parse("00000000-0000-0000-0000-000000000001") ? item.CompanyName + "(" + item.Operator + ")" : "<a href='/OrganizationModule/TerraceModule/CompanyInfoManage/LookUpCompanyInfo.aspx?CompanyId=" + item.CompanyId + "'>" + item.CompanyName + "(" + item.Operator + ")" + " </a>", OptionOwnerType = item.OperatorRoleType.GetDescription(), OptionType = item.OperateType.GetDescription(), OptionContent = item.OperateType.GetDescription() + ":" + item.Airlines, OptionReason = item.Reason, IP = item.IP, companyid = item.CompanyId, companyName = item.CompanyName }; grvlog.DataSource = list; grvlog.DataBind(); if (pagination.RowCount > 0) { this.pager.Visible = true; if (pagination.GetRowCount) { this.pager.RowCount = pagination.RowCount; } showempty.Visible = false; grvlog.HeaderRow.TableSection = TableRowSection.TableHeader; } else { showempty.Visible = true; this.pager.Visible = false; } } catch (Exception ex) { ShowExceptionMessage(ex, "查询"); } }
protected void grv_back_RowCommand(object sender, GridViewCommandEventArgs e) { //确认审核 if (e.CommandName == "Audited") { PolicyManageService.Audit(PolicyType.RoundTrip, this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryBackPolicy(pager.CurrentPageIndex); } //取消审核 if (e.CommandName == "UnAudited") { PolicyManageService.CancelAudit(PolicyType.RoundTrip, this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryBackPolicy(pager.CurrentPageIndex); } //删除政策 if (e.CommandName == "del") { PolicyManageService.DeleteRoundTripPolicy(this.CurrentUser.UserName, Guid.Parse(e.CommandArgument.ToString())); QueryBackPolicy(pager.CurrentPageIndex); } }
protected void btnDelete_Click(object sender, EventArgs e) { List <Guid> ids = new List <Guid>(); foreach (GridViewRow row in dataSource.Rows) { CheckBox chk = (CheckBox)row.FindControl("chkBox"); Label lbl = row.FindControl("lblId") as Label; if (chk.Checked) { Guid id = Guid.Parse(lbl.Text); ids.Add(id); } } if (ids.Count > 0) { PolicyManageService.DeletePolicySetting(this.CurrentUser.UserName, ids.ToArray()); btnQuery_Click(sender, e); } }