/// <summary> /// 清除本局全部座位游戏数据 /// </summary> private void ClearAllSeatInfo() { for (int i = 0; i < Seats.Count(); i++) { Seats[i].ClearSeatInfo(); } }
private void btnSave_Click(object sender, RoutedEventArgs e) { try { if (Seats == null || Seats.Count() == 0) { txbMessage.Text = "Please enter Rows and Columns to generate layout"; txbMessage.Height = 30; return; } txbMessage.Height = 0; var result = ModernDialog.ShowMessage("Are you sure, you want to Save Layout ?", "Confirmation", MessageBoxButton.YesNo); if (result == MessageBoxResult.Yes) { ManageLoadingDataVisibility(false, true); Screenclasses objScreenclasses = new Screenclasses(); objScreenclasses.ScreenId = Convert.ToInt32(cmbScreen.SelectedValue); objScreenclasses.ScreenClassId = Convert.ToInt32(cmbClass.SelectedValue); objScreenclasses.RowCount = Convert.ToInt32(txtRows.Text); objScreenclasses.ColumnCount = Convert.ToInt32(txtColumns.Text); objScreenclasses.seats = new List <Seat>(); foreach (SeatProperties sp in Seats.Where(w => w.Column != 0 && w.Row != 0)) { objScreenclasses.seats.Add(new Seat() { ColumnText = Convert.ToString(sp.ColumnText), ColumnValue = sp.Column, RowText = sp.RowText, RowValue = sp.Row }); } int insertRresult = new SeatLayoutConfig().BulkInsertSeat(objScreenclasses); if (insertRresult == 1) { Helper.LoadDropDownSource(cmbClass, new SeatLayoutConfig().GetScreeClasses(Convert.ToInt32(cmbScreen.SelectedValue)), "ScreenClassName", "ScreenClassId", false); } ModernDialog.ShowMessage(insertRresult == 1 ? "Screen Layout saved succefully" : "Unable to save Screen Layout at this moment.. Try after sometime", "Alert", MessageBoxButton.OK); ManageLoadingDataVisibility(false, false); } } catch (Exception ex) { ManageLoadingDataVisibility(false, false); LogExceptions.LogException(ex); } }
/// <summary> /// 清除本局全部座位游戏数据 /// </summary> private void ClearAllSeatInfo() { for (int i = 0; i < Seats.Count(); i++) { Seats[i].GameDateObj.Clear(); Seats[i].GameDateStr.Clear(); } //foreach (var item in Seats) //{ // Seats.Clear(); //} GameDateStr.Clear(); GameDateObj.Clear(); }
public override string ToString() { // This uses LINQ, don't sweat it if it doesn't make sense just yet, was just answering Jia's question. return($"A {Color} {Make} {Model} with {Seats.Length} seats ({Seats.Count(x => x.Occupied == true)} of which {(Seats.Count(x => x.Occupied == true) == 1 ? "is" : "are")} occupied),on the odometer, that has enough fuel to travel {FuelTank.Level * Motor.FuelEfficiency}KM."); }
public bool IsValidAirplane() { return(Id != null && Seats.Count > 0 && Seats.Count(x => x.Available == AvailabilityEnum.Free) > 0); }