Esempio n. 1
0
 void QueryPolicy(Pagination pagination)
 {
     try
     {
         var list_query = PolicyManageService.GetRoundTripPolicies(GetCondition(pagination), item => item.CreateTime, OrderMode.Descending);
         var list       = from item in list_query
                          select new
         {
             //政策编号
             id = item.Id,
             //航空公司
             Airline = item.Airline,
             //出发城市
             Departure = item.Departure,
             //到达城市
             Arrival = item.Arrival,
             //票证行程
             TicketType = item.TicketType + "<br />" + item.VoyageType.GetDescription(),
             //适用班期
             //  DepartureDatesFilter = item.DepartureDatesFilterType == DateMode.Date ? item.DepartureDatesFilter : StringOperation.TransferToChinese(item.DepartureDatesFilter),
             //适用航班
             Include = item.DepartureFlightsFilterType == LimitType.None ? "所有" : (item.DepartureFlightsFilterType == LimitType.Include ? item.DepartureFlightsFilter : "&nbsp;"),
             //排除航班
             Exclude = item.DepartureFlightsFilterType == LimitType.Exclude ? item.DepartureFlightsFilter : "&nbsp;",
             //适用舱位
             Berths = item.Berths,
             //价格
             Price = item.Price.TrimInvaidZero(),
             //返佣信息
             Commission = BasePolicy.CanHaveSubordinate(CurrentCompany.CompanyId) ?
                          "内部: " + (item.InternalCommission * 100).TrimInvaidZero()
                          + "%<br />下级: " + (item.SubordinateCommission * 100).TrimInvaidZero()
                          + "%<br />同行: " + (item.ProfessionCommission * 100).TrimInvaidZero() + "%" :
                          "下级: " + (item.SubordinateCommission * 100).TrimInvaidZero()
                          + "%<br />同行: " + (item.ProfessionCommission * 100).TrimInvaidZero() + "%",
             InternalCommission    = (item.InternalCommission * 100).TrimInvaidZero(),
             SubordinateCommission = (item.SubordinateCommission * 100).TrimInvaidZero(),
             ProfessionCommission  = (item.ProfessionCommission * 100).TrimInvaidZero(),
             //去程日期
             DepartureDates = item.DepartureDateStart.ToString("yyyy-MM-dd") + "<br />" + item.DepartureDateEnd.ToString("yyyy-MM-dd"),
             //回程日期
             ReturnDates = item.VoyageType == VoyageType.OneWay ? "" : (item.ReturnDateStart.Value.ToString("yyyy-MM-dd") + "<br />" + item.ReturnDateEnd.Value.ToString("yyyy-MM-dd")),
             //供应方
             Opearor            = item.Creator,
             Sudit              = item.Audited ? "已审" : "未审",
             SuditName          = item.Audited ? "UnAudited" : "Audited",
             SuditTip           = item.Audited ? "取消审核" : "确认审核",
             CanHaveSubordinate = BasePolicy.CanHaveSubordinate(CurrentCompany.CompanyId),
             Hang = item.Suspended ? BasePolicy.GetHungInfo(item.Airline, this.CurrentCompany.CompanyId) : "未挂"
         };
         this.grv_back.DataSource = list;
         this.grv_back.DataBind();
         if (list.Any())
         {
             this.pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 this.pager.RowCount = list_query.RowCount;
             }
             showempty.Visible = false;
             grv_back.HeaderRow.TableSection = TableRowSection.TableHeader;
         }
         else
         {
             this.pager.Visible = false;
             showempty.Visible  = true;
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "查询");
     }
 }
Esempio n. 2
0
 void QueryPolicy(Pagination pagination)
 {
     try
     {
         var query_list = PolicyManageService.GetRoundTripPolicies(GetCondition(pagination), item => item.CreateTime, OrderMode.Descending);
         var list       = from item in query_list
                          select new
         {
             //政策编号
             id = item.Id,
             //航空公司
             Airline = item.Airline,
             //出发城市
             Departure = item.Departure,
             //到达城市
             Arrival = item.Arrival,
             //票证行程
             TicketType = item.TicketType + "<br />" + item.VoyageType.GetDescription(),
             //适用班期
             // DepartureDatesFilter = item.DepartureDatesFilterType == DateMode.Date ? item.DepartureDatesFilter : StringOperation.TransferToChinese(item.DepartureDatesFilter),
             //适用航班
             Include = item.DepartureFlightsFilterType == LimitType.None ? "所有" : (item.DepartureFlightsFilterType == LimitType.Include ? item.DepartureFlightsFilter : "&nbsp;"),
             //排除航班
             Exclude = item.DepartureFlightsFilterType == LimitType.Exclude ? item.DepartureFlightsFilter : "&nbsp;",
             ////排除航线
             //ExceptAirways = item.ExceptAirways.Length > 3 ? item.ExceptAirways.ToString().Substring(0, 3) + "...<div class='DepartureTip'>" + StringOperation.InsertFormat(item.ExceptAirways.ToString(), 32, "<br />") + "</div>" : item.ExceptAirways,
             //适用舱位
             Berths = item.Berths,
             //返佣信息
             Commission = "内部:" + (item.InternalCommission * 100).TrimInvaidZero()
                          + "%<br />下级:" + (item.SubordinateCommission * 100).TrimInvaidZero()
                          + "%<br />同行:" + (item.ProfessionCommission * 100).TrimInvaidZero() + "%",
             //去程日期
             DepartureDates = item.DepartureDateStart.ToString("yyyy-MM-dd") + "<br />" + item.DepartureDateEnd.ToString("yyyy-MM-dd"),
             //回程日期
             ReturnDates = item.VoyageType == VoyageType.OneWay ? "" : (item.ReturnDateStart.Value.ToString("yyyy-MM-dd") + "<br />" + item.ReturnDateEnd.Value.ToString("yyyy-MM-dd")),
             //供应方
             Opearor = GetCompanyName(item.Owner),
             Sudit   = item.Audited == true ? "已审" : "未审",
             Lock    = item.Freezed == true ? "锁定" : "未锁定",
             LockTip = item.Freezed == true ? "<a href='javascript:unlockpolicy(\"" + item.Id + "\")'>解锁</a>" : "<a href='javascript:lockpolicy(\"" + item.Id + "\")'>锁定</a>",
             Hang    = item.Suspended ? ChinaPay.B3B.TransactionWeb.PolicyModule.TransactionPolicy.BasePolicy.GetHungInfo(item.Airline, item.Owner) : "未挂"
         };
         this.grv_back.DataSource = list;
         this.grv_back.DataBind();
         if (list.Any())
         {
             this.pager.Visible = true;
             if (pagination.GetRowCount)
             {
                 this.pager.RowCount = query_list.RowCount;
             }
             showempty.Visible = false;
             grv_back.HeaderRow.TableSection = TableRowSection.TableHeader;
         }
         else
         {
             this.pager.Visible = false;
             showempty.Visible  = true;
         }
     }
     catch (Exception ex)
     {
         ShowExceptionMessage(ex, "查询");
     }
 }