private bool isValidData(ChinaPay.B3B.Service.Foundation.Domain.AirCraft airCraft) { if (!string.IsNullOrEmpty(this.txtPlaneTypeCode.Text.Trim()) && this.txtPlaneTypeCode.Text.Trim().ToUpper() != airCraft.Code.Value.ToUpper()) { return(false); } if (this.ddlStatus.SelectedIndex > 0 && Convert.ToBoolean(this.ddlStatus.SelectedValue) != airCraft.Valid) { return(false); } return(true); }
private void Refresh(string code) { ChinaPay.B3B.Service.Foundation.Domain.AirCraft airCraft = FoundationService.QueryAirCraft(new Guid(code)); if (airCraft.Code.Value != null) { this.txtPlaneTypeCode.Text = airCraft.Code.Value; } if (airCraft.Name != null) { this.txtPlaneTypeName.Text = airCraft.Name; } if (airCraft.Manufacturer != null) { this.txtMake.Text = airCraft.Manufacturer; } if (airCraft.Description != null) { this.ttDescription.InnerText = airCraft.Description; } this.txtAirportPrice.Text = airCraft.AirportFee.ToString(); this.ddlStatus.SelectedValue = airCraft.Valid == true ? "T" : "F"; }
protected void gvPlaneType_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "opdate") { string code = e.CommandArgument.ToString(); ChinaPay.B3B.Service.Foundation.Domain.AirCraft air = FoundationService.QueryAirCraft(new Guid(code)); if (air == null) { return; } AirCraftView airCraftView = new AirCraftView() { Code = air.Code.Value, AirportFee = air.AirportFee, Description = air.Description, Manufacturer = air.Manufacturer, Name = air.Name, Valid = air.Valid == true ? false : true }; try { FoundationService.UpdateAirCraft(new Guid(code), airCraftView, CurrentUser.UserName); if (air.Valid) { RegisterScript("alert('禁用成功!'); window.location.href='PlaneType.aspx?Search=Back';"); } else { RegisterScript("alert('启用成功!'); window.location.href='PlaneType.aspx?Search=Back';"); } } catch (Exception ex) { ShowExceptionMessage(ex, air.Valid ? "禁用" : "启用"); return; } refresh(); } }