public static void AddFixedNavigation(FixedNavigationView fixedNavigationView, string account) { if (Service.Foundation.Domain.FixedNavigations.Instance.Query(fixedNavigationView.Departure, fixedNavigationView.Arrival) != null) { throw new ChinaPay.Core.Exception.KeyRepeatedException("[" + fixedNavigationView.Departure + "]-[" + fixedNavigationView.Arrival + "] 此条航线已经存在"); } Service.Foundation.Domain.FixedNavigations.Instance.Insert(fixedNavigationView); saveAddLog("非固定航线", fixedNavigationView.ToString(), fixedNavigationView.Departure + fixedNavigationView.Arrival, account); }
private bool isValidData(FixedNavigationView view) { if (!string.IsNullOrEmpty(ucDepartures.Code) && ucDepartures.Code != view.Departure) { return(false); } if (!string.IsNullOrEmpty(ucArrivals.Code) && ucArrivals.Code != view.Arrival) { return(false); } return(true); }
protected void btnSave_Click(object sender, EventArgs e) { try { Checking(); var fixedNavigation = new FixedNavigationView(); fixedNavigation.Departure = ucDeparture.Code; fixedNavigation.Arrival = ucArrival.Code; FoundationService.AddFixedNavigation(fixedNavigation, CurrentUser.UserName); ShowMessage("保存成功!"); refresh(); } catch (Exception ex) { ShowExceptionMessage(ex, "保存"); } }
public static void DeleteFixedNavigation(FixedNavigationView fixedNavigationView, string account) { Service.Foundation.Domain.FixedNavigations.Instance.Delete(fixedNavigationView); saveDeleteLog("非固定航线", fixedNavigationView.ToString(), fixedNavigationView.Departure + fixedNavigationView.Arrival, account); }