예제 #1
0
 protected void gvAirline_RowCommand(object sender, GridViewCommandEventArgs e)
 {
     if (e.CommandName == "opdate")
     {
         string code = e.CommandArgument.ToString();
         ChinaPay.B3B.Service.Foundation.Domain.Airline air = FoundationService.QueryAirline(code);
         if (air == null)
         {
             return;
         }
         AirlineView airlineView = new AirlineView()
         {
             Code       = code.Trim(),
             Valid      = !air.Valid,
             Name       = air.Name,
             ShortName  = air.ShortName,
             SettleCode = air.SettleCode
         };
         try {
             FoundationService.UpdateAirline(airlineView, CurrentUser.UserName);
             if (air.Valid)
             {
                 RegisterScript("alert('禁用成功!'); window.location.href='Airline.aspx?Search=Back';");
             }
             else
             {
                 RegisterScript("alert('启用成功!'); window.location.href='Airline.aspx?Search=Back';");
             }
         } catch (Exception ex) {
             ShowExceptionMessage(ex, air.Valid ? "禁用" : "启用");
             return;
         }
         refresh();
     }
 }
예제 #2
0
 private void Refresh(string code)
 {
     ChinaPay.B3B.Service.Foundation.Domain.Airline airLine = FoundationService.QueryAirline(code);
     if (airLine == null)
     {
         return;
     }
     this.txtErCode.Text                 = airLine.Code.Value;
     this.txtAirlineName.Text            = airLine.Name;
     this.txtAirlineShortName.Text       = airLine.ShortName;
     this.txtJsCode.Text                 = airLine.SettleCode;
     this.ddlAirlineStatus.SelectedValue = airLine.Valid == true ? "T" : "F";
 }
예제 #3
0
 private bool isValidData(ChinaPay.B3B.Service.Foundation.Domain.Airline airline)
 {
     if (!string.IsNullOrEmpty(this.txtErCode.Text.Trim().ToUpper()) && this.txtErCode.Text.Trim().ToUpper() != airline.Code.Value)
     {
         return(false);
     }
     if (!string.IsNullOrEmpty(this.txtErName.Text.Trim()) && this.txtErName.Text.Trim() != airline.Name)
     {
         return(false);
     }
     if (!string.IsNullOrEmpty(this.txtErShortName.Text.Trim()) && this.txtErShortName.Text.Trim() != airline.ShortName)
     {
         return(false);
     }
     if (!string.IsNullOrEmpty(this.txtErSettleCode.Text.Trim()) && this.txtErSettleCode.Text.Trim() != airline.SettleCode)
     {
         return(false);
     }
     if (this.ddlAirportStatus.SelectedIndex > 0 && Convert.ToBoolean(this.ddlAirportStatus.SelectedValue) != airline.Valid)
     {
         return(false);
     }
     return(true);
 }